I've read numerous posts concerning this topic but most refer to the use of a Rpi etc. I'm a novice compared to most in the community and just looking for a simple way to power down the hub to prevent damage to my database. I do have a battery backup that should power the hub for a few hours but recently we've lost power for longer periods of time and the reason for my concern. I'm really looking for a means, first , to know if a power outage has occured and second either write a rule to safely power down the hub or allow me remotely to power the hub down using possibly a dashboard tile, etc.
I noticed Cobra has an app " power off shutdown" which looks exactly what I'm looking for but requires a contact switch being rewired and connected to power block which I'm unfamiliar in doing. Previously a product was made to do just that but doesnt seem to be available. Any suggestions would be greatly appreciated.
Rules are not my strong suit so this could be way off. However it is raining, and I am stuck inside so here ya go....
Plug a smart plug into a dumb outlet. Connect your battery backup to the smart plug. Then connect your hub to the battery backup. Create a rule to monitor that plug. If it went off, try and turn it back on, if it won't turn on (power outage?), wait, try again, after X minutes send the shut down command to the hub.
There are some obvious flaws in this process/rule, but it's a start.
These are easy to build and I have it monitoring my fridgerator circuit - one with 3 fridges on it.
Another option is @iharyadi's environmental sensor. I purchased several of these because I also wanted humidity, temp, etc too and it is capable to alert you of a power outage since it has a backup battery option. As you may have seen in the post @aaiyar mentioned above I originally built the power sensor for my sump pump but I have since switched it out for Iman's sensor so I can monitor humidity in the crawl space too.
Is it possible to use TechMedX idea of using a smartplug connected to the battery backup and Hubitat. Then use your rule to sense when smartplug turned off (do to power failure) and then send Post to shutdown hub after a designated delay and CANCEL shutdown if power resumes?
I build something like this. This sensor already include power monitoring. You can just not use the smoke detector connection and put it inside a box and wire it to your AC power that is in the same line as your hub.
When the power is out, the sensor will send out notifications.
Well with all the info and links you graciously provided how can I not give it a try lolo. Big thank you aaiyar ! One question- where are the wires connected in the sensor. I had a relay from my last konnected install, so I'm good with that part!