First automation from doc ha doen't work

I’m using the YAML code below for my first automation. I copied and pasted this code from the Home Assistant documentation and adapted it to my context (entity…) but it doesn’t work. Any ideas?"


  • alias: Front Light Schedule
    • platform: calendar
      event: start
      entity_id: calendar.calendar_home
    • platform: calendar
      event: end
      entity_id: calendar.calendar_home
    • condition: template
      value_template: “{{ ‘Front Lights’ in trigger.calendar_event.summary }}”
    • if:
      • “{{ trigger.event == ‘start’ }}”
      • service: switch.turn_on
        entity_id: switch.lave_linge_switch
      • service: switch.turn_off
        entity_id: switch.lave_linge_switch

Nobody can tell what is wrong.

1 Like

It’s Not trigger.event

but please check what @francisp posted. if it was any complex or if it was an indent issue it’s neigh impossible to find unless you post code properly

Oh… also I think you need:

service: switch.turn_off
  entity_id: switch.lave_linga_switch

This makes me wonder… Are you using the UI to do these scripts? You should either be using the UI to build them or at least to check them. It would have helped you on both of these issues