Detecting power outages

The UPS is nowhere near a computer or much else other than an outlet.

I use this simple setup:

  1. Home assistant under simple UPS
  2. Modem/router under simple UPS
  3. Sonoff smart plug (or any kind of smart plug) NOT under UPS
  4. HA automation which detects if smart plug state switches from ANY-STATE to UNAVAILABLE sending a message “Power outage” to your smartphone for example
  5. 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.