Im new to HA but trying to set it up in a proper way.
I have split my config in multiple file and folders to keep the configuration.yaml small.
SETUP:
I have 2 automation files: 1 to set the home alarm panel to triggered if one of the door sensors is opened and 1 for a notification to send an update to my mobile if the state of the panel turns to “triggered”
Works like a charm.
Now i try to push the actual door sensor’s name that triggered the home alarm panel to turn to triggered to the notification but of course that does not work as the panel caused the trigger for the notification.
notification_alarm.yaml
alias: Manual Send Notification
description: ‘’
trigger:
platform: state
entity_id: alarm_control_panel.home_alarm
to: triggered
condition: []
action:
service: notify.mobile_app_my_mobile
data_template:
message: ‘{{ trigger.to_state.attributes.friendly_name }}’
mode: single
This will (as I suppose you noticed) send you the friendly name of the alarm, since that is what is in the trigger.
Note untested… but I think you could set all the door sensors as triggers.
Then the alarm as condition armed.
Now the trigger will be one of the door sensors, but only when alarm is armed and trigger.friendly name will be the friendly name of the binary sensor ( door sensor).
Please make sure to post the code inside a code block.
We can’t copy the automations correctly and it’s much harder to read and spot indentation errors.
Thanks for the quick reply and tip to post as a code block. Maybe I am over completing things in trying to set it up super flexible and splitting everything up. Maybe someone has some tips:
The idea is to have multiple sensors around the house (door, vibration, motion and camera) and depending on what sensor tiggers and the state of the panel (away, armed, vacation) would like to be able to send out different notifications.
e.g door sensors should always send push to mobile and sound the siren for all panel states, but in state holiday if motion is detected bij the outdoor camera it should sent notification to mobile but not sound siren (eg mailman walking on the driveway).
I would like the actual sensor friendly name in the notification.