Poor results after power outage

Hi, we had a ~3hr power outage yesterday which spanned the time at which HE is to switch mode from day to evening. When the power came back on around 7pm, HE was still in day mode. I would have expected Mode Manager to set the mode correctly based on the time of day at startup. instead I guess its just looking at the transition time, which had passed, so it did nothing.

Another thing, after a power outage, if it had set the mode correctly, would it also run all the time-based rules that would have run during the outage, ie simple lighting based on time of day?

Thing is, when power is restored after an outage, HE really should come back to life and do all the things it would have done if the power had been on, ie turn on my lights etc. Instead we were still in the dark until I logged in, set the mode, and manually turned on the light groups.

I guess it depends on how the app is written, but any that I've seen simply schedule the event for a specific time. (The "gear" icon on your app can show you some of this, though if you aren't the developer and don't know the names of what it's running, it may be of limited use beyond guessing what list items corresponds to.) If the hub is not online at that time, the event is generally just not run. I suppose Hubitat could make platform-wide changes that run any unrun, previously-scheduled executions after a hub reboot or similar, but I imagine that would cause problems for some apps. Individual apps could also store some sort of "did this run?" flag and a periodically check to see if any unrun, scheduled executions are overdue, but depending on the app/automation, I again imagine a lot of circumstances where the desired behavior is simply nothing (that being said, Mode Manager strikes me as one where that might be helpful, though I could see there being some difficulty in piecing together different parts of its logic if time isn't the only "trigger" you're using for changes, so leaving it as-is is certainly an easy and safe option).

To prevent things like this with any app--and to prevent database corruption or other problems on your hub that an abrupt power loss could cause--I might suggest a UPS. Even a cheap and small one should get you through a multi-hour power loss since the hub isn't a huge consumer of power. If you're using the new C5 hub (USB power), some UPSes even have a USB charging port that might work, as would a typical USB power bank if you find one that doesn't temporarily cut out when switching between mains and battery power (haven't tested any myself to see; wonder if anyone has any recommendations)

I suppose if you have a UPS on the hub it will carry on its merry way changing modes and sending messages to turn lights on etc.
If you have a power outage though any messages to turn on lights at, say, set times will be irrelevant anyway as there is no power to turn them on.


I completely disagree with that. I do NOT want the hub doing some random backlog of tasks if the clock changes or it thinks it missed an event. Nope. No way. Never.

If it is that important, you need to get a big enough UPS that it doesn't power down. The one I got can run it for ~12 hours without outage. There are plenty of others you can cobble together yourself for a lower price.


Also true.

1 Like

im surprised to hear this isn't a bigger issue. Isn't the idea to make any HA system as transparent and reliable as possible, as much like a dumb light switch/timer as possible?

Surely the expected behavior when the power is restored is to get into the state it should be in at that time of day if its not already.

This would have received a nice "Ahhh" response within a few minutes of the power coming back, whereas instead, I got "your stupid home automation, why are we still in the dark when all the neighbors with good old-fashioned non-smart homes lights are on"....

Its all about WAF at the end of the day, isn't it?

Surely its not that hard to keep a log of timed events that were actioned, and on boot, check to see what should have been done and do it if it wasn't.

Mode Manager is a time-based state machine, it should be in the right state all the time, regardless if it s been up 2 weeks or 2 minutes.

If you personally dont want it to do that, then I suppose it should be optionally disable-able, but im struggling to come up with a good reason to not want it.

PS I do have a large UPS that also powers my PoE switch and wifi, so it didn't last the 3+ hrs of the outage. What if it had been a longer outage, like even multiple days. I would still want HE to wake up in the right state based on time of day. I reject the notion that enormous UPS or generator backup should be required just to have my lights come back on when the juice comes back up. Power being ON is the default state.

Is there anything out there that can do what you are asking?
I'm not sure there is but I do not have extensive knowledge of lots of systems.
ST couldn't do it.
I have a HUE bridge which in the settings I can set so that my lights will revert to the last known state on power restoration but if this is the middle of the night and the lights were on when the power outage started then they will come on. Not ideal.

I'm not saying what you asking is not possible but I think it would be a huge ask to do this.
I just don't have the technical knowledge to know I'm afraid.

1 Like

Regarding the scenario of having the hub on a UPS and it issuing commands to turn on lights when the lights are offline due to the power outage, this is another example of where the hub should, in my not-so-humble opinion, check the state of things and make them match scheduled or requested state if not. I have RM rules that do this for groups to catch those times when a on or off command wasn't seen by any of the child devices. But it should not even be necessary. If a light is in a group and the parent is off, then that light should be off, regardless of time of day or if a previous off command was missed.

The professional systems can do this and are very good at it. To also mark another concern from @JasonJoelOld you can also exclude events from running during the "catch up" period so as not everything runs but only what you have explicitly said yes to run.

This times 1000.

SmartThings had a nasty habit of doing this during cloud outages and/or slowdowns. Nothing like having lights come on 20 minutes after the motion sensor fired, or doors unlock after going to bed.

Hubitat, Smarthings, and most other hubs are completely event driven. Motion, switch, sunset, time of day, etc are all just events. Its important to understand that. There are not state machines nor should they ever try to be.

I do agree with the OP on one point. It would be nice is Hubitat had a startup event that could be used to fire automations. That would pretty much offer a workable compromise without a ton of development effort.


+1 for a startup event that could trigger rules etc. That may be all thats needed to get things up to date after a power outage.

Am I wrong to assume Mode Manager should set itself to the correct mode based on time window on boot? That just seems fundamental, outside of any issues of trying to catch up on missed events, and it may be a bug that caused it not to yesterday, possibly based on the sunset offset issue that's been lingering for a few revisions now. My MM condition for switching to Evening is sunset -15 min.

Not sure why you say its not a state machine. Surely home automation is all about state. Events cause changes in state sure. But once set, things should be in that state until told otherwise.

My Ecobee certainly came up in the right state and mode when it rebooted after the power outage, based on time of day.

With HA aren't we basically at a low level trying to fake or emulate dumb switches, in the same way that ecobee/nest are emulating old style thermostats, (at least the ones with coin battery backed up clock timer, to complete the analogy). I would happily debate this until the cows come home. What if I hadn't been around when the power outage occurred. The family would have been left in the dark if I hadn't been there to log in and hand-set the mode and manually turn on the lights. That can't be a desirable "feature".

I would assert that the hub should set it's state to the proper one for time and date. Not much beyond the correct mode. Evaluation of rules (I prefer between times as a general rule for automations) should correct automations into the proper settings. The problem for me is that with a UPS that can hold up my telecoms for 7-8 hours easy, is that it puts the burden on me to RM things back proper on power restoration. (gogo gadget Global Variables)

If I have not said it, THANK YOU for GV's, even in the most simplistic form they are a fantastic enhancement.

You really need to train your family members to be able to use the physical switches.


What physical switches?

How do you guys turn on lights at home other than HE?

motion, time of day, Alexa etc etc, probably not unusual.

Well that's your own fault then....

1 Like

wow, we are still far from the promised land aren't we.....

I would argue that not being able to turn on the lights from the wall switch is Hell, not the promised Land.

Other methods of turning it on and off are convenience, the switches are the ultimate control device.

Rather like only having cruise control for your car instead of a gas pedal... Makes zero sense.

1 Like

How do you do turn on a zigbee bulb without a hub?

I would never buy smart bulbs. I use smart switches and traditional bulbs.

And you know what? I can turn on the lights 100.0% of the time that they have power to them.