#Anyone with a way to record power outages?

1 messages · Page 1 of 1 (latest)

ancient geyser
#

I have a Shelly EM on my main, and i'm wondering if i can detect a power outage, even after everyhing is back again, to send a notification.

quiet sage
#

is it just to let you know to check some things after an outage? you could send a notification when HA starts up. that way if you get a start up notification randomly you know to check to see what happened?

or are you looking for specific information to be reported in a a specific way

ancient geyser
#

i would like a from-to notification for now.
I restart Ha some times a week for updates or test, but this morning i had 3 outages while i was at home.

quiet sage
#

you could disable the automation that sends the boot up notification whilt your updating/working on the system.
or you could enable the uptime sensor on the shelly EM and use that as a condition
e.g.: on ha boot if EM uptime <10 minutes send notificaion "there was a power outage and things are back online"

fading cradle
idle quail
graceful silo
#

If you have a spare bulb, set "light on" when power is back. Never turn it on.
If it's on => you had a power outage! 😉

ancient geyser
ancient geyser
ancient geyser
quiet sage
#

you could use the uptime kuma addon and integration. i think you can automate off of that but i am not totally sure

idle quail
#

Honestly, you're really going to struggle with this
I don't think HA runs shutdown automations when the power is cut
So what you could do is have an automation that runs every minute or so that says "I was running at this time" - either set an input datetime value, or maybe be able to get away with last run time and the automation doesn't actually do anything.
When home assistant turns off properly set an input boolean to indicate "shutdown not powercut"
When ha starts, check if that boolean is off (I.e power cut) and if so, your 1 minute automation will give you the start time of the power cut with a minute for the notification. Also set that boolean back to off

weary ridge
#

I have a similar usecase to detect if home assistant crashed.
For that I've created an input boolean "clean shutdown" that I set to on in a shutdown automation. On HA startup I do two things:

  • check if the boolean is on or off if it's off I send a message
  • explicitly set it to off

That way I can detect whether HA was shut down properly or not

fading cradle
#

It's the ages old logic problem. It's impossible to prove a negative. why do you care anyway?