bsfaxi
(Bilel SFAXI)
August 14, 2023, 1:42pm
1
Personally, I find this feature very useful when we have to integrate multiple alarms into HA and want to orchestrate with our own logic.
This works very well. But, I find that the code is missing in the template, although there are the 2 available attributes: “code_arm_required” and “code_format” !
Is it possible to add the “code” attribute like for the manual “Alarm Control Panel”, please?
Today, I’m bypassing it with a “condition template” in the Template Alarm and a secret !
extract from the template alarm:
arm_away:
- condition: template
value_template: !secret home_alarm_evaluate_code
extract from secrets:
home_alarm_evaluate_code: "{{ code == 'xxxx' }}"
Thanks.
CO_4X4
(Colorado Four Wheeler)
August 14, 2023, 3:07pm
2
Did you look at the example on the alarm template page? It shows you where the codes go:
# Example configuration.yaml entry
alarm_control_panel:
- platform: template
panels:
safe_alarm_panel:
value_template: "{{ states('alarm_control_panel.real_alarm') }}"
arm_away:
service: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.real_alarm
data:
code: !secret alarm_code
arm_home:
service: alarm_control_panel.alarm_arm_home
target:
entity_id: alarm_control_panel.real_alarm
data:
code: !secret alarm_code
disarm:
- condition: state
entity_id: device_tracker.paulus
state: "home"
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.real_alarm
data:
code: !secret alarm_code
bsfaxi
(Bilel SFAXI)
August 14, 2023, 3:54pm
3
If I well understood the doc, these codes are sent as data for the « real » alarms not for the template alarm.
Diaoul
(Diaoul)
September 24, 2023, 2:28pm
4
I would love to have this ability as well. Thanks for the workaround @bsfaxi
Workaround works great, thanks for the hint!
HA_jr
March 31, 2024, 11:43pm
6
Thanks!!! This is a great workaround!
Sylwester
(Sylwester Olik)
June 6, 2024, 12:23pm
8
Can someone paste full example code. I do not know where to paste this condition template.
petro
(Petro)
June 6, 2024, 2:38pm
9
that is the example… it goes in configuration.yaml