Yet another invalid automations.yaml

Sorry guys and gals. I don’t understand how to work .yaml.
When to put “-”, when to not, and everything else. The more examples I see, the less I see the pattern. I can’t make sense of it.

Here’s me trying to get a flic to turn off all lights:

- alias: Turn off lights with 1 click of bed-flic
  hide_entity: False
  initial_state: 'off'
  condition: []
  id: '1511005477515'
  trigger:
platform: event
event_type: flic_click
event_data:
  button_name: flic_80e4daXXXXXX
  click_type: single
  action:
- service: light.turn_off
  entity_id: group.all_lights

What am I doing wrong?

I reckon some of it really is just repeated exposure, and looking at examples. It took me longer than I’m willing to admit.

Here’s one of mine that works from my automations.yaml

It also uses the additional ‘id’ tag, so automations can be edited via Hass in-browser.

- id: digiamp_start_lights_down
  alias: "If Kodi Playing After Sunset Dim Lights"
  trigger:
    platform: state
    entity_id: media_player.amp_kodi
    from: 'idle'
    to: 'playing'
  condition:
      - condition: state
        entity_id: sun.sun
        state: 'below_horizon'
  action:
    service: script.turn_on
    entity_id: script.video_light_setting

Apologies if I’m adding another layer with the id tag, I’ve had automations completely fail on me due to indentation etc.

The above is what I can absolutely vouch for, although I don’t edit my automations in-browser anyway :slight_smile:

Without seeing the error message I don’t know for certain, but the formatting should look like this…

- alias: Turn off lights with 1 click of bed-flic
  hide_entity: False
  initial_state: 'off'
  id: '1511005477515'
  trigger:
    platform: event
    event_type: flic_click
    event_data:
      button_name: flic_80e4daXXXXXX
      click_type: single
  action:
    service: light.turn_off
    entity_id: group.all_lights

Thanks, I think it went wrong when pasting, formatting looks like this.

Here is the log: https://pastebin.com/mFFwPsMR

It’s not your flic_click automation that is failing, it’s the update notifier. Please post that automation in a formatted box.

Edit - in fact, I think I’ve worked it out, in your update notifications automation the line starting with message: needs a further two spaces indentation.