Can someone help me out with a yaml issue?

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

Any ideas???

lovely, I can’t even figure out how to get all the code to show up in the code formatting…

Perhaps try aligning trigger with alias so they are equally indented

action needs to indented the same as trigger

Try this:

####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

argykaraz, I tried copying yours into mine and now getting another error:

Invalid config for [automation]: [trigger] is an invalid option for [automation]. Check: automation->action->1->trigger

I still can’t figure out how to copy it in here and make it look nice so I put it on github. maybe that will make it easier to look at?

#####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

sorry, my bad…

#####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

hopefully I caught everything this time…

Dave! thanks! that got it to pass the config test.

for educational purposed can you tell me what I did? shortly I am going to test the siren to make sure it goes off to. it’s the switch.siren

I have tested it and it definitely turns the siren on!!!

however I can’t get it to turn off with out unplugging it. so there is that… argh.

it was all indentation:

- 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

I hope that helps

you need to create an automation for when the alarm is changed to ‘disarmed’ which then turns off the siren

eg:

- alias: Alarm Disarmed
  trigger: 
    - platform: state
      entity_id: alarm_control_panel.house
      to: 'disarmed'
  action: 
    entity_id: switch.siren
    service: switch.turn_off

Dave, I really appriciate the help. been working on this since wednesday and you got more accomplished in 15 min then I did for 4 days…

I just checked the alard disarmed automation and it worked too!

8:16 PM[Siren]turned off

8:16 PM[Alarm Disarmed] has been triggered

8:16 PM[House]changed to disarmed

8:15 PM[Alarm Triggered]has been triggered

8:15 PM[Alarm Triggered] has been triggered

8:15 PM[House]changed to triggered

8:15 PM[House] changed to warning

8:15 PM[trigger alarm while armed home or away]has been triggered

8:15 PM[DoorChime]has been triggered

8:15 PM[Garage Door] turned on

8:15 PM[House] changed to armed_away

8:14 PM[Alarm Triggered] turned off

8:14 PM[DoorChime] turned off

8:14 PM[trigger alarm while armed home or away}turned off

8:14 PM[Alarm Triggered]turned off

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.

If you wanted to do this:

- alias: Alarm Triggered
  trigger: 
    - platform: state
      entity_id: alarm_control_panel.house
      to: 'triggered'
  action: 
    - service: switch.turn_on
      entity_id: switch.siren
    - delay: '00:05:00'
    - service: switch.turn_off
      entity_id: switch.siren

That’s awesome!