Awebian
(Awebian)
1
How do I use Alamo variables such as {{changed_by}} or {{open_sensors}} in a Pushover alert?
I want the Pushover alert for an alarm trigger event to display the sensor that tripped the alarm.
I also want Pushover to state who Armed or Disarmed the alarm. Or use {{arm_mode}} variable in a Pushover message to show the mode activated.
Awebian
(Awebian)
3
Looks like no one has tried this before or that there is no known way to accomplish this???
Awebian
(Awebian)
4
SOLVED! Someone on Discord was able to point me in the right direction…
Under Alarmo’s [ACTIONS] menu, under [Actions], I created a new notification should the alarm trip.
Under “Task” in [TO YAML] i entered the following code:
- service: notify.pushover
data:
message: >-
ALARM Triggered by {% for open_sensor in
state_attr("alarm_control_panel.alarmo", "open_sensors").keys() |list %}
{{ state_attr(open_sensor, 'friendly_name') }}
{% endfor %}
title: ALARM TRIGGERED
target:
- my_iphone
data:
priority: 2
sound: siren
expire: 300
retry: 30
This yields a red critical alert that states:
ALARM TRIGGERED
ALARM Triggered by
Back Window
I also created a action for notifying when alarm was ARMED:
- service: notify.pushover
data:
message: >-
Alarm has been set to {{ state_attr('alarm_control_panel.alarmo',
'arm_mode') }} by {{ state_attr('alarm_control_panel.alarmo',
'changed_by') }}
title: ALARM
target: my_iphone
data:
priority: 0
sound: beep
expire: 300
Which yields:
ALARM
Alarm has been set to armed_away by Richard
Used this code… suddenly stopped working and have this error:
UndefinedError: ‘None’ has no attribute ‘keys’