Alert component can include templates

Hey guys,

This is not reflected on any documentation about the Alert component but it is possible to include templates in the notification that you receive on your device.

For example.

alert:
  garage_door:
    name: Garage has been open for {{ relative_time(states.binary_sensor.garage.last_changed) }}
    done_message: Garage is closed
    entity_id: binary_sensor.garage
    state: 'on'
    repeat:
      - 30
      - 60
      - 120
    can_acknowledge: True
    skip_first: True
    notifiers:
      - my_phone_join

See how I added my template in the “name” variable of the Alert?

2 Likes