it will become very obvious but I am not a programmer and I don’t know yaml at all. I got my konnected and Home assistant installed this week. I also installed the HaaS alarm from the konnected instructions.
I am trying to make the piezo that’s in the addon board “out” zone beep and the siren that’s on the main board go off when a door is triggered in either away or home.
I got the beeping to work, but when I tried to add the siren part I keep getting yaml errors.
the first part used to work until I started on the second part.
#####alarm beep when door opened or closed####
alias: DoorChime
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:
- alias: ‘’
data:
entity_id: switch.Door_Chime
service: switch.turn_on
####sound alarm siren when armed home or away####
- alias: trigger alarm while armed home or away
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
alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch on
the error I am getting is:
Configuration invalid
Error loading /config/configuration.yaml: while parsing a block mapping
in “/config/automations.yaml”, line 2, column 1
expected , but found ‘’
in “/config/automations.yaml”, line 72, column 2
####sound alarm siren when armed home or away####
- alias: trigger alarm while armed home or away
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
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch.turn_on
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch.turn_on
#####alarm beep when door opened or closed####
alias: DoorChime
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:
- alias: ''
data:
entity_id: switch.Door_Chime
service: switch.turn_on
####sound alarm siren when armed home or away####
- alias: trigger alarm while armed home or away
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
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch.turn_on
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch.turn_on
sparkydave, that’s giving me this error:
Error loading /config/configuration.yaml: while parsing a block mapping in “/config/automations.yaml”, line 2, column 1 expected <block end>, but found ‘<block mapping start>’ in “/config/automations.yaml”, line 23, column 3
#####alarm beep when door opened or closed####
- alias: DoorChime
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
####sound alarm siren when armed home or away####
- alias: trigger alarm while armed home or away
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
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch.turn_on
- alias: Alarm Triggered
trigger:
- platform: state
entity_id: alarm_control_panel.house
to: 'triggered'
action:
entity_id: switch.siren
service: switch.turn_on
- alias needed to start at the first position on the line
trigger:
condition:
action: all needed to be in line with the 'a' from 'alias', so indented 2 spaces
any items under trigger, condition or action need to then be indented a further 2 spaces, however if you have more than 1 item (ie: a list of items) under any of those, you then put a ‘-’ first and then indent further.
eg:
trigger:
platform: state
entity_id: blah blah
trigger:
- platform: state
entity_id: blah blah
- platform: state
entity_id: blah blah
glad you got it working! You may want to alter the triggered action to include a delay and turn off the siren after that delay, otherwise the siren will continue until you disarm which could annoy the neighbours! Here in Australia we are only legally allowed to let a siren run for 5 mins.