Activity rule to shutdown hub in a power failure

Oh gee , I'm sorry. Dont know what i was thinking about concerning going into settings if hub down. Ok ordered the ring repeater and will arrive Saturday. Thanks again!

1 Like

No...that's good! Your first instinct was to use settings rather than the power cord. That's the right thing to do 95% of the time and a hard rule to get people to follow. This just happens to be part of that other 5%, that's all. I have every confidence you would have figured that out if you'd thought about it a bit more. Sometimes we can't see the forest through the trees. :wink:


The UPS I'm testing has a low battery shut off. If I was to add a restart feature I would only need to add a 5v relay to the output of the UPS and have its contacts shut off the hub.
This relay should have a low power coil.

I would use a normally closed relay (or the NC sides or a regular NC/NO relay). That way power is going through the relay unless you apply current to the coil side. Since you are going to want power flowing through the relay most of the time, that would keep you from having to apply a control signal to keep the relay on all the time.

It depend on what your controller for the relay is going to be. Are we talking Raspberry Pi or Microcontroller? or ....?? The relay's coil voltage will have to match the logic of your controller, whatever that is.

No controller (except the battery protection circuit in the UPS).

When the battery gets lower than 2.4 volts the protection circuit disconnects the battery. Note, at this time the DC-DC boost is still outputting 5V. When disconnected the UPS output goes to 0 and the relay drops out.

I am currently testing the holdup time of my UPS.
At this moment the battery has been powering the hub for 3 1/2 hours and is still holding up well.


Okay...I'm not following then. You won't be able to automate power cycling the hub when power is restored because you would only want to do that if the hub was shut down. For example, if you lost power for 5 minutes, you wouldn't need to shut the hub down so you wouldn't want to power-cycle the hub when power was restored. But if you did shut down the hub and power was restored before the UPS ran out of power, you would have to power cycle the hub to get it to turn back on. Do you see what I'm saying?

Yes.... I'll have to put more thought into this function if I decide its needed.

It hadn't been part of my original conception. Again I felt rebooting the hub manually if power was lost for 4 or so hours was an acceptable trade off for a very simple UPS that most everyone could implement without any circuit building.

1 Like

Could you use the web pinger app?

Assuming you don't have a UPS on the router or that you have one with a lower time service than the one on your HE, you can test if the website is available time by time (say every 5 mins), if it goes down you can take that as a reasonably strong proxy that the power is down (of course it may be the site is down, but if you use or suchlike I guess it will be quite robust). Then if no response, wait a while (a bit less than the duration of your hub UPS service time), then check again, and if still no response, power the hub down with an https post.

Update: I like this idea enough to be trying it. I notice also that web pinger has a timer check (normally set to 2 mins) but I'm thinking this could potentially be set to 3 hours worth of minutes and Bob's your Uncle, as we say from the UK. Will report back how I get on...

1 Like

Ok, here's the plan...

Run Web pinger every few minutes (with a 3 hour re-test) to check if there's a route out to Google (router doesn't have a UPS so if power goes out this will trigger):

Not sure if this will run multiple times given the long-retest time. Will have to check. If so then will make a more complex RM instead to do the additional test of the switch after 3 hrs. Maybe @bptworld could comment if this is an appropriate use of his app (re-test time >> frequency of app runs)?

Then use a rule to trigger the shutdown:

How reliable is your internet service at Ban Amphur?

Edit: I guess the real question is - which is more reliable: internet connectivity or electric grid?

Yeah agreed. But there is a 3 hour wait built in. In my experience both internet and power will be down for less than 3 hours typically. If this shuts the hub down because Internet has been down for 3 hours but power is still OK then I'm totally OK with that :slight_smile: but I really want to avoid a power out to the hub given this can further screw with the database...

Everyone has been sooooo fantastic! Really appreciate different options and really appreciated rules written to make it all come together ( rules aren't my strong point lolo)

Ha ha, me too!

Kinda defeats the whole local-processing advantages of Hubitat. You're basically making it cloud dependent.

Ring repeater installed -just would like to verify my rule is correct:

Only question I have is am I posting to correct HTTP? The IP address of my Hubitat hub is different from the power down address in my rule.

Many Thanks

1 Like

This should shut it down after an hour.

So rule looks good and HTTP correct even though different from my Hubitat hub IP address?

That is your Hubitat's loopback IP address. So you're all good.

Fantastic! Much appreciated! Now to give it a try - fingers crossed lolo

One other question, Under Device preferences, the Ring repeater shows:

"Battery Reporting Interval
Battery reporting interval can be configured to report from 4 to 70 minutes"

Should I match that interval to my rule of 60 minutes or it doesn't make a difference? Also there's nothing in the Device listing if the repeater is on Mains or battery - Current status is BLANK