Friendly Names in iOS Notifications

Hi guys

I’m having some trouble getting my automation to dynamically return the name of the triggering entity for iOS notifications. I’ve tried “trigger.name” and “trigger.entity_id.attributes.friendly_name” but when I use anything other than what’s below, it seems to break the notification completely (it doesn’t send a notification to my iOS device)

Below is my automation yaml. Any help appreciated!

- id: '1601883264322'
  alias: Camera Motion Notification
  description: ''
  trigger:
  - platform: state
    from: 'off'
    to: 'on'
    entity_id: binary_sensor.camera_1_motion
  - platform: state
    from: 'off'
    to: 'on'
    entity_id: binary_sensor.camera_2_motion
  condition:
  - condition: state
    entity_id: person.jake
    state: not_home
  action:
  - service: notify.mobile_app_jacobs_iphone
    data:
      title: Motion Detected
      message: '{{ trigger.entity_id }} Detected'
  mode: single

I think what you’re looking for is trigger.to_state.attributes.friendly_name. Here’s one of mine for example -

  action:
    service: notify.mobile_app_mikes_iphone
    data:
      title: "Window Open"
      message: "The {{ trigger.to_state.attributes.friendly_name }} is open."
1 Like

Hm, I tried that and had the same result as the others… it broke the notification

Edit: I must have had a typo before because it works this second try. Thanks @_Mike

1 Like