I know this must be a spacing issue or something but I have tried to add a few of the example automation from looking at the docs and at some point I got something wrong now I can’t get any of them to work.
can someone help me out with this error? I have commented out all the new automations I am trying to put in and can’t even get the first one to work at this point.
Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /config/automations.yaml, line 195). Please check the docs at https://home-assistant.io/components/automation/
here is my automation file:
#####alarm beep when door opened or closed####
- alias: DoorChime
initial_state: true
trigger:
- entity_id: binary_sensor.garage_door
platform: state
- entity_id: binary_sensor.front_door
platform: state
- entity_id: binary_sensor.1st_floor_windows
platform: state
- entity_id: binary_sensor.basement_door
platform: state
- entity_id: binary_sensor.basement_garage_door
platform: state
- entity_id: binary_sensor.basement_windows
platform: state
- entity_id: binary_sensor.breakfast_door
platform: state
- entity_id: binary_sensor.sliding_glass_door
platform: state
- entity_id: binary_sensor.sun_room_glass
platform: state
condition: []
action:
service: switch.turn_on
data:
entity_id: switch.door_chime_2
# - service: switch.turn_on
# data:
# entity_id: switch.door_chime_2
# - service: notify.simple
# data_template:
# message : " {{ trigger.from_state.attributes.friendly_name }} has been Opened "
# title: "test alert"
####sound alarm siren when armed home or away####
- alias: trigger alarm while armed home or away
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.garage_door
to: 'on'
- platform: state
entity_id: binary_sensor.front_door
to: 'on'
- platform: state
entity_id: binary_sensor.1st_floor_window
to: 'on'
- platform: state
entity_id: binary_sensor.basement_door
to: 'on'
- platform: state
entity_id: binary_sensor.basement_garage_door
to: 'on'
- platform: state
entity_id: binary_sensor.basement_windows
to: 'on'
- platform: state
entity_id: binary_sensor.breakfast_door
to: 'on'
- platform: state
entity_id: binary_sensor.sliding_glass_door
to: 'on'
- platform: state
entity_id: binary_sensor.sun_room_glass
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.house
state: armed_away
- condition: state
entity_id: alarm_control_panel.house
state: armed_home
action:
service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.house
#turn on siren when triggered
- alias: Alarm Triggered
initial_state: true
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
- service: switch.turn_on
entity_id: switch.siren_2
- service: notify.simple
data:
message: "ALARM TRIGGERED"
title: "ALARM TRIGGERED"
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
- service: switch.turn_on
entity_id: switch.siren_2
- service: notify.simple
data:
message: "ALARM TRIGGERED"
title: "ALARM TRIGGERED"
# - delay: '00:05:00'
# - service: switch.turn_off
# entity_id: switch.siren
# Turn off siren when disarmed.
- alias: alarm_auto_noise_off
initial_state: true
# initial_state: true
trigger:
- platform: state
entity_id: alarm_control_panel.house
from: 'triggered'
to: 'armed_home'
- platform: state
entity_id: alarm_control_panel.house
from: 'triggered'
to: 'armed_away'
- platform: state
entity_id: alarm_control_panel.house
from: 'triggered'
to: 'disarmed'
action:
- service: switch.turn_off
entity_id: switch.siren_2
- alias: Alarm Disarmed
trigger:
- platform: state
entity_id: alarm_control_panel.house
from: 'triggered'
to: 'disarmed'
action:
service: switch.turn_off
entity_id: switch.siren_2
- alias: DoorOpen
initial_state: true
trigger:
- entity_id: binary_sensor.garage_door
platform: state
to: 'on'
- entity_id: binary_sensor.front_door
platform: state
to: 'on'
- entity_id: binary_sensor.basement_door
platform: state
to: 'on'
- entity_id: binary_sensor.basement_garage_door
platform: state
to: 'on'
- entity_id: binary_sensor.breakfast_door
platform: state
to: 'on'
- entity_id: binary_sensor.sliding_glass_door
platform: state
to: 'on'
condition: []
action:
service: notify.simple
data_template:
message : " {{ trigger.from_state.attributes.friendly_name }} has been Opened "
title: "Door Alert"
- alias: Wicky Home
initial_state: true
trigger:
- entity_id: person.wicky
platform: state
from: 'not_home'
to: 'home'
action:
service: notify.simple
data:
message: "Wicky home"
title: "Wicky"
- alias: Wicky left
initial_state: true
trigger:
- entity_id: person.wicky
platform: state
from: 'home'
to: 'not_home'
action:
service: notify.simple
data:
message: "Wicky is not home"
title: "Wicky"
- alias: Notify if any doors left open for 10 minutes ****THIS IS LINE 195***
initial_state: true
trigger:
- entity_id:
- binary_sensor.garage_door
- binary_sensor.front_door
- binary_sensor.1st_floor_window
- binary_sensor.basement_door
- binary_sensor.basement_garage_door
- binary_sensor.basement_windows
- binary_sensor.breakfast_door
- binary_sensor.sliding_glass_door
- binary_sensor.sun_room_glass
platform: state
state: 'on'
for:
minutes: 1
action:
service: notify.simple
data_template:
message: "The {{ trigger.to_state.attributes.friendly_name }} was left open"
title: "Something's still open"
###send alert for new version of HA###
#- alias: Update notifications
# intial_state: true
# trigger:
# - platform: state
# entity_id: updater.updater
# action:
# service: notify.simple
# data_template:
# title: 'New Home Assistant Release'
# message: "Home Assistant {{ states.updater.updater.state }} is now available."
####send notification if doors left open after Dark####
#- alias: Doors/windows open after Dark
# initial_state: true
# trigger:
# platform: state
# entity_id:
# - binary_sensor.garage_door
# - binary_sensor.front_door
# - binary_sensor.1st_floor_window
# - binary_sensor.basement_door
# - binary_sensor.basement_garage_door
# - binary_sensor.basement_windows
# - binary_sensor.breakfast_door
# - binary_sensor.sliding_glass_door
# - binary_sensor.sun_room_glass
# state: 'on'
# condition:
# condition: and
# conditions:
# - condition: state
# entity_id: sun.sun
# state: below_horizon
# - condition: state
# entity_id:
# - binary_sensor.garage_door
# - binary_sensor.front_door
# - binary_sensor.1st_floor_window
# - binary_sensor.basement_door
# - binary_sensor.basement_garage_door
# - binary_sensor.basement_windows
# - binary_sensor.breakfast_door
# - binary_sensor.sliding_glass_door
# - binary_sensor.sun_room_glass
# state: 'on'
# action:
# service: notify.simple
# data_template:
# message : " {{ trigger.from_state.attributes.friendly_name }} has been left Open after dark "
# title: "Don't forget to close doors"
the last two automations I am working on as well. but I have commented them out to try to troublshoot line 195