The UPS is nowhere near a computer or much else other than an outlet.
I use this simple setup:
- Home assistant under simple UPS
- Modem/router under simple UPS
- Sonoff smart plug (or any kind of smart plug) NOT under UPS
- HA automation which detects if smart plug state switches from ANY-STATE to UNAVAILABLE sending a message “Power outage” to your smartphone for example
- HA automation which detects if smart plug state switches from UNAVAILABLE to OFF(the default switch state) sending a message “Power back on” to your smartphone for example
I use the yolink power outage sensor. Your yolink hub and your router / modem need to be UPS protected in order to register the outage and recovery times on the yolink cloud.