Energy Management automation - Alarm when energy lost

I have installed the Shelly EM and it is connected correctly.

However, I bought the Shelly EM because we went away recently for 10 days only to come home to find that the power had tripped and our deepfreeze, with shrimp in it, had defrosted.

What I am struggling to do is create an automation that sends an alert/alarm when I lose power. I have a UPS that keeps the internet and HA running. What entity do I track to determine that the power is lost? I can’t use the Shelly voltage or power entities, because the Shelly may have lost power and therefore will not be reporting.

Thoughts?

If you are using the core Shelly integration you should have a binary sensor like this:

binary_sensor.shelly_em_status

You can trigger when it goes to ‘unavailable’.

It may be disabled by default. Check the Configuration / Devices / Shelly / your EM device page.

You could also consider adding your UPS to Home Assistant if it is supported by the NUT addon. That would definitely have power fail sensors.

Thanks tom_I, great suggestion about the UPS. I should have thought of that. :frowning: Unfortunately I might have gone too cheap on the UPS. It is a Tecnoware UPS ERA PLUS 900, and I do not think it is smart.

Of course I also want to use the Shelly to monitor power consumption. In fact I am going to buy at least 1 more EM because I have 4 daisy chained electricity panels. I want to measure ‘zone’ consumption rather than individual devices.

Use the Shelly status binary sensor then.