Is it possible to create an automation rule based on power outage?
What I’m looking to do is turn off a smart switch once power has been restored after a power outage. I didn’t see a way to do this in the app. Do I need to write my own service that runs on a server of sorts?
There are multiple ways to do this depending on the exact devices that you have. See the project report section of the quick browse lists in the community – created wiki and look at the list for power monitoring projects. You’ll see several ways there.
In theory, webCoRE has a Hub Power virtual device that should work IF you have batteries in the hub AND no UPS to power the hub AND enough juice in the batteries to successfully power the hub through the power outage AND if ST didn’t change anything to their power source messaging (undocumented). You should then be able to do something on
Does anyone have an idea how long the hub can run on fresh batteries?
When migrating to a new hub, I was running it on batteries to be able to easily get it to devices for pairing. I could not complete the migration on a fresh set of batteries and had to replace them halfway through the process. If I have to take a guess, I would say that I probably got about 5 hours from a set of batteries.
@ady624 I’ve tried the ‘Hub power source changes’ trigger, but it never executes my piston when I pull the plug on the ST hub. Oddly enough, however, webCoRE’s dashboard shows a battery icon under the hub status icon. I must be doing something wrong, right?
LATER EDIT: Looks like those events are not very reliable - I never got a power=mains event (checking the IDE) and then no more events were sent for subsequent battery/mains flips. I need to find another solution for this.
Here’s a copy of the piston. I figured there was a lapse in communication between the hub and IDE. Let me know what you find. Power outages have become a nuisance lately!
@AtelierIris
I have ‘played’ with a few HA hubs before deciding on ST
So although my ST is on a UPS and unlikely to need a remote reboot, I put it on a z-wave socket and control that socket with a ‘Vera’ hub
Something similar could work for you if you could find a cheap 2nd hand hub from ebay. Anything that you can setup with a z-wave socket and configure
(The reason I chose the Vera to do this is because it doesn’t need an internet connection to function)
I’ve installed a canary light, which only comes on when power is restored, and have rules based on that. Maybe not the most elegant solution, but works for me.