Automation failed in Automation & Szene

Hello community,

I tried to create a new automation, which is also my first one, but every time I try to save it, I get the following message:

here are my Yaml config:

  • automation: include automations.yaml

    id: 8679d5d9412849958c35d5496ad6c37d

  • ID: ‘1739188797734’
    alias: Vorhaus Eingang Bewegungsmelder ausschalten
    triggers:

    • platform: state
      entity_id: light.sdomoticabticino8
      from: ‘off’
      to: ‘on’
      for:
      hours: 0
      minutes: 0
      seconds: 10
      conditions:
      actions:
    • service: light.turn_off
      target:
      entity_id: light.sdomoticabticino8
      mode: single
      id: 14dd2208bda742ff9ae9567be535f87d
  • ID: ‘1739189174140’
    alias: Neue Automation
    triggers:

    • platform: device
      device_id: 133b4f2c3549c7499c39036fbc619f40
      domain: media_player
      entity_id: media_player.c2653e13ec752ca57d93b3abee770af4
      type: turned_on
      conditions:
      actions:
    • service: cover.close_cover
      target:
      entity_id: cover.sdomoticabticino38
      mode: single

Please help me. I appreciate any assistance in advance.

  1. Mark up your code as code. Otherwise it is more or less unreadable as indentation etc. will be completely broken.

  2. The official language of the forum is English. Screenshots with error messages in what I assume to be German will lead to very limited responses.

Hey Mayhem_SWE :slight_smile:

  1. I do not know how to make the code confirm, but does this screenshot work?
automation: !include automations.yaml

- id: '1739188797734'
  alias: 'Vorhaus Eingang Bewegungsmelder ausschalten'
  triggers:
    - platform: state
      entity_id: light.sdomoticabticino8
      from: 'off'
      to: 'on'
      for:
        hours: 0
        minutes: 0
        seconds: 10
  conditions: []
  actions:
    - service: light.turn_off
      target:
        entity_id: light.sdomoticabticino8
  mode: single

- id: '1739189174140'
  alias: 'Neue Automation'
  triggers:
    - platform: device
      device_id: '133b4f2c3549c7499c39036fbc619f40'
      domain: media_player
      entity_id: media_player.c2653e13ec752ca57d93b3abee770af4
      type: turned_on
  conditions: []
  actions:
    - service: cover.close_cover
      target:
        entity_id: cover.sdomoticabticino38
  mode: single

- id: '1739193255571'
  alias: 'Neue Automation'
  description: ''
  triggers:
    - platform: device
      device_id: '133b4f2c3549c7499c39036fbc619f40'
      domain: media_player
      entity_id: media_player.c2653e13ec752ca57d93b3abee770af4
      type: turned_on
      for:
        hours: 0
        minutes: 0
        seconds: 1
  conditions: []
  actions:
    - service: cover.close_cover
      target:
        entity_id: cover.sdomoticabticino38
  mode: single
  1. That’s the error code I get, in English:
    Home Assistant: New automation has been saved, but waiting for setup has timed out. This may be due to errors in parsing your configuration.yaml file. Please check the configuration in the Developer Tools. Your automation will not appear until this is corrected, and the automations are reloaded. Changes to the area, category, or labels were not saved and need to be reapplied.

Ahh. That seems to be an issue with HASS since the first releases this year. Was supposed to have been fixed in 2025.2 but there are still people running into this same error. No idea what the solution is unfortunately, but it probably has nothing to do with your automation itself. If anything it may be some integration you are using which is too slow to update.

Do check whether your configuration.yaml file includes the line automation: !include automations.yaml as this can also cause this problem.

There is a button </> in the forum post editor toolbar to mark up code. Pretty please never post screenshots of code.

Thank you so much, for your help!!
I tried to put - automation: include automations.yaml in the configuration.yaml, but it doesn’t work.

So is there a possibility to downgrade the home assistant?
Core: 2025.2.1
Supervisor: 2025.02.0
Operating System: 14.02

Was it not there already? If it wasn’t, it should be included at the root of the configuration, and should not have a dash in front as you’ve written it.

It is possible, but really shouldn’t be needed. Perhaps someone else will have other ideas before you go that far.

I got an Update today to 2025.2.2, but nothing changes, same message appears. :confused:

To reiterate what Mayhem advised, you do have the following at the top of you configuration.yaml, correct?

default_config:
frontend:
  themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Now it works, thanks to Mayhem_SWE and LiQuid_cOOled.
I understand root would be the end of the config not the top.
So I put it on the top and it works :slight_smile:

1 Like

Not quite, by “root” at least I mean “with no indentation”. YAML is a positional language – the indentation matters as it is a part of the syntax.