What is the simplest way to detect a power outage?

I do something similar but with Node-red. I have it shut down Hubitat if it detects an outage, send a notification and then when power comes back on, restart Hubitat

@roberto - if you are using Node-red, here is a link to how I do this.

https://community.hubitat.com/t/shutdown-and-restart-hub-in-case-of-power-outage-node-red-solution-long-read/53052