Home Assistant UPS

My HA runs on a set of nuc’s thet have a UPS connected. Unfortunately that UPS does not have a USB signal to power down devices in a controlled matter. My Power meter (Youless) reports all details about the power supplied to the house such as voltage per phase and current. I also have quite some powered Zwave devices that report voltage presence as well. So I was thinking; It would not be too difficult to detect power outage (HA will run for a while on the UPS). I can get a notification (yes I also have UPS powered 5G backup Internet). But what would a good way of shutting down my Synology nas when shit hits the fan? Would it possible/necessary to emulate as a NUTS server? Use ESP32? Or let HA do the trick somehow?

Please share your ideas!

A device plugged into unback power can tell you when power is out. Device unavailable = power off = shut down soon. esp device with bluetooth. It can be a tracker/proxy and work to let you know when power is out. make sure you send yourself a notification so you are aware and have time to stop any mistriggers

shell command will allow you to run script that shuts things down after some time. Maybe it can watch for device to become unavailable and cancel if that occurs. I guess if you have PC bios set to power on PC at AC Power restore you can have it come back up but since your on UPS that gets hard. If you know how long UPS can power PC maybe you can make presumption and have PC power ON after XXminutes and check status. If device unavailable maybe power back down and wait again.