Device Recovery After Power Outage

Does anyone have a feel for device recovery after a power outage, say 8 hours or so?

I have my hub on a ups. When the power comes back, how long for the device to become responsive to commands? Difference between zigbee and z-wave (assuming good signal direct to hub)?

Is there any way to send a command to a device and have the hub know it's been received?

Thanks.

Without knowing what is being used for a UPS and its communication capabilities, I can only suggest some general basic techniques

  1. UPS determines power is lost. Generally not much needs to be done here, except perhaps powering down some devices to extend battery backup time.
  2. UPS gets close to losing battery backup. Gracefully shut down the hub then Remove power from hub.
  3. UPS reports power restored. Restore power to hub causing a reboot. Perhaps delay for a few minutes.

Here's a link to my solution using an APC UPS with Windows 10 and a WIFI power plug. There are also links to other solutions.

1 Like

There are other things that you need to address on power up return. This can be done in a rule triggered by systemStart.

Remember, events will have been missed while the hub was down, and some scheduled events will have been missed, never to be seen.

For example, if you have Ring Alarm Extender devices (which have internal battery backup) will have caused “return to mains” events to be dropped by the hub because the Ring Alarm Extender devices will have returned to AC power before the hub boots. Those events are lost forever, and the state of those devices needs to be refreshed.

Same for other devices (battery powered, etc.). You might want to refresh them if their state matters.

Then there is the issue of waits, delays, etc. in executing rules, and scheduled events that may need to be rescheduled.

It takes a bit of thought to decide what you need to do on systemStart.

1 Like

Unless you’re using bulbs that allow you to restore to previous state (Hue bulbs on a Hue hub, for instance) all of your smart bulbs will come on when power is restored.

I use a UPS on my hub and a ring extender to detect power going out and coming on. I then have a group set up with any bulbs I think I should probably shut off when power is restored. However as @672southmain notes, if the hub is not still powered on that event will be missed. It isn’t an issue for me since the time the hub UPS is without power is only about 30 seconds, well within the capacity of the UPS. But you’ll need to figure out some other logic if the power failure is that long.

1 Like

As @672soutmain and @brad5 pointed out, sensors (contact and leak sensors among them) cannot be trusted to show their current state if the sensor event happened when the hub was offline (or the message was dropped). So if a leak sensor went (and remains) 'wet' and the hub never got the message, it will show 'dry' until the hub receives another sequence of wet>dry>wet events.

If the sensor's driver was written to refresh the device's open/closed or wet/dry attributes in response to the 'refresh' command, you could include a refresh of those devices in a routine that would run in response to a system start event. For Zigbee battery devices (since they respond to a refresh command within a few seconds), that would account for the scenarios where the hub was powered off (or rebooting) when the event happened. This may not work for Z-Wave battery operated devices since it depends on how their wakeup interval has been set (which may be hours).

However it also depends on how the device driver is written as to whether or not refresh will do this. Last time I checked, Hubitat's built-in drivers for generic Zigbee contact and leak sensors do not do this.

1 Like

I unplugged 3 zigbee outlets and 1 z-wave switch that I have temporarily in a box with a plug.

When I came back after ten hours and plugged each one in, they all seemed to work instantly. Admittedly it's not a valid test because there could be other devices acting as repeaters. I'd have to pull all the zigbee outlets (only zigbee I have), and trip all the lighting circuits in the house for 8 hours. That'll go over like a lead balloon.

My likely ill-conceived idea is to arrange to have the Generac standby generator run autonomously if on a winter vacation, where stuff could freeze, to save fuel and the equipment. The standby would start if the house got below 45, generator battery got below 11.5(?) volts, Samsung presence sensor goes to on, hub backup battery got too low. Etc. Otherwise, it would be sleeping.

I'm not too certain the plan would be robust enough though.

We lost power for a good 12 hours a week or two ago. I have no UPS or battery backup so everything went dead when the power went out.

After power came back I was expecting to have to do multiple reboots on the modem, router and hubs but to my surprise everything came back up and worked fine.

Anytime you even just reboot the Hubitat hub though I noticed some of my zwave devices on the outer perimeter take a couple of tries before they "find" the mesh again is what it seems like to me anyway.

I've noticed the same thing. However, I have to keep the hub alive when my setup is 'sleeping', so it'll be able to wake itself up again. As a side benefit, it's gotta help with the device re-connection that the hub never lost power, plus there's no bootup time.

How do you plan on programmatically controlling the generator?

Hubitat, for better or worse, lol.

When the generac is running on automatic during a utility outage, if the high heat sensor wire is interrupted, the generator will stop. If put back to normal, the gen will start. It's, like, the only non-latching alarm. Of course, load has to be shed, and with Generac, the smarts are in the generator, not the transfer switch.

My plan is to shed any possible significant load, which I don't have much of, progammatically with hubitat, along with any cool down and warm up periods. Also, use sensors like temperature, presence, etc, to start/stop gen.

When I do the shedding, I'll still have something like 250 watts of parasitic load, but I don't think the gen will have problems starting up with that loaded.

It's sad that the transfer switch can't get involved directly, but I haven't found a way around it, other than this.

Yes, it's flaky, I should probably try to 'harden' it somehow.

This'll only be for when I go away, maybe only in winter, which I don't do much of anyway, now.

1 Like

Perhaps "hack" is a better way to describe it. But if it works... it works!

Hopefully.
Just like with generators in general, it'll be good if it starts when it has to.

1 Like

In the immortal words of Alexander Pope,

"Hope springs eternal in the human breast:
Man never is, but always to be blest."

But I bet you, like me, not only do a weekly test but the occasional full load test!

Yes. I even drilled a hole in the transfer switch to put a toggle switch to interrupt N1. Makes it easy to do a full transfer test. Over time, will I remember? Who knows. Oh, that reminds me, I have to make sure my backup backup portable generator has air in the tires, lol.

1 Like