Detect a Power 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...

4 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.

3 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.

See above post from this morning. The Rules are there, posted as screenshots.

That's not the case when the driver is polling the smart plug periodically, When unplugged from the mains (or when the power is down) the plug will stop responding to the periodic poll commands, and after a few minutes the driver will change the presence status to 'not present'

Although this may be a fast and simple workaround, I agree that the Ring Range Extender is a much better solution!

1 Like

Correct. But there are no built-in drivers that support presence as described. There are a few community drivers that do it.

Wondering what everyone thinks of this idea (I just implemented this based upon reading this thread so cannot vouch for how well it will work in the long run…and I am relatively new to HE).

I had a spare Sonoff S31 Lite smart plug (WiFi) laying around that I had Tasmotized but was no longer using. Even though it was Tasmotized, being a WiFi plug, I imagine it would work without being modified at any rate.

Using HTTP Presence Sensor, I set up a virtual device using the HTTP Presence Sensor driver and pointed the URL to the local network static (or reserved) IP address of my plug. Whenever the wall socket that the smart plug is plugged into is powered, a “present” state is reported by HTTP Presence Sensor. If the power goes out (or if the plug is physically unplugged), the state goes to “not present”.

I then set up a RM5.1 rule so that if the presence state changes (the “trigger” set by selecting the presence attribute on the virtual switch), and if the state is “not present”, a notification goes out to my mobile devices that a power outage has occurred. This then starts a cancellable delay (set by a local variable so it can be easily changed to less than how long your UPS can keep your hub and network powered) before another notification to my mobile devices informing me that my hub will be undergoing a “soft” shutdown in 30 secs. After this 30 sec delay, Hub Controller sends a command to soft shutdown the hub to prevent data corruption that might occur with a hard shutdown.

If after the trigger event, the state is “present”, then any delay is cancelled and the rule is exited. I tested this out to see if it would work by simply unplugging my “presence sensor” smart plug and then waiting to see if the hub would shut down after the delay set up in the local variable and it seems to work. It also seems to work to cancel the shutdown if power is restored prior to the shutdown delay period.

The limitation to this (compared to the Ring Extender method) is that I believe the polling interval set by HTTP Presence Sensor is 5 mins? (although I think you can go into the driver code to change this). Another limitation is that since the S31 is a WiFi device, if you lose the WiFi signal, your hub will think that a power outage had occurred (even though it hadn’t) and will initiate the countdown for a soft shutdown of your hub.

Anyway, let me know what you think of this and if there is anything that I am missing as far as functionality and other pros and cons of this set up in concerned. IIRC, I paid about $10 for my Sonoff S31 (WiFi version) and since I already had it and was not using it for anything else, I figured i might as well play around with it (and, it still functions as a smart plug where I have it plugged in).

This was my thinking exactly.

Agreed. I mainly threw out the smart plug idea as an alternative since many of us have extra smart plugs already on hand. Quick, easy, and cheap is sometimes a "good enough" solution even if it's not the best.

If your UPS lifetime is sufficiently long, and if the presence sensing is reliable, it should work. I’m not sure presence sensing is 100% reliable.

1 Like

image

Today I discovered this free/bonus service by Ring Security system :slight_smile:

1 Like

@672southmain, have you had problems with HTTP Presence Sensor’s reliability to report presence of a plug? IIRC, based on other presence sensing posts, I understand that presence sensing when using a mobile phone as the “sensor” can be hit or miss due in some part to limitations in how geofencing is handled by the phone itself (and/or I’m sure some of this may also be due to problems with various other methods and presence sensing apps used in HE as well).

Given this, what has your experience been regarding the reliability (or non-reliability) of HTTP Presence Sensor in monitoring a stationary, always powered device like a smart plug (like the type I am using as a “quick fix” alternative to monitoring by Zigbee or Z-wave)?

If you have found this method to be unreliable based on experience, I will have to rethink my approach and go with something like the Ring Extender. I was just concerned that given all the other threads on Z-wave and Zigbee problems, that Zigbee and Z-wave are also not 100% reliable, so I figured why not try with stuff I already had. Looking forward to hearing about your experience. Thanks for any further input.