I have made a HA group from devices->services->helpers
which is a binary_sensor called binary_sensor.cams_motion_sensors
that contains all my cameras motion sensors binary_sensor.
So when one of these binary_sensor.cameraX_motion_sensor turns to ON
the main binary_sensor.cams_motion_sensors turns ON too.
This last sensor also has the attribute entity_id where are listed all the cameras motion sensors binary_sensor.
I trying to create an automation that has to notify me which camera motion sensor triggered the group of the binary_sensor.cams_motion_sensors.
i tried like so:
alias: Quick notify cams motions sensors
trigger:
- platform: state
entity_id:
- binary_sensor.cams_motion_sensors
to: 'on'
action:
- service: notify.persistent_notification
data:
title: Motion detected
message: >-
A camera has detected a motion - {{ state_attr("trigger.id",
"friendly_name") }}
mode: single