Either you’re overthinking the challenge or I’m underthinking it.
The following will probably require some adjustment but it’s a starting point:
alarm_control_panel:
- platform: template
panels:
master_alarm_panel:
value_template: >
{% set p1 = states('alarm_control_panel.alarm_part_1') %}
{% set p2 = states('alarm_control_panel.alarm_part_2') %}
{{ p1 if p1 == p2 else 'pending' }}
arm_away:
- service: alarm_control_panel.alarm_arm_away
data:
code: !secret alarm_code
entity_id:
- alarm_control_panel.alarm_part_1
- alarm_control_panel.alarm_part_2
arm_home:
- service: alarm_control_panel.alarm_arm_home
data:
code: !secret alarm_code
entity_id:
- alarm_control_panel.alarm_part_1
- alarm_control_panel.alarm_part_2
arm_night:
- service: alarm_control_panel.alarm_arm_night
data:
code: !secret alarm_code
entity_id:
- alarm_control_panel.alarm_part_1
- alarm_control_panel.alarm_part_2
disarm:
- service: alarm_control_panel.alarm_disarm
data:
code: !secret alarm_code
entity_id:
- alarm_control_panel.alarm_part_1
- alarm_control_panel.alarm_part_2
It assumes alarm_code is stored in your secrets.yaml
file and the same code is used by both partitions. If that’s incorrect, let me know and we can easily adapt it to use separate codes.
In a nutshell, if you arm this third “Master Alarm Panel”, it proceeds to arm the first partition followed by the second partition.
The automation I posted doesn’t work like that (but it can). I assumed the Master Alarm Panel is to ensure the two partitions work in unison (i.e. will always have the same state).
During the process of arming both partitions, there may be a moment when the status of the first partition differs from the second one. The Master Alarm Panel reports this ‘transition state’ as pending
. In other words, when one partition’s state differs from the other, the assumption is it’s a temporary situation and they will soon be equivalent.
However, if my assumption is incorrect and it may be normal for one partition to be armed and the other to be disarmed (for long periods of time) then it’s up for debate as to what best describes this state. You said you would call it armed
which, to my mind, is a bit misleading because the other partition is actually disarmed.
The only states recognized by Home Assistant’s alarm_control_panel are the following:
armed_away, armed_home, armed_night, arming, disarmed, pending, triggered and unavailable
In my opinion, the only one that adequately conveys the notion that the entire system (i.e. both partitions) are not fully armed/disarmed is pending
. However, it’s your call and value_template
can be easily adapted to whatever you see fit.