[OBSOLETE] SmartBulb Power Outage handler

What devices are you using? I have only tested with the bulbs that I own which are GE, Cree and a Osram.
Also, as I mentioned above, make sure you are using the code from further down the conversation. (I should probably replace the first instance with the latest code).

Some bulbs use “poll” some use “refresh” to get their current status, the code was changed to handle either. If neither are supported, then it will fail.

I haven’t checked my install recently, but I think it’s still working. I had a power outage last week for a few minutes and the bulbs all reset properly after the outage.

Not sure I understand your question about the canary bulb. Are you asking @somebody about his use of smart lighting or just in general how/where people put the actual bulb?

Thanks for your reply Nick… I am using Hue ambient white and… an Ikea smart bulb with a device handler, that’s where I thought it was falling over , I tried to use the Ikea bulb as the "canary’’ which I thought was maybe a bridge too far (very recent to smartthings)

So, I thought I would ask @somebody as I thought the Ikea bulb (the only spare I have) was being a bit awkward as to the way he did it

I did use the code further down

If you use the live logging in the IDE you should be able to determine which device is having the issue.
If you have multiple Hue bulbs, you should be able to test using one of the Hue bulbs as the canary. If they work, then the Ikea bulb is the issue.
What device type are you using for the Ikea bulb?
Maybe a different device type for the Ikea bulb will work.

Otherwise I would suggest getting a GE or Cree for the canary. Either is about $15.

Hope this helps!

Will have a look at the live logging

I will swap the canary to one of the Hue bulbs and see what happens… a Cree or GE may be on the menu :grinning:

Thanks for your advice

@nsweet Thank you

Tried a Hue bulb as you suggested

Bingo… you were right… works perfectly

No more lights burning away all day :grinning:

Great job

1 Like

@SteMac I glad it worked!
Do you know what device type you are using for the Ikea bulb? I’d like to take a look and see what the issue is.
I looked at one or two Ikea Bulb device types posted here and they look like they support the “refresh” method, so they should work.
Not sure if there are published device types without “refresh” or “poll” capabilities or the “refresh” isn’t working or I just plain screwed up my code (which is very possible).
If there is something in my code that needs to be tweaked to support these bulbs, I’d like to get it working.

@nsweet Hi Nick
It may not have been the device handler
The device handler has work brilliantly for the Tradfri gu10 bulb

But you are more than welcome to have a look

Thanks

how did you make it work hue can you please tell me ? Thanks

Hi how would you make this work for hue bulbs?

I have not used Hue bulbs, but it should work the same way. Specify one bulb as the “canary” that you don’t use. It’s only purpose is to turn on after a power outage as a signal there was an outage. Specify the other bulbs you want to monitor.

I believe the Hue bulbs can be used with SmartThings with or without the Hue hub. I’m guessing this should work either way, but don’t know for sure.

The Hue bulbs I am using are connected to the smart things hub directly (no Hue hub)

I don’t know if that makes a difference

I’ve re-packaged the 2nd version of the SmartApp in a repo that is more friendly to using the GitHub integration.

Working good for me with a Sengled as the canary and all bulbs connected to ST via an emulated Hue hub (deconz).

1 Like

Thanks, I’m still a GitHub Noob.

I am using this app and found I had to make a slight modification. It seems that when the power comes back on, and the bulbs come on it takes a few seconds for all of them to be reconnected to the hub.

What was happening was most of them would get turned off but maybe one or two wouldn’t. And the log showed they were getting the off command sent. So my assumption was they wern’t quite connected yet.

So I put a 5 second delay before sending the off commands after the power came back on. Waiting on another power outage to see if that works.

1 Like

breaker test?

Too bad I didn’t read this five minutes earlier, as my power went out as I was catching up on today’s email.
It took a while for my internet to come back up so everything worked as expected for me, but the 5 second delay is a good idea. Either that or make sure it takes a while for your internet to reconnect :smiley:

I thought about the breaker test, but didn’t want to go thru all the hassle of clock resetting, etc. if I didn’t have to. The whole light thing is not that critical and I just figure the power will go out again. Especially this time of year, storm season…

My modem, router, hub, etc. are all on UPS so they don’t lose power or internet connection on a power outage. So I assume again it is just the time it takes the device to reconnect with the hub.

Just wanted to provide a data point and say thank you @nsweet! I installed this app about a month ago, but we haven’t had any power blips until this morning at 5am. Because I have Hues all over the house (including our bedroom), my normal MO is to grab the phone as quickly as possible to turn them off before DW whacks at me to do so :slight_smile: I do have a UPS specifically for my modem/router/ST/Hue-Hub, so that was still up and running. As soon as the power kicked back on, I reached for my phone per normal, but the app killed the lights before I even got it unlocked. THANK YOU!!

Thanks! Glad to hear it worked as expected.
And always need to thank @JDRoberts for his “canary bulb” idea or this would have never happened.

2 Likes

Has anyone had any trouble with bulbs that randomly turn on when this SmartApp is running? I have a Sylvania/Osram bulb that does this. I need to setup my computer for the live logging and keep it running as long as I can. At first I thought it was a bug with the smartapp, so I removed that bulb from the ones it has control of. That didn’t fix it, so I deleted the smart app completely and that fixed it. So, then I figured, let’s remove the bulb from ST, readd it, then add the smart app back in. I did that and didn’t even add this bulb to the smart app and it still came on randomly (in the middle of the night, obviously…ugh).

It appears it comes on after the Smarter Bulbs smartapp “refreshes” the other bulbs. I’ll see what I find after getting the live log to show that time.