I'm working on a simple UPS for my Hubitat hub. Right now I'm guessing the battery will last about 6 hours of "normal" use. At them moment my "normal" use measurements were made with the Mains on so I don't know if Hub activity increases or decreases when none of the mains powered devices (the majority) powered.
My question: Is there a way to determine if the mains is off based on the lack of response from any / all mains powered devices?
I realize I could easily add a battery operated sensor to "sense" mains loss but it seems with all the mains powered devices there should be some other way.
Perhaps a app that runs once an hour (or two) and pings a few mains powered devices?
If you are referring to mains powered zigbee/zwave devices, this could prove to be very difficult. Devices report based on scheduled interval or if there is a change in one of its metrics. The only one that "might" be useful is if you have a devices that monitors power usage. If you have it connected to something that draws power, then it should always have a value that is above a minimum threshold. If power goes (assuming of course that the device status changes) then you might be able to use this as a sign of power being out. I have my doubts that this will work though. A wifi connected device is probably your best bet as you can ping it directly. No response = no power.
I went with a battery operated zwave contact switch as described in other threads. It gives me instant feedback and has been 100% reliable.
OH, I just remembered another option... If you have any HubDuino/ST_Anything devices on your home network and integrated with your Hubitat hub, I recently added the "Presence" capability to the Parent Device Driver. Essentially, if the microcontroller does not send a packet of data within a user specified timeout period, the presence attribute will change to 'not present'.
This could be indicative of a network issue, a problem with the microcontroller, or the fact that the power is out.
As it turns out I do have a kinda HubDuino running on my system. I'll see how I can use it for my ups plan.
As for loosing the router and falsely reporting mains out, I don't expect to act on a known power outage for 3 hours after power loss. During that time I could beep my dome siren and maybe figure out how to check my mains powered Zigbee device before I command the Hub to shut down.
John
Truth be told, I'm not too worried about power losses over 3 - 4 hours as in those rare occurrences I have other things that are more important.
My extension kept tripping, just used a power reporting socket pluged into fridge and created a rule to send a push if there hasn't been any power reports for 30min
I have an extremely simple solution... A Canary In A Cage.
Said Canary is a ZWAVE light bulb that defaults to ON after a power loss; many lights exhibit this behaviour. RM checks every 5 minutes if the Canary is singing... If so, sends me a message, and switches the light off. The rule is automatically (re)started upon a hub restart event in the event of a manual hub restart or if it comes back online after my UPS dies in the event of a power cut.
I also think this represents the cheapest option.
This of course only alerts you to an event after the fact, not real-time.
A plug in smart outlet, that is capable of being switched on/off via the Hub, as well as measuring how much power is being used by the device plugged into the smart outlet.
Here is a great example and an awesome deal on some very good Iris v2 3210-L smart outlets that also report power usage. Many of us have bought from this seller over the past year with excellent results.
Rules only react to state changes, so if you have a polling rule to check the state of a device, in my eg a light being on/off, something has to start that; a switch change, a specific time etc. If you restart your hub it may take a significant period before your state trigger event occurs again, causing your rule to trigger.
Use the RM Location Event : systemStart as your trigger to kick something off immediately after a restart
I am. The state change is a power reading, which starts a delayed notification for 30min, then the next power report cancels that and resets the delayed notification
At my old house, I connected an NC relay to an old phone charger, plugged it in, and then wired the relay to an input on my Elk M1 alarm system. The zone would trip when the power was out, it worked awesome.