Dear community,
I’m just developing an alarm system using Aqara vibration sensors. Now, I would like to create one automation which creates a notification (no matter whether persistent or push notification to smartphone) that contains in the message body all sensors that just detected a motion.
I think about something like
IF state of any vibration sensor is “Motion Detected”
THEN create notification which contains a message “<sensor.name> has just detected motion!”
In case, multiple sensors detected motion, the message shall contain all sensor names, like
THEN create notification which contains a message “<sensor.name1>, <sensor.name2> has just detected motion!”
Do you have any idea, how to create such an automation?
Thanks a lot in advance and best regards
Benjamin
I think your logic is flawed.
Let’s assume vibration sensor 1 has just been triggered due to someone breaking into your home. You’ll receive a message that sensor 1 has been triggered. A few seconds later, vibration sensor 2 is triggered, you’ll receive a message that sensor 2 triggered only, because the first sensor is not in a “triggered” state anymore.
There won’t ever be two entities triggered at the exact same time, therfore your report will always only include 1 sensor name.
Also whatvis the use for having the name of the sensor 1 again in the second message?
What are you trying to achieve?
You’re right - maybe we can disregard the idea that multiple sensor names are contained in the message created.
But then coming back to the idea to have that one automation that sends out a notification containing the name of the sensor that detected motion while the condition is true, that the alarm panel is in state “triggered”.
What are you trying to achieve?
I want to get a notification, which window/ door caused the alarm. And, I don’t wan’t to create an automation for each door/ window or vibration sensor to save time and effort.
this is a example:
- id: 'Movimiento Detectado'
alias: Movimiento Detectado
trigger:
- entity_id:
- binary_sensor.sensor_movimiento_recibidor
- binary_sensor.sensor_movimiento_garaje
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data: {}
data_template:
message: El {{state_attr(trigger.entity_id, 'friendly_name')}} se ha disparado.
title: ATENCION MOVIMIENTO DETECTADO
service: notify.pushover
Do it like in the example of @pollinolas. Just list all your sensor that you want to listen to changes in the entity_id part of the trigger part of the automation.