ESPHome Angry with my YAML After Update

Just did the latest update to ESPHome and it is now agry with my YAML code. I dont really understand the error message, and after several attempts at changing the YAML I am stuck.

Here’s the errors…

INFO ESPHome 2023.12.5
INFO Reading configuration /config/esphome/esp4-bdrmlights.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
  in "<unicode string>", line 75, column 5
did not find expected key
  in "<unicode string>", line 83, column 5

Line 75 is: - id: randomize_lights
Line 83 is: - id: rainbow_lights

Here’s the code in question…

script:
  - id: turn_off
    mode: restart
    then:
      - delay: 90s
      - light.turn_off:
          id: bdrm_led_lights
          transition_length: 7.5s
      - logger.log: "LED lights are OFF"

  - id: randomize_lights
    then:
      - light.turn_on:
          id: bdrm_led_lights
          brightness: 60%
          effect: random
      - logger.log: "LED lights are ON with random effect"

    - id: rainbow_lights
    then:
      - light.turn_on:
          id: bdrm_led_lights
          brightness: 60%
          effect: addressable_rainbow
      - logger.log: "LED lights are ON with rainbow effect"

Perhaps someone could highlight what I am missing, and point me in the right direction?

Very much appreciated.

Someone else had this issue and the suggestion was to delete the line completely and manually re-type it.

Unfortunately I don’t know if that fixed the issue. Let us know if it does.

Wow, that was interesting… so I did what you suggested, and when I went back into the ESPHome section of HA the particular esp unit was no longer highlighted as needing an update?

Just to be sure I did a Clean Build Files and Install, and so far it seems to be working… really unusual, but at least it is working. Thanks for the tip.

1 Like