I am very new to Home Assistant and just started my journey with it.
After configuring some z-wave sensors (Abus) and Shutters (Technisat), I wanted to give the Alarm Panel a try.
I got the Alarm Panel card to work with the two modes (states?) that I choose:
armed_away
armed_night
I was wondering if it is possible to be notified with the sensors name that triggered the Alarm?
Currently I receive a notification with a static text that I configured.
# Armed Away
- alias: 'Trigger alarm while armed away'
trigger:
- platform: state
entity_id: binary_sensor.bewegungsmelder_eg
to: "on"
condition:
- condition: state
entity_id: alarm_control_panel.alarmanlage
state: armed_away
action:
service: alarm_control_panel.alarm_trigger
target:
entity_id: alarm_control_panel.alarmanlage
# Armed Night
- alias: 'Trigger alarm while armed night'
trigger:
- platform: state
entity_id: binary_sensor.bewegungsmelder_eg
to: "on"
condition:
- condition: state
entity_id: alarm_control_panel.alarmanlage
state: armed_night
action:
service: alarm_control_panel.alarm_trigger
target:
entity_id: alarm_control_panel.alarmanlage
# Alarmierung
- alias: 'Send notification when alarm triggered'
trigger:
- platform: state
entity_id: alarm_control_panel.alarmanlage
to: "triggered"
action:
# Notify Phone 1
- service: notify.mobile_app_iphone_von_1
data:
title: "ALARM!"
message: "ALARM! Bewegung EG"
# Notify Phone 2
- service: notify.mobile_app_iphone_von_2
data:
title: "ALARM!"
message: "ALARM! Bewegung EG"
I found in this manual Manual - Home Assistant an example where it seems to call some sensor name with date and time. I never got it to work. I just receive my static text with âUNKNOWNâ
message: >
ALARM! The alarm is armed in Home mode {{ states('sensor.date_time') }}
I would appreciate any pointers how to get the sensor name in the title or message part.
Your trigger entity triggers if it changes its state to âonâ = trigger.to_state.
One of the attributes of the entity is its given name = attributes.friendly_name . All together itâs trigger.to_state.attributes.friendly_name .