Help, error in script but can't figure what's wrong!

So when I run ‘Check config’, I get the following error:

Invalid config for [script]: expected dict for dictionary value @ data['script']['1584676433232']['sequence'][7]['data']. Got None. (See /config/configuration.yaml, line 21).

And the error seems to point to this script:

'1584676433232':
  alias: Sunrise - CDN
  sequence:
  - data:
      brightness: 1
      rgb_color:
      - 98
      - 19
      - 0
    entity_id: light.lumiere_du_chevet
    service: light.turn_on
  - delay: 00:00:01
  - data:
      brightness: 103
      rgb_color:
      - 243
      - 123
      - 0
      transition: 400
    entity_id: light.lumiere_du_chevet
    service: light.turn_on
  - delay: 00:06:40
  - data:
      brightness: 255
      rgb_color:
      - 255
      - 178
      - 67
      transition: 800
    entity_id: light.lumiere_du_chevet
    service: light.turn_on
  - delay: 00:13:20
  - delay: 01:15:00
  - data:
    entity_id: light.lumiere_du_chevet
    service: light.turn_off

But I can’t figure out what I’m doing wrong! What does expected dict for dictionary value @ data['script']['1584676433232']['sequence'][7]['data']. Got None. stands for? Where in that code am I supposed to look for the error? I don’t get it!

Please help, thanks.

Found the error from good old divide and conquer. Error was I was missing ’ {}’ from last ‘data’ statement. How the heck was I supposed to get that from the cryptic error message ‘Check config’ gave me???

Each “step” in the sequence is numbered, starting from zero. Your script has 8 “steps” so that’s 0 to 7. The error message is complaining about the 7th one so that’s the last one.

All you needed to do was either remove the line containing data: or just indent entity_id: by two spaces.

Ok, makes sense now. Now I’ll be able to better troubleshoot the error, thank.

1 Like