Help - automation - define which trigger in notification action

Hi,
I’ve got an automation with multiple triggers and a notification action, how can I mention there which trigger has been pulled off?

alias: test
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.deurbel_ringing
    to: "on"
    id: sensor
  - platform: state
    entity_id:
      - binary_sensor.deurbel_motion_detected
      - binary_sensor.deurbel_person_detected
    to: "on"
    enabled: true
condition: []
action:
  - service: notify.john
     data:
        title: test
        message: test

Use the trigger variable.

alias: test
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.deurbel_ringing
    to: "on"
    id: sensor
  - platform: state
    entity_id:
      - binary_sensor.deurbel_motion_detected
      - binary_sensor.deurbel_person_detected
    to: "on"
    enabled: true
condition: []
action:
  - service: notify.john
     data:
        title: test
        message: "{{ trigger.to_state.name }}"
1 Like