Shutdown triggered by APC UPS?

If I get a small UPS for my Hubitat and internet router, such as APC UPS Battery Backup & Surge Protector with USB Charger, 600VA APC Back-UPS (BE600M1) https://www.amazon.ca/dp/B01FWAZEIU/ref=cm_sw_r_apan_glt_i_KPE9RNJGE0W77F58A7HD?psc=1

Is there a way to make the UPS let my Hubitat know if power failure, so they I can safely shutdown hub?

I'm expecting a smart plug with energy monitoring somewhere in the mix is what you are after, just where it needs to sit others than hopefully comment on...

I'd suggest a ring alarm range extender plugged in somewhere other than the UPS. This little gizmo makes a great zwave repeater AND reports power source. It would be simple to shut down the hub with RM and a trigger based on this device.

Powering UP the hub again when power was restored might be a little trickier, though I bet if the UPS loses power completely and then power is restored HE would start up again. The issue would be if the Ring detected a loss of mains power and shut down the hub but power was restored BEFORE the UPS died, so the hub never was "unplugged" from power, so to speak.

2 Likes

If you have a raspberry pi that is always running you can run NUT server on it and that will listen to signals from the UPS. Then install the NUT driver on the Hubitat and have it listen to the NUT server and shutdown. That is how I did it with A Cyberpower UPS at my Mom's house. I use NUT at home also but it's running the server on a Synology NAS.

UPS ->> USB Cable ->> Raspberry Pi with NUT ->> network ->> Hubitat with NUT

Here is the code location:

Here is the topic its discussed in:

1 Like

We can class a rpi as a smart plug, can't we....

2 Likes

Here is my rule machine shutdown rule:

1 Like

The problem with this rule is that the hub misses the event for return to mains after the hub shuts down and later reboots. You need to add a refresh on the power source in your systemStart rule.

2 Likes

Never had a problem with the code. All the pending delays are executed and the hub shutdown completes. No need to deal with the trigger back to mains on the hub rebooting, the status of power state on reboot is once NUT starts is "mains". I have testing this at least 10 time and also had 4 power conditions that lasted more that the 5:30 and the hub shut down. A simple reboot of the hub and everything it back to normal.

Whatever. I know that a similar Ring Alarm Extender v2 solution requires the refresh.

True each integration requires different actions for behaviors.