Sensing mains power

Hi all

I’d like a fast acting way to sense whether the lights are switched on (manually) in a room.

I do this already to make table lamps follow the ceiling lamps by using a sonoff basic wired in parallel with the lights. When it is reachable/pingable then I know the lights are on. It works well… however, there is a 5-10 second delay whilst the sonoff powers up and joins the network. This confuses untechy spouse…

I’d like a device that can sense instamtly when mains is applied to an input and thus the lights are on.

Any ideas ?


The simple solution would be a shelly device, but wired to the mains of the light, not parallel to the light itself.
Either only use the switch input to sense if light is ON or OFF or use the shelly to switch the light. This way you could control the light

+1 to Shelly modules. Simply wire the light in such a way that its power is connected to the Shelly’s relay channel and then wire the light switch in such a way that when switched, it pipes mains voltage into the Shelly’s switch input terminal, effectively acting as a sensor.

Via software and the Shelly config, you can then set the behavior. Eg, switch the relay as soon as the physical switch is thrown, or even “decouple” the switch from the relay and have it be purely software controlled.

In my setup, we use mostly momentary wall switches instead of toggle switches and since the Shellies can report long and double-presses, a single momentary switch can do all sorts of functions to even “dumb” lights.