Noob alarm trigger question

My alarm configuration is

alarm_control_panel:
  - platform: manual
    name: Intrusion Alarm
    code: !secret alarm_code
    code_arm_required: false
    disarm_after_trigger: false
    arming_time: 60
    delay_time: 30
    trigger_time: 60
    disarmed:
      trigger_time: 0
    armed_home:
      arming_time: 0
      delay_time: 0

And setup automation to trigger as

alias: armed_home triggers
description: ''
trigger:
  - platform: state
    entity_id: group.door_sensors
    to: 'on'
  - platform: state
    entity_id: group.window_sensors
    to: 'on'
condition:
  - condition: state
    entity_id: alarm_control_panel.intrusion_alarm
    state: armed_home
action:
  - service: alarm_control_panel.alarm_trigger
    target:
      entity_id: alarm_control_panel.intrusion_alarm
  - service: notify.notify
    data:
      message: Intrusion Alarm is triggering now
mode: single

and I have a similar automation for triggering for home_away_state.

Although I have configured a delay_time of 30 seconds in the alarm, the alarm is being triggered by these automations. How do I enable a delay for both armed_home and home_away states so that a grace period is given to enter the code to disarm?

Welcome to the forums, jas!

Define an explicit armed_away status and try again.

The arming_time, delay_time, trigger_time are all between different states of the alarm_control_panel.alarm_trigger and not affect outside it. eg 60sec arming_time is just when you click the “arm_away” button it will change from disarmed to “arming” 60sec later to “armed_away”. So you create automation to use these states as triggers eg in your case you can use it to switch on/off the “armed_home_triggers” automation.

- alias: Alarm armed away mode
  trigger:
    platform: state
    entity_id: alarm_control_panel.intrusion_alarm
    to: armed_away
  action:
    - service: automation.turn_on
      entity_id:
        - armed_home_triggers

and vice versa

Just a side note, groups are useful but have an inherent weakness when use as alarm.

trigger:
  - platform: state
    entity_id: group.door_sensors
    to: 'on'

vs

trigger:
  - platform: state
    entity_id:
      - binary_sensor.door_1
      - binary_sensor.door_2
      - binary_sensor.door_3
      - binary_sensor.door_4
    to: 'on'

In the first example if you leave the house and forgot to close 1 door the group will remain “on” and intrusion from any other door will not trigger because it is still in the on state.

In the second example even if you left 1 door open when another door open it will trigger because that door was off to on. (hope that make sense)

1 Like

Thank you @pedolsky . After defining an armed_away trigger, it seems to work for armed_away

Thanks for the suggestion @huu. I did not know that you could arm the panel when one of the doors or windows are open; that seems contradictory to normal alarm operations. Is there a way to stop the panel from arming when the windows or doors are open? Thanks