I’m trying to create an alarm template to wrapper an Envisilink alarm_control_panel that I’m not happy with the behavior of. Specifically, I’d like to be able to arm the system without a code, but you still need a code to disarm. The Envisilink takes an all-or-nothing approach where you can either specify a code in the config and you then no longer need one to arm or disarm, OR you can not specify a code in the config and then you need one to both arm and disarm.
So here is what I’ve done:
alarm_control_panel:
- platform: template
panels:
guest_alarm_panel:
value_template: "{{ states('alarm_control_panel.guest') }}"
name: Guest Alarm
code_arm_required: false
arm_away:
action: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.guest
data:
code: !secret envisalink_code
arm_home:
action: alarm_control_panel.alarm_arm_home
target:
entity_id: alarm_control_panel.guest
data:
code: !secret envisalink_code
disarm:
action: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.guest
When I use this, the arm works perfect, but if I try to disarm, even with a code, I get this in the log:
2024-08-20 13:42:57.197 ERROR (MainThread) [homeassistant.helpers.script.guest_alarm] Guest Alarm: Error executing script. Unexpected error for call_service at pos 1: unsupported operand type(s) for +: 'NoneType' and 'str'