My nightstand lights are connected to a surge protector plugged into a Zigbee smart plug plugged into a dumb wall outlet controlled by a single dumb wall switch.
I have the smart plug set to default=On, so the wall switch works fine, and I can also turn the lights off from my phone or via an automation. All good so far.
What I WANT is to be able to turn the lights ON without getting out of bed, and irrespective of the position of the switch.
I tried putting a second smart plug in the switch-controlled outlet and making an automation to toggle the surge protector’s smart plug when the switch’s empty smart plug powers off/on via the wall switch, but it looks like it’s not simple to detect a Zigbee device “disappearing”. I found some integrations that detect zigbee devices disappearing, but those seemed more for running health checks to detect and repair moved devices than for live detection.
Any suggestions?
Edit:
Looks like a relay behind the switch will be my best bet. Thank you all!
Here is a question you need to figure out: Switch is in the on position, and you use the remote to turn the light off, what happens when the switch is moved to off?
According to my wife the only satisfactory answer to this question is when the remote turns the light off the switch moves to off and so you cannot turn it off in this case! (she wants the same behavior from the old 3-way light switches that have been around for decades)
Nothing! The lights stay off.
I want to be able to turn the lights on or off from both the switch and the app, each overriding the other.
The ideal case would be the switch physically moving to match the app toggle position, but I don’t know if that’s possible.
See my other comment. I guess a 3-way-switch with a relay could work, but not a relay in parallel with the switch. Sequence might achieve the goal but it’s not fully functional
So, I’ve been looking at Shelley’s smart switch modules which actually get wired in behind the light switch and use it as an input to control the smart switch. It involves simple wiring, requires a neutral in the switch box, but would give you control from either the switch or otherwise.
For me, it would let me control the lamps in my apartment and not show anyone that I had made all the switches smart.
Shelly relays are amazing, you wire the load and switches to it. Making a dumb light smart
Here in the UK we don’t have a neutral wire the light switch, so I have a shelly in the light fitting
Oh, that’s genius! I know a light I had to skip making smart because it didn’t have a neutral, but putting it in the light is a great solution!
That looks like a good option, thank you for the tip!
What?
As I read through that Goldbergian stream of connectedness, I’m left wondering:
-
Whatever you really trying to accomplish that brought this on
-
Won’t that wall switch always be a manual interrupt for the automation
Basically, don’t you want to automate the wall switch or lock it to being always on? (There are wall plates for this).
Kinda sounds like the setup is
Ac mains -> dumb switch -> ZigBee switch -> power board -> light.And they want to turn the light on while the wall switch is off, which sounds like it won’t work because the power would be off, also turning power off to the ZigBee switch and the light.
The goal is correct, but the current setup is incorrect. Right now, I have:
AC mains -> dumb switch -> zigbee smart plug
AND
AC mains -> zigbee smart plug -> surge strip with two lights on it
Your idea works in theory, but in practice, using a ZigBee plug as a power sensor -even if you managed to program a way of detecting its online/offline status, will probably have too many issues.
The protocol is designed for low power and so has to be robust to temporary connectivity issues from interference. You would either have too much latency between the switch and the light turning on/off, or you would have phantom switching of the light whenever some other device in your house desides to do its thing.
It is a genuinely neat idea you had though.
Theory is all I have! I’m too new at this. That’s part of what makes it fun!
Yeah, it sounds like I want a relay behind the switch.
Just replace the wall switch with a zigbee.
I want the dumb switch to turn the lights on and off as usual, but I ALSO want to be able to turn them on and off with Home Assistant, irrespective of the dumb switch position.
The dumb switch is an interruption to the one outlet on the wall, sure. That’s why I’m trying to do this “Rube Goldberg” setup.
A smart switch makes all this complexity go away
I didn’t think so, not on the physical interface side. The switch in question is in the middle of a 4 gang, so having one be a different shape than the others would be slightly annoying. We can swipe down on the whole row to turn all lights off at the same time, and the switches I see appear to have a form that doesn’t visually (physically, not an LED) indicate the switch position.
True, whatever form a smartswitch is in, they usually are self-centering. The user is protected from appearance of a false state. They can match your other switches closely enough in the same room, but that will stand out in the same switch plate.
Admittedly I was never concerned about that either: even before home automation I installed dimmers and programmable switches that were already visibly different. I’m actually just now getting back to that consistency, after replacing most switches. That’s an expensive way to do it though
-
You may have better luck with a smart zigbee switch to replace the switch. Be careful that it complies with your local regulations etc.
If you want the aesthetic of the current switch, you can alternatively get relay modules which would sit in the box behind the switch and connect both to the switch and the socket.
If you don’t want to mess with the in wall wiring, you can get covers that sit over a wall switch and contain/mount a battery smart switch.
If none of that suits, sounds like you’re on the right track with powering the light from a non switched socket and using the presence/absence of a second device to identify the switch position. But I don’t have advice on the fine details.
I like the relay idea better, thank you. I’ve done outlet and switch wiring before, but never for HA and not yet in this house.
Detecting the missing device seemed like it would be the easiest way as it wouldn’t require wiring, but it seems that that’s actually the more complicated option!
Sonoff makes a bunch of Zigbee smart relays, that can take input from a normal switch.
It’s basically just a Zigbee relay that can connect and disconnect regular wires, just like a switch does. But it also has terminals for connecting a regular switch, which then just functions as a button that controls the relay.
Something like this: https://sonoff.tech/en-eu/products/sonoff-zbmini-extreme-zigbee-smart-switch-zbminir2
Assuming technically possible, this solution requires no other hardware:
Is it possible to make the smart plug default to the opposite of the last state? You could use the wall switch like a pushbutton (cut and restore power) and it would toggle, then maintain control from HASS. You might be able to save the last state of the smart plug, detect when it comes online after a power failure (theoretically), and set it to the opposite of the previous state in an automation.
That’s probably possible, but doesn’t solve my problem. That said, some commentors found my explanation confusing.
When the switch is toggled ON, I want the lights to go ON.
When the switch is toggled OFF, I want the lights to go OFF.
Irrespective of the switch position, I want to be able to turn the lights ON or OFF with Home Assistant.
It sounds like a zigbee relay behind the switch will be the way to detect the switch position.
I don’t think a relay would work because it wouldn’t let you turn the lights off without getting up, and would make it so the switch won’t turn the lights off without turning of the relay from your phone.
@eddiereasoner@lemmus.org might actually be on to something…
Depending on the wall switch you have, you might be able to add a spring that makes it always return to the previous position when released. At least the switches I have in my house have a special little socket for adding a spring.
So in your Zigbee control panel you would configure the “power on behaviour” of the smart light/socket to “toggle”.
Then I you would add the spring inside your physical switch.
Now when you press the switch it would cut the power to the light/socket briefly, and as soon as you release the switch the power would be restored.
If the light/socket is on, you press and release the switch, which cuts the power and the light/socket stays off due to the “toggle” behaviour.
If the light/socket is off, the light/socket is still powered, soo you can still turn it on via Zigbee, and if you pres the switch, it momentarily cuts the power and the toggle behaviour would now make if turn on.
This gives you basically the same behaviour as if you installed a relay, but if you use smart bulbs you gain the benefit of being able to control the brightness, color temperature, and hue, if it has those controls
That makes sense, and sounds like a good solution. Thank you and @eddiereasoner@lemmus.org I’ll have a look.
Please let me know what you end up doing, because I might have a similar problem at some point.
I shall.
Thanks for the better explanation
If you’re putting a relay in the outlet box, you can probably eliminate your smart plug as well
The second one that I attempted to use as a switch position detector, you mean? Because I think I’d still need the one in the un-switched outlet to turn the lights on and off.
A lot of relay boxes will both detect the switch position and toggle the power, so you should be able to get rid of all smart plugs that you were planning to use for this light.
The relay should have these connections:
- Live input from breaker box
- Neutral (both from breaker box and to socket)
- Switched live output to socket
- Connection to one side of the manual switch
- Connection to the other side of the manual switch
Ah, so it would disconnect the physical switch from the circuit except as an IRL input for the HA relay entity ! That does sound perfect.
My point is, you would keep the switch on no matter what and flick it off and on again when switching the lights on/off
Maybe? I’ll think about that.
Isn’t the default unavailable timeout like 5 minutes though?
If I’m reading this correctly, it sounds like what you want is a Shelly relay installed behind the dumb switch. Then you wouldn’t even need the Zigbee wall plug at all.
I’d never heard of these, but they do sound like what I want! Thank you.
Any suggestions?
Yes:
Do not play stupid games with surge protectors.
Is it stupid to put a “smart plug” between the wall outlet and a surge protector with two lights on it? Doesn’t seem dangerous to me.
They do make button pressers, if your switch is the flat kind that could work I suppose.
I dunno what you expect us to tell you though, the switch is gonna turn off power to the circuit.
That’s why I have the lights plugged into a smart plug in the second, NON-switched outlet of the 1-gang. Other commentors suggested a relay, which sounds perfect.
I never really understood the use case for those relays. While I also thought they were a cool idea, the more I thought about it, they just weren’t. You’re leaving the switch in a weird state that won’t be useful to most people
A smart switch should be the same wiring as the relay and take care of the entire problem in a much more straightforward way. You can even get them in toggle or paddle to be similar to whatever else you have.
Most importantly smart switch means the switch keeps operating like everyone expects, PLUS automation.
We don’t usually toggle this switch by itself; normally we hit the first three at the same time in either direction. (4th is a ceiling fan)
When I turn the lights on from HA it’s to read in bed, so the lights do end up matching the switch position when I’m done. Heck, maybe I’ll use a script to turn the lights on for x minutes at a time if the switch is off.



