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