Alarm Control Panel Component

Base Alarm Control Panel Configuration

alarm_control_panel:
  - platform: ...
    name: Alarm Panel

Configuration variables:

  • id (Optional, string): Manually specify the ID for code generation. At least one of id and name must be specified.

  • name (Optional, string): The name of the alarm control panel. At least one of id and name must be specified.

    Note

    If you have a friendly_name set for your device and you want the switch to use that name, you can set name: None.

  • on_state (Optional, Action): An automation to perform when the alarm changes state. See on_state Trigger.

  • on_arming (Optional, Action): An automation to perform when the alarm state changes to arming. See on_arming Trigger.

  • on_pending (Optional, Action): An automation to perform when the alarm state changes to pending. See on_pending Trigger.

  • on_armed_home (Optional, Action): An automation to perform when the alarm state changes to armed_home. See on_armed_home Trigger.

  • on_armed_night (Optional, Action): An automation to perform when the alarm state changes to armed_night. See on_armed_night Trigger.

  • on_armed_away (Optional, Action): An automation to perform when the alarm state changes to armed_away. See on_armed_away Trigger.

  • on_triggered (Optional, Action): An automation to perform when the alarm triggers. See on_triggered Trigger.

  • on_disarmed (Optional, Action): An automation to perform when the alarm state changes to disarmed. See on_disarmed Trigger.

  • on_cleared (Optional, Action): An automation to perform when the alarm clears. See on_cleared Trigger.

  • on_ready (Optional, Action): An automation to perform when the logical ‘and’ of all the zone sensors change state. See on_ready Trigger.

  • on_chime (Optional, Action): An automation to perform when a zone has been marked as chime in the configuration, and it changes from closed to open. See on_chime Trigger.

  • If Webserver enabled and version 3 is selected, All other options from Webserver Component.. See Webserver Version 3.

  • If MQTT enabled, all other options from MQTT Component.

Automation:

on_state Trigger

This trigger is activated each time the alarm changes state.

alarm_control_panel:
  # ...
  on_state:
    then:
      - logger.log: "Alarm Panel State Changed!"

on_pending Trigger

This trigger is activated when the alarm changes to pending state.

alarm_control_panel:
  # ...
  on_pending:
    then:
      - logger.log: "Alarm Pending!"

on_arming Trigger

This trigger is activated when the alarm changes to arming state.

alarm_control_panel:
  # ...
  on_arming:
    then:
      - logger.log: "Alarm Arming!"

on_armed_home Trigger

This trigger is activated when the alarm changes to armed_home state.

alarm_control_panel:
  # ...
  on_armed_home:
    then:
      - logger.log: "Alarm armed_home!"

on_armed_night Trigger

This trigger is activated when the alarm changes to armed_night state.

alarm_control_panel:
  # ...
  on_armed_night:
    then:
      - logger.log: "Alarm armed_night!"

on_armed_away Trigger

This trigger is activated when the alarm changes to armed_away state.

alarm_control_panel:
  # ...
  on_armed_away:
    then:
      - logger.log: "Alarm armed_away!"

on_triggered Trigger

This trigger is activated when the alarm changes to triggered state.

alarm_control_panel:
  # ...
  on_triggered:
    then:
      - logger.log: "Alarm Triggered!"

on_cleared Trigger

This trigger is activated when the alarm changes from triggered back to either the previous armed state or disarmed.

alarm_control_panel:
  # ...
  on_cleared:
    then:
      - logger.log: "Alarm Cleared!"

on_disarmed Trigger

This trigger is activated when the alarm changes from to disarmed.

alarm_control_panel:
  # ...
  on_disarmed:
    then:
      - logger.log: "Alarm Disarmed!"

on_ready Trigger

This trigger is activated when the logical ‘and’ of all the alarm sensors change state. This is useful for implementing “alarm ready” LEDs. Once this trigger is called, you can get the ready state by calling get_all_sensors_ready() in a lambda block.

alarm_control_panel:
  # ...
  on_disarmed:
    then:
      - lambda: !lambda |-
          ESP_LOGI("AlarmPanel", "Sensor ready change to: %s", ((id(acp1).get_all_sensors_ready()) ? (const char *) "True" : (const char *) "False"));

on_chime Trigger

This trigger is activated when a zone sensor marked with chime:true changes from closed to open. This is useful for implementing keypad chimes when a zone opens.

alarm_control_panel:
  # ...
  on_chime:
    then:
      - logger.log: "Alarm Chime!"

arm_away Action

This action arms the alarm in away mode. The code is required when requires_code_to_arm is true.

on_...:
  then:
    - alarm_control_panel.arm_away:
        id: acp1
        code: "1234"

arm_home Action

This action arms the alarm in home mode. The code is required when requires_code_to_arm is true.

on_...:
  then:
    - alarm_control_panel.arm_home:
        id: acp1
        code: "1234"

arm_night Action

This action arms the alarm in night mode. The code is required when requires_code_to_arm is true.

on_...:
  then:
    - alarm_control_panel.arm_night:
        id: acp1
        code: "1234"

disarm Action

This action disarms the alarm. The code is required when codes is not empty.

on_...:
  then:
    - alarm_control_panel.disarm:
        id: acp1
        code: "1234"

pending Action

This action puts the alarm in pending state (the state before triggered after pending_time).

on_...:
  then:
    - alarm_control_panel.pending: acp1

triggered Action

This action puts the alarm in triggered state.

on_...:
  then:
    - alarm_control_panel.triggered: acp1

is_armed Condition

This Condition checks if the alarm control panel is armed.

on_...:
  if:
    condition:
      alarm_control_panel.is_armed: acp1

lambda calls

From lambdas, you can call the following methods:

  • arm_away(code)

  • arm_home(code)

  • arm_night(code)

  • disarm(code)

  • get_all_sensors_ready()

id(acp1).arm_away();
id(acp1).arm_home();
id(acp1).arm_night();
id(acp1).disarm(std::string("1234"));
bool all_sensors_ready = id(acp1).get_all_sensors_ready();

Platforms

See Also