I would like to know if someone has created an automation to send an alert to the smartphone in case of power failure using the smart plug
and powering the hub (M3) by a local UPS.c
Hello, welcome to the experimenters! Unfortunately, at the moment it is not possible to complete the task you have set. I did it in a different way. Alternative use of the Aqara leak detector
How I Handle Frequent Power Outages in Florida with Aqara + Homebridge
To address the issue mentioned in the original post, I suppose you could do the same with an Aqara Smart Plug assuming you leave it turned on and you turn on the Power Off Memory setting in the smart plug’s Device Settings. Obviously, you also need Homebridge or a similar platform to accomplish the extra stuff Aqara does not do …yet.
Living in Florida means dealing with frequent power outages—especially during heavy rain or hurricane season. Over time, I’ve built a system that keeps my smart home stable and consistent even when the power flickers. I wanted to share my setup in case it helps others in similar situations.
The Core Setup
• Aqara M100 Hub – plugged directly into an outlet (so when the power goes out, the hub goes out too).
• Homebridge (running on a server connected to a UPS) – keeps running even when the main power drops.
• Homebridge Plugins Used:
• Ping Hosts – constantly pings my Aqara M100 Hub.
• Delay Switch – lets me insert a timed buffer before automations run.
How It Works
- Normal Operation:
As long as the Aqara M100 Hub is online and powered, the Ping Hosts plugin gets a positive response.
- Detecting an Outage:
If the power goes out, the hub loses power, and Ping Hosts starts reporting negative results. Since my Homebridge server is on a UPS, it continues monitoring.
- The 5-Minute Delay:
I use Controller for HomeKit to create an automation that waits 5 minutes after a negative ping is detected. This buffer ensures I don’t get false triggers from quick flickers and gives all devices time to reconnect when power returns.
- Confirming Recovery:
If a positive ping is detected after the 5-minute delay, that’s my reliable indicator that power went out and has now come back.
- Post-Recovery Automations:
At this point, I have automations that:
• Turn off devices that default to “on” after power is restored but shouldn’t be.
• Turn on devices that lost power and didn’t automatically recover.
This way, my smart home essentially “resets” itself to the correct state after every outage, without me needing to intervene.
Why This Helps
Florida outages can be short or long, and the biggest headache is devices ending up in the wrong state afterward. This combination of the Aqara Hub, Homebridge Ping, and a smart recovery automation has made my setup resilient and hands-off.
Don’t think you can use a smart plug b/c it goes unresponsive in a power failure. It would be easy to use it to determine that you just came back up from a power failure (set plug to “on” and have it default to “off” on power failure … fire automation when plug detected “off” then reset plug to “on”). Though not very elegant, in a relatively dark room, you could have a lamp on that registers light (lumens) on say, an Aqara Motion and Light Sensor P2. It must be battery operated. When the power goes off, the light goes off, lumens drop and you can trigger an Aqara notification off that trigger
Good solution that keeps within the Aqara ecosystem.