So I am using home assistant just as a means to an end (for now). I have 2 esphome athom smart plugs. My UPS is dumb so I was thinking that I plug the UPS into the wall through the smart plug and when it goes offline due to a power outage, home assistant will send a shutdown to the trueNAS server via its REST API.
https://www.athom.tech/blank-1/uk-v2-plug-for-esphome
I am a complete noob when it comes to smart home stuff so if something here sounds stupid then is probably so I am all ears for alternatives. I have manually HA installed on the TN server in an ubuntu server VM that has pihole, unbound and tailscale.
Now some quirks. It seems when the smartplug loses power, home assistant doesn't show it as unavailable. It reports the last received value until it comes back online and then goes unavailable for a second.
The power sensor reports every 5 seconds so I was thinking if the sensor data is stale for more than 30 seconds it will send the shutdown then unless you guys know how to to fix the thing not reporting as unavailable.
The solution needs to be pretty immediate. I might get a Pi in the future that will always stay online and work as a kvm. Thanks for reading.