If I have seven door/window sensors, do I need seven notification automations?

I know, I know; I can just add more devices to the Trigger section. But I would like to receive a push notification stating exactly which sensor was triggered. Can this be done without having an automation for each?

Also, I’d like to only notify me if I’m home, and also only notify my wife if she’s home. Can I do this in one automation, or will I need to double up?

Sure:

data:
  message: "{{ trigger.to_state.name }} triggered the automation"
1 Like

Thanks! That is cool!

I would prefer if it would just say “Garden Door” instead of “LUMI lumi.sensor_magnet.aq2 Garden Door” - do you know if this is possible?

.name will return the friendly name of the entity if it has one. If not it falls back to the entity id.

You can edit the friendly name to be whatever you want in the settings tab of the more info pop-up for the entity.

1 Like

The information available in the trigger variable depends on the type of trigger.

Automation Trigger Variables

State Trigger

Template variable Data
trigger.platform Hardcoded: state
trigger.entity_id Entity ID that we observe.
trigger.from_state The previous state object of the entity.
trigger.to_state The new state object that triggered trigger.
trigger.for Timedelta object how long state has been to state, if any.
1 Like

Wow - I had no idea! Thank you so much! :smiley: