Notification on Power Failure on Shelly 3EM

I run HA on Conbee II with ZHA . I have the power monitor Shelly 3EM well integrated into HA . Is there any possibility of getting a notification on Mobile or Telegram when there is a power failure. The problem is when the Power fails the Shelly 3EM is “unavailable” …so no readings of Rssi , Voltage, Power , Current available. I have a robust UPS which powers the home on power failure. That means the Routers , Internet, Coordinators, Wi-Fi , Zigbee devices are functioning with no interruptions. So which entity should I select to create an Automation on power fail ? My Telegram Bot and Mobile notifications function correctly for other Automated Routines. Suggestion from the community will be appreciated.

You should be monitoring the UPS for insight into power failures or voltage/frequency discrepancies.

That would be best, but if not possible just trigger an automation on the Shelly EM state going to `unavailable’.

I have studied the history/graphs but difficult to monitor variations. We have a 3 phase power supply and the UPS which is on one phase can take loads upto 2000 W . So even when a kitchen mixer goes on (say 1000W) there will be a spike !! The other two phases are dedicated to air conditioners , geysers which are not on the UPS load.

Does the UPS not report when it is on battery?

Would appreciate guidance on how to trigger an automation on shelly state “unavailable” . I cannot find the state “Unavailable” in trigger !!

Unfortunately only on the UPS display panel !!

You write the state in yourself.

trigger:
  platform: state
  entity_id: sensor.your_shelly_sensor_here
  to: 'unavailable'

I highly suggest you check out the NUT (network UPS tools) integration to get more information from your UPS if it is connected by LAN or USB to your home assistant server.

Unfortunately my UPS is not connected to the LAN or USB