Hello, I am an electronic engineer experienced in analog electronic design.
For your project what you need is a transformer where the magnetic coupling is between the AC cable and a solenoid winding , ie. PCB coil. When the winding approaches a certain distance. This is coupled and an alternating current is obtained in which it is then rectified and detected with a comparator OP amp, giving the digital signal. Some questions arise: how will the circuit be fed? must it have its own power, or remove it from the coupling of the AC line, the digital signal, it would be convenient to use a transistor in an open collector if it is a long cable ?. I hope to help you in your project.
Greetings.
Norman