Entity variable

hi, can I use a entity name as variable? couldn’t find anything !?

message {enitiy_id} is not working…

thanks

We can give you more specific help if you provide us with more detail about what you are trying to do.

I want to inform me when a sensor fails.

alias: Alarm  offline Detection iOS Push
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.motion1
    to: unavailable
  - trigger: state
    entity_id:
      - binary_sensor.motion2
    to: "on"
conditions: []
actions:
  - data:
      title: Alarm Sensor Offline
      message: "{{entity.id}} offline"
    action: notify.mobile_app_iphone_a14
  - action: notify.mobile_app_iphone_a13
    metadata: {}
    data:
      message:  offline
      title: Alarm Sensor Offline
mode: single
  message: "{{entity.id}} offline"

should be:

Sensor.motion1 offline or
Sensor.motion2 offline

:slight_smile:

You need to use the trigger variable:

hmm, ok, now i got with var
trigger.entity_id

binary_sensor.motion_sensor1_motion Offline

its not so nice this description is so long and not clean… why I couldn’t use the entity_id with the smooth name “Motion Office” ???

You asked for the entity ID so it gave you the entity ID… If you want the name, use trigger.to_state.name or trigger.to_state.attributes.friendly_name.

thank you :slight_smile: