Detect a Power Outage

Hi,

I'm looking for a way to detect a power outage in the garage. I have a simple Zigbee plug (switch) in there, but in the event of a power outage I cannot query it because the status is reported as the last known state. So for example I have a rule that runs every 5 mins and looks to see if the switch is "On" - it of course reports that it is "On" because that was it's last state, but in truth there is no power so it's not actually being truly queried.

How (using my rule that is run every 5 mins) can I determine if that switch is online or not? Any help would be greatly appreciated.

If it helps there is nothing plugged into the plug, so there is no power draw to monitor (just in case people were thinking of heading down that route).

Thanks in anticipation.

Mark

2 Likes

I use the Ring Range Extender 2. It's a zwave device with a battery backup. It will report whether it is mains or battery powered. If you have zwave coverage in the garage this should do the trick, and act as a repeater as well.

You could also try turning it off and back on and confirming that the state changes.

4 Likes

When there is power, if you look in the events section for the device, does the plug report back with any regular updates! I would expect not, but given it is powered maybe it will...

Here is how I do it:

You can try this driver. Although it was written to handle Tuya 'specifics', it works also with generic Zigbee outlets - I have tested it with OSRAM and IKEA outlets.
It has a 'presence' capability that you can use to trigger your automations from RM rules.

I wholeheartedly second using Ring Alarm Extrnder v2 to detect power fails. It has a built-in battery so it works during power fails (assuming your hub is on a UPS). It’s straightforward to write a rule that receives the switch to battery event and shuts the hub down a reasonable time later before the hub’s UPS dies. If you want to see my rules, just ask.

Cautions:

  1. It needs to have a direct (unrouted) connection to your hub. Otherwise, if it routes through another repeater that does not have battery backup, the “switch to battery” event will never reach the hub.

  2. When your house comes back up, the Ring will send a switch to mains event before the hub has rebooted, so that event will be lost. So, you need a Refresh action in your systemStart rule so the Ring Extender’s state becomes accurate.

  3. The built-in driver for the Ring Extender has a bug, in that the Refresh custom action (and the Refresh button on the device’s page) doesn’t work. I’ve pointed this out twice during the past year to Bryan Copeland but, as of 2.3.0.124, it’s still broken.

Denny Page has written a user driver for the Ring Extender v2, and Refresh works in his driver. I have switched to it.

4 Likes

Another option might be a smart plug that measures energy usage. If you plug something into that that always draws some amount of power, you could have HE report on any time the power reading was not greater than 1 -- that would account for a reading of 0 or null, depending on how that particular plug worked.

1 Like

Non repeating Sengled bulbs are said to send an “off” state when losing power. This may be used to sense an outage.

I can think of three solutions.

Ring Range Extender V1
Ring Range Extender V2
Lowe's Iris Range Extender with this driver:
[release] Iris v1 Range extender zigbee driver

All three devices have batteries in them and can report a power failure even when the outlet they are plugged in to is dead. This is of course all assuming your Hubitat and network are all pugeed in to a UPS.

1 Like

+1 for the Ring Range Extender

Or this...

2 Likes

Yes, but note that the Ring Alarm Range Extender v2 is $24.99.

1 Like

...and you'll never have to replace any batteries on the Ring, either.

2 Likes

Thanks for the response - it is VERY much appreciated.

Before I go ahead and buy the Ring Alarm Range Extender 2nd Generation, can I ask a couple of questions....

  1. I don't have a Ring Alarm. I can see that there is a built-in driver for the Ring Alarm Range Extender, but can I just confirm that I don't need a Ring Alarm hub or anything else? I.e. I can just join it to my hub natively?

  2. Would you mind providing your Rules so I can get an idea of what I need to do to check to see (or to catch an event) when the Range Extender goes from Battery to Power and back again please?

Thanks ever so much in advance - your help is greatly appreciated.

Regards,

M

There is a built in driver, and there is also a user-contributed driver by Denny Page (see my post above for a link). No driver is needed to make it function as a repeater, but a driver is needed so a Rule can detect power fail and also to refresh the status of the power status after a power restore. As I noted in my post above, the Refresh in @dennypage’s driver seems to work from my testing. Also from my testing, the Refresh in the built in driver does not work and has not worked in at least a year, so the systemStart rule’s Refresh will not work at present if you use the built in driver.

Yep, yep. Admittedly, the Ring Extender can be tricky to pair, you may have to try a couple of times. I have always had success using the Classic Inclusion. There’s a thread here in the forum with a post or two from Bryan Copeland about pairing the Ring Extender with pointers and tips.

Ok, you asked. It takes a few rules and a Hub Variable for each Ring Extender (I have 6). If you only use one Ring Extender, you could greatly simplify the Rules, would not need the Hub Variables, and would not need the pair of Rules for each Ring Extender; you could strip everything out and just have a power fail rule triggered by switch to battery of that Ring Extender, and that rule would shut down the Hub after a few minutes delay (before the Hub’s UPS dies) so that, if power fails and restores during that delay, the hub doesn’t shut down.

My rules are a bit more complex, and implement a voting decision by the Ring Extenders, only deciding to begin the shutdown sequence if some fraction (I chose more than 4 of the 6) of the Ring Extenders indicate power fail. This design was chosen to handle the case of a Ring Extender being knocked out of the receptacle when we vacuum or move furniture, or if a circuit breaker trips on one of the circuits, or if one of the Ring Extenders develops a dead battery and doesn’t report power status change. The internal Ring battery is charged while plugged in, but I guess it could fail.

The Rules also handle the case where power flaps up and down as the local utility tries to bring the power back up and attempts to heal the grid by re-routing power around a failed substation or section of power lines. There can be a lot of concurrent re triggering of the power fail events, which is why the Rules are designed the way they are, so that one Ring Extender’s flapping doesn’t affect the logic of another Ring Extender’s flapping.

I use a Custom Action to Dominick Meglio’s Hubitat Hub Controller driver to do the actual shutdown.

Rules

The Power Fail rule handles flapping of the power up and down before the final fail. I've put a lot of thought into the concurrency issues, and none of the power fail rules have conditionals, and can handle retriggering.

There is a pair of similar rules for each Ring Extender to maintain the state of each Ring Extender for the voting power fail:

Here are the Hub Variables that are used by the voting power fail:

And here is the System Start rule that initializes everything:

Now that I look at the power fail voting test months after writing the Rule, I realize that the “IF failedRingExtenders > 4” conditional, which enters the power fail section, should probably also have an OR to test if the Ring Extender on the Hub’s mains circuit has failed so that the power fail section is entered, regardless of voting, if the Hub’s mains circuit has failed. I will have to fix that when I return to town next week.

Enjoy.

1 Like

If you are capable of DIY, then this simple setup works for me for over 3 years already:
You will need: Simple Aqara or any other battery door sensor, 220V (or 110V) relay with dry contact, some enclosure to put it in, some cables and welding is needed.

  1. disassemle door sensor
  2. weld cables to magnetic detector part terminals
  3. weld those cables to relay (dry part).
  4. weld 220V cables to relay and power socket and you are done.

When power is out, contact sensor changes its status and you know it immediately and vice versa once its restored.

2 Likes

This is a good idea. I use door sensors to notify activity on pumps and watering system. I had not thought of using a relay.

What is the power consumption of you relay?

How would using an energy reporting plug accomplish this? If it lost power how could it update to any energy usage value?

1 Like

This wouldn’t work. When there’s a loss of power, the plug stops reporting to Hubitat.

I would be interested. I recently added one of these. Not for that purpose, but i wouldn't mind making do so work for the real estate it occupies.

Around 1watt.

Download the Hubitat app