I’m using the stock alarm panel that comes with HA. I’d like to change the behavior so that if someone attempts to Arm Home, that it will check to see if any doors are open, and if so, make an announcement on our Echo devices. I have the code for the announcements and such, I just don’t know where the best place to put that logic is - so that it can go through the conditional checks before actually arming and if not, make the announcement? Would that go directly in the alarm panel itself?
I don’t think this capability is available for the core manual alarm integration.
You could write an automation that is triggered by the alarm arming. Add conditions to check if any of your doors are open. If so the first action will be to disarm the alarm then send your notification.
Alternatively there are two custom alarm systems that have this sensor check functionality built in.
BWAlarm - waiting on the developer to apply some fixes to the web interface, but otherwise functional.
I too am trying to figure this out with my honeywell system so I can have an arm button by each door. When pressed i want it to check for open zones first, google broadcast if there is a fault, or start arm countdown if all is well. Only problem is zone status isn’t surfaced to HA, bummed.
I have an envisalink integration into a DST panel but it should work pretty much the same I think.
Here is my automation code (of course changed automation id and code to arm .
I found the code to announce the opened zone (after the else statement) here on github on another discussion so I don’t take credit for it ,I just by trial and error changed it slightly.
id: '1111111111'
alias: Alarm Set Home (rev1)
description: ''
trigger:
- platform: time
at: '22:00:00'
condition: []
action:
- if:
- condition: state
entity_id: sensor.home_alarm_p1_keypad
state: Ready
then:
- service: alarm_control_panel.alarm_arm_home
data:
code: '1111'
target:
entity_id: alarm_control_panel.home_alarm_p1
- service: script.nest_hubs_set_volume
data: {}
- service: script.tts_clloud_say_var
data:
title: Alarm Armed
message: Alarm is Armed on Home Mode!
- service: script.sonos_tts_var
data:
title: Alarm Armed
message: Alarm is Armed on Home Mode!
else:
- service: tts.cloud_say
data_template:
entity_id: media_player.nesthubs
message: >-
Alarm not ready! Opened zone {% for state in
states|selectattr('entity_id','in',state_attr('group.alarm','entity_id'))|selectattr('state','eq','on')|list
-%}{{state.name}}{%- endfor %}
mode: single