I’m trying to make a simple UPS for my hassio setup. The idea is to have a powerbank that is plugged into a Tasmota enable sonoff smart socket, with the hassio setup coming off the powerbank. If there is a powercut for greater than 5 minutes, I would like to detect the smart socket as being offline and then set a 1 hour delay before shutting down hassio. The idea being that the powerback can power the whole setup for that period before safely shutting down.
I think I can probably work out how to do some of this in automations, but I don’t know how to detect the smart socket going offline, any ideas?