Check my yaml file?

Blockquote

Could someone please check the syntax of my scripts.yaml file? I’m getting a

mapping values are not allowed here
in “/config/scripts.yaml”, line 5, column 19

Error, I’m pretty sure the spacing is wrong but not sure where. I’m trying to invoke a script to change the TV channel using a broad link.

Blockquote
turnonkodi:
alias: ‘Kodi’
sequence:
-service: switch.turn-on
data_template:
entity_id: switch.input_on

turnonkodi:
alias: ‘Kodi’
sequence:
-service: switch.turn-on
data_template:
entity_id: switch.input_on

Check your spacing to match https://home-assistant.io/components/script/

and switch.turn-on should be switch.turn_on. Underscore, not hyphen.

you also don’t need to use data template, just data. You are not passing template information here.

Sorry, I was trying to work out how to cut and paste and keep the formatting.

Good spot on the underscore. Ive now got

turnonkodi:
alias: ‘Kodi’
sequence:
-service: switch.turn_on
data:
entity_id: switch.input_on

The first line it has a problem with is data, how many indents does it need?

Thanks

data should have the same indentation as service. Note that it should line up with the S not the hyphen.

Entity ID should be indented two spaces from data.

Please read the blue box on top of this page and post your config in code blocks.
Then we will see. :slight_smile:

Cheers guys. The problem was no space after the - and before service. It now boots without crashing hassio.

It doesn’t do what I want though but I’ll start another thread for that