Using automation to shutdown home assistant pi

Would something like this work?

Use the “for” setting on the trigger. If UPS is “on battery discharging” for 8 minutes, shutdown home assistant.

I guess if the UPS comes online again before the 8 minutes the action will not run, right?

1 Like

That’s perfect, thank you!

I combined your timeout with this solution for detecting power outages:

I ping my router every minute. It’s not on an UPS so if it’s down, that means that I don’t have electricity anymore (granted, I’m trusting its reliability more than that of my electricity grid, but that’s a risk I’d rather take than having my Home Assistant corrupted due to a power outage)

Just for reference, this works just fine:

Hello how I can shutdown my proxmox external server?