Tracking down a configuration [script] error - SOLVED

Hi. I need a little help determining what’s causing this error.

Logger: homeassistant.config
Source: config.py:445
First occurred: 10:07:44 AM (1 occurrences)
Last logged: 10:07:44 AM

Invalid config for [script]: expected dict for dictionary value @ data[‘sequence’][1][‘data_template’]. Got None. (See /config/configuration.yaml, line 27).

The configuration.yaml, line 27 points to my automations file which has a lot of automations unfortunately. Is there anything, in particular I should be looking for? I can’t tell from the output. I’m not sure what ‘Got None’ is referring to.

Thanks in advance.

What is on line 26 and 28 of your configuration.yaml file?

Hi tom_I

26 group: !include groups.yaml
27 automation: !include automations.yaml
28 script: !include scripts.yaml

Go to your scripts.yaml → Comment out half of your script → Check Configuration → If valid → Repeat for the other half → Check until you find out which one.

OR (never tried it myself)

Paste your whole scripts.yaml inside configuration.yaml and check configuration. See if it points out which script has a problem.

See here for more information-

Checks your scripts in scripts.yaml, specifically a line containing data_template. It’s likely to be a template that is producing a null value (None) because it makes a faulty assumption about an entity’s availability.

And it will be the second action in the script sequence (the count starts at 0):

Great. Thank you. I’ll give it a go.

Good strategy ! I’ll work that way.

Very helpful. It was a script i had tested for spotify that I had forgotten about. Thank you !

Post the faulty template so everyone can see why it produced None.

This was the entry in my scripts.yaml that was giving me issues.

spotifygo:
  alias: 'Start go'
  sequence:
    - service: media_player.volume_set  #setting the volume is optional ofcourse
      data:
        entity_id: media_player.bedroom_speaker
        volume_level: 0.20
    - service: spotcast.start
      data_template:
        device_name: 'Bedroom speaker'
        media_content_id: "spotify:playlist:3FxSYNYfGxc0NINSxQ9x4t2Xd"
        media_content_type: playlist
        random_song: true