Virtual switch and wifi bulb association for power-up "OFF state"

Hi All, pretty new to smartthings, I have been playing a bit with it, mainly with basic automation…

I’m presently planning my basement lighting and I would like to install RGBW recessed LED in my kids bedroom. I can only find Wifi models. THe problem is that on power-up, after a electricity breakdown, the light will turn on. I tought I would set up an Inovelli switch to allow them to open and close the light and to play with colors. However, this doesn’t solve the power up ON state problem. I tought I could run the On and Off command through a virtual switch. This would allow to memorize the last state of the light. I tried it, but it seems like the automation possible with the smartthings app will only send command “on data change”. Basically, if the virtual switch is already OFF when the light get electricity, back, it will stay on, even if there is an automation that call the light OFF when the virtual switch turn OFF.

So, is there a way to make the light follow the virtual switch? This would allow that when: the light would get electricity back, the wifi back and hub back online (after an electricity breakdown), the light would turn off because it would follow the virtual switch status. Does it make sense?

Note: My other solution is to wire the RGBW recessed light through a dumb switch. In the case of and unwanted ON state, we could just close it… I though I could locate this back up switch not at the entrance of the room to prevent unwanted power cut to the light.

***Hope it is clear, english is not my first language…

Thanks!

Mat

What country are you in? The device selection does vary.

Meanwhile, you should be aware that any switch you have, smart or dumb, that actually cuts current to most smart bulbs is very likely to shorten the working life of those devices by about 25%, making expensive devices that much more expensive. So instead, most people choose a switch which does not actually cut current to the smart lights.

Instead, they have the switch send a message to either the hub or the lights themselves to turn on or off, but leave the current on at all times so that the smart bulbs can hear the next “on“ command from the network. That also protects the bulbs from excessive “inrush current“ when power is restored too often.

So usually the solution that protects the life of the devices also solves your other problem. :sunglasses:

that’s exactly what I want to avoid, while being able to replicate the OFF defaut state on power after electricity breakdown. I’m trying to determine if I can do it with a virtual swtich.

Ok, it’s going to depend on the exact brand and model of the WiFi bulbs. Some report that they have turned on after a power outage, and some do not.

If the bulb does report that it turned on after a power outage, you could then have an automation to say that when the bulb turns on, if the virtual switch is off, turn the bulb off.

“Follow“ in the smartthings context has historically been used to mean when an event takes place. When the virtual switch turns on, turn on bulb A. It has not been used for what you are talking about, which is matching state whether there was an event or not. I just mentioned that so that if you are doing research in the forum on other past solutions you will know that whenever someone used “follow“ they meant when the virtual switch changed state. Which is not what you were trying to do.

The new platform with the new automations that you can create through the app does allow you to check an existing state as a precondition, but there still has to be an event to trigger the automation running. that’s why I was asking for the brand and model of the Wi-Fi bulbs. If they report that they have come back on, then that would be an event you could use to then check the status of the virtual switch.

But if the specific Wi-Fi bulb you are using doesn’t report its change in state, you’re going to have to go to some kind of polling. There may be a way to do that on the new platform, but I will have to leave that to other people to discuss.

As I think about it… There would be one other approach, which would be to put a light meter in the room (usually called a “lux sensor“ in home automation) and if it detects that the lights have come on at night, you could then check the state of the virtual switch to turn them off again.

Note that all three of these approaches:

  1. wi-Fi bulb reports that it has turned on again
  2. polling
  3. lux sensor

Will mean that the Wi-Fi bulbs come on and stay on for about a minute until they turn off again. I don’t know if that will meet your use case or not.

THanks for the detailed Answer! I’ve tested with the option #1 and my test bulb report its state. I simulated electricity breakdown, including shutting down the hub and the wifi. The hub boots faster than the wifi. COnsenquently, when the wifi get back on, ST read the ON state of the bulb as an event an automaticaly close it… Its working! :smiley: The only downside is that light will stay on as long as the wifi is down.

Thanks!

note: My test bulb is a Globe

1 Like