Hello! I created an alarm based on a group of sensors and my garage door. The alarm trigger works, but the notification is too generic. Is there a way to add which sensor changed state to the notification without making different automatons for every sensor? e.g. if the front door was opened within my ‘all sensors’ group, can it say ‘Front Door Opened’ in the message? My code is below:
I have adapted the solution to notify open zones during alarm arming, only it sends notification with empty text, if I have all the zones closed (rest). does anyone know how to fix?
what has been done below:
alias: Notification List of Open Zones System Armed
description: ‘’
trigger:
entity_id: sensor.perimeter_status
platform: state
to: EXIT
condition: [ ]
action:
service: notify.notify
data_template:
title: Excluded Zones
message: “{% for state in states|selectattr(‘entity_id’,‘in’,state_attr(‘group.sensor_perimeter_alarm’,‘entity_id’))|selectattr(‘state’,‘eq’,‘ALARM’)|list -%}{{state.name+’, '}}{%- endfor %}”
service: telegram_bot.send_message
data_template:
title: Excluded Zones
message: “{% for state in states|selectattr(‘entity_id’,‘in’,state_attr(‘group.sensor_perimeter_alarm’,‘entity_id’))|selectattr(‘state’,‘eq’,‘ALARM’)|list -%}{{state.name+’, '}}{%- endfor %}”
alias: Notifica Elenco Zone Aperte Impianto Inserito
description: ‘’
trigger:
entity_id: sensor.perimetrale_status
platform: state
to: EXIT
condition: “{{ expand(‘group.sensori_allarme_perimetrale’) | selectattr(‘state’,‘eq’,‘ALARM’) | list | count > 0 }}”
action:
service: notify.notify
data_template:
title: Zone Escluse
message: “{% for state in states|selectattr(‘entity_id’,‘in’,state_attr(‘group.sensori_allarme_perimetrale’,‘entity_id’))|selectattr(‘state’,‘eq’,‘ALARM’)|list -%}{{state.name+’, '}}{%- endfor %}”
service: notify.famiglia
data_template:
title: Zone Escluse
message: “{% for state in states|selectattr(‘entity_id’,‘in’,state_attr(‘group.sensori_allarme_perimetrale’,‘entity_id’))|selectattr(‘state’,‘eq’,‘ALARM’)|list -%}{{state.name+’, '}}{%- endfor %}”
’