Trouble setting up manual Alarm

I have some trouble setting up my manual alarm system. Below is my configuration and automation. So everything load fine but it gives me two errors:

When i try to alarm the home it doesn’t do anything and when i go and check my logs it said " Invalid code given for armed_home " but the definite type in the correct code base from my configuration.

Another is saying my automation has some invalid

Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /config/configuration.yaml, line 218). Please check the docs at https://home-assistant.io/components/automation/

Here is my Line 218:

Configuration

#Alarm
alarm_control_panel:
  platform: manual
  name: "HA Alarm"
  code: !secret code
  pending_time: 45
  trigger_time: 45
  disarm_after_trigger: false

script:
  light_flash:
    alias: Light flash on
    sequence:
      - service: homeassistant.turn_on
        data:
          entity_id: group.all_lights
      - delay:
          seconds: 1
      - service: homeassistant.turn_off
        data:
          entity_id: group.all_lights
      - service: script.turn_on
        data:
          entity_id: script.light_loop
  light_loop:
    alias: Light flash loop
    sequence:
      - delay:
          # time for flash light off
          seconds: 1
      - service: script.turn_on
        data:
            entity_id: script.light_flash

automations.yaml

  - alias: Alarm Away
    hide_entity: True
    trigger:
      - platform: state
        entity_id: binary_sensor.door_window_sensor_158d0001aab2c4
        state: 'on'
      - platform: state
        entity_id: binary_sensor.motion_sensor_158d0001aea96b
        state: 'on'
    condition:
      condition: state
      entity_id: alarm_control_panel.ha_alarm
      state: armed_away
    action:
      service: alarm_control_panel.alarm_trigger
      entity_id: alarm_control_panel.ha_alarm

  - alias: Alarm Home
    hide_entity: True
    trigger:
      - platform: state
        entity_id: binary_sensor.door_window_sensor_158d0001aab2c4
        state: 'on'
      - platform: state
        entity_id: binary_sensor.motion_sensor_158d0001aea96b
        state: 'on'
    condition:
      condition: state
      entity_id: alarm_control_panel.ha_alarm
      state: armed_home
    action:
      service: alarm_control_panel.alarm_trigger
      entity_id: alarm_control_panel.ha_alarm

  - alias: Triggered Flash
    hide_entity: True
    trigger:
      platform: state
      entity_id: alarm_control_panel.ha_alarm
      state: 'triggered'
    action:
      - service: script.turn_on
        entity_id: script.light_flash
      - service: notify.PushBullet
        data:
          message: 'Home Alarm Reset {{now().strftime("%Y%m%d-%H%M%S")}}'
      - service: xiaomi_aqara.play_ringtone
        data: 
          gw_mac: !secret code
          ringtone_id: 0
          ringtone_vol: 50

  - alias: Disarmed Off
    hide_entity: True
    trigger:
      platform: state
      entity_id: alarm_control_panel.ha_alarm
      state: 'disarmed'
    action:
      - service: script.turn_off
        entity_id: script.light_loop
      - service: notify.PushBullet
        data:
          message: 'Home Alarm Reset {{now().strftime("%Y%m%d-%H%M%S")}}'
      - service: xiaomi_aqara.play_ringtone
        data: 
          gw_mac: !secret code
          ringtone_id: 24
          ringtone_vol: 20

I think you need quotes around the states in your automation conditions

state: armed_home

should be

state: 'armed_home'

Hmm still the same issue and error

Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /config/configuration.yaml, line 217). Please check the docs at https://home-assistant.io/components/automation/

  YAML file /config/configuration.yaml contains duplicate key "script". Check lines 160 and 218.    Failed unsubscribing for push notifications.

Which i think i missed in orginal post.

It seem like some error with script but I am not sure why and also line 218 is my automation: !include automations.yaml

The HA manual alarm panel works and show up but script doesn’t. Also i have tired a simpler script to test out the HA controller but i always get invalid code enter, so I am not sure it something is broken with HA manual alarm or my automation/scripts.

You can’t use triggers like that anymore the state trigger changed to -> to: ‘on’ not state: ‘on’

Oh ok, is there like up to date manual alarm out there? Or someone configuration/automation I can have look at?

1 Like