Use Entity Status to send Notification

Hi All

I would like HA to send a notification when my home power goes from On-Grid to Off-Grid (this is an entity) when the power drops and then from Off-Grid to On-Grid when the power comes back on (Thanks Load-Shedding)

Screenshot 2023-09-07 at 18.17.23

I have tried creating an automation using both “Trigger” and “Condition” and selecting the entity but it does not give me the entity states, only “Unknown or Unavailable” come up as options:

If someone could point me in the right direction it would be much appreciated!!

The options available in the dropdown menu must be provided by the integration, but you are not limited to those options, you can type in whatever state you want to listen for. Be aware that some entities have an actual state and a “prettier” representative state shown in the frontend.

If you do not know the actual states you want to listen for, go to Developer Tools > States, enter your entity’s id/name and observe what it’s state is there.

Thank you - it is an integration:

If I set a Conditon, with the attribute as “Integration” and manually enter the State as “On-Grid” am I headed in the right direction?

That is not what I said…

Every device you connect to HA works through an integration. What I meant was that some integrations supply values so HA knows what to offer as options in the dropdown, others do not.

Based on your screenshot… almost, just leave the attribute field blank since you are trying to monitor the state, not an attribute.

Just to clarify, if you want the automation to run on changes to the state of the sensor you need to put the information in a Trigger. Without a trigger, an automation will never run. Depending on what you need the rest of the automation to do, you may want to use a single trigger with “On-Grid” and “Off-Grid” in both the to: and from: fields, or use two different triggers. You will need to share more information about the goals of the automation for us to help you with that.

You want it no matter what state it changes to. So, leave both Attribute and State blank.

Then, in your notification, use: