# secrets inside templates not allowed
# must use hard coded 'code' on home assistant panel
# esphome code does not need to match HA code
alarm_control_panel:
  - platform: template
    panels:
      home_alarm:
        value_template: "{{ states('sensor.alarm_condition') }}"
        arm_home:
          - condition: template
            value_template: "{{ code == 'MYCODE' }}"
          - service: esphome.alarm_system_arm_home
            data:
              code: !secret esp_alarm_code
        disarm:
          - condition: template
            value_template: "{{ code == 'MYCODE' }}"
          - service: esphome.alarm_system_disarm
            data:
              code: !secret esp_alarm_code