How do I do alerting on MANY water sensors

I’ve setup a test alert on 1 water sensor. I have “many”.

What I want to do is 1 automation for alerting for ALL the sensors.

Here’s what I’ve started and I’ve tested with 1. What I need to do is have my notification ID WHICH sensor.

When I add more than 1, I’ll need to know WHICH set it off. I would rather not do 30 automations for this.

What would I add to the “message part” to ID the sensor?

title: leak alert
message: Leak alert

Be gentle with me, I’m new to Home assistant! :slight_smile:

alias: Leak alert
description: ‘’
trigger:

  • type: moist
    platform: device
    device_id: 1b867f1a0ce611eb959643e06a3f7461
    entity_id: binary_sensor.terri_aquarium_dry
    domain: binary_sensor
    condition: []
    action:
  • service: notify.mobile_app_sm_n986u1
    data:
    title: leak alert
    message: Leak alert
    mode: queued
    max: 10
alias: Leak alert
trigger:
  platform: state
  entity_id:
  - binary_sensor.terri_aquarium_dry
  - binary_sensor.another_1
  - binary_sensor.another_2
  - binary_sensor.another_etc
action:
  service: notify.mobile_app_sm_n986u1
  data:
    title: Leak alert!
    message: 'Leak alert for {{trigger.to_state.name}}'
mode: queued

{{trigger.to_state.name}} reports the friendly_name of whichever binary_sensor triggered the automation. For more information, refer to Trigger State Object and State Object.

so this is really the key?

{{trigger.to_state.name}}

That was all I was missing???

Yes but I also changed the Device Trigger to a State Trigger because it’s easy to make a State Trigger listen to multiple entities whereas as a Device Trigger is designed to listen to a specific entity (you would have to create a separate Device Trigger for each entity).