I build something like this. This sensor already include power monitoring. You can just not use the smoke detector connection and put it inside a box and wire it to your AC power that is in the same line as your hub.
When the power is out, the sensor will send out notifications.