Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[Home Assistant] Get friendly name of the triggering device in an automation

In an automation, you can retrieve the friendly_name of the triggering device using:

{{ trigger.to_state.attributes.friendly_name }}

Helpful if an automation can be triggered by different devices (e.g. garage door 1 or garage door 2) and you want to send a notification that explicitly names the triggering device:

  - service: notify.ALL_DEVICES
    data:
      title: Garage open!
      message: >-
        {{ trigger.to_state.attributes.friendly_name }} is open