Automation - motion detection > notification

I want to write an automation in which the detected motion detector is automatically replaced in the notification text.
Is this possible?
Else I have to write 20x nearly the same automation.

Yes it is possible see the documentation about available trigger variables:

e.g.

- id: motion_alert
  alias: 'Motion Alert'
  trigger:
    platform: state
    entity_id:
      - binary_sensor.some_motion_sensor_here
      - binary_sensor.another_one
      - binary_sensor.another_one_somewhere_else
    from: 'off'
    to: 'on'
  action:
    service: notify.your_notification_service_here
    data:
      title: '🏃 <b>Motion Detected</b>'
      message: "Motion detected by {{ trigger.to_state.name }}."
1 Like