Extra keys not allowed.. where!

Extra keys not allowed@ data['sequence'][0]['tv_channel_barnkanalen']

I’m sorry but this doesn’t tell me anything.
I copied this code from this post Conditions and delay in script to change TV Channels

### Changing TV channels
tv_channel_barnkanalen:
#  alias: Barnkanalen
  sequence:
    - service: script.turn_tv_on
    - delay: 2
    - wait_template: "{{ is_state('script.turn_tv_on', 'off') }}"
    - service: media_player.play_media
      data:
            entity: media_player.samsung_ue50es6715
            media_content_id: 149
            media_content_type: "channel"
turn_tv_on:
#  alias: Turn TV on
  sequence:
    - condition: template
      value_template: "{{is_state('media_player.samsung_ue50es6715', 'off') }}"
    - service: media_player.turn_on
      entity_id: media_player.samsung_ue50es6715
    # Make this delay whatever is necessary to give the TV time to turn on.
    - delay: 5

I’ve tried commenting out everything in the tv_channel_barnkanalen section but it still says the same thing. The error messages for HA are truly unhelpful at times.
I’d wish that HA told me the row where the error occurs at least.

look like the error is somewhere here

  sequence:
    - service: script.turn_tv_on
    - delay: 2
    - wait_template: "{{ is_state('script.turn_tv_on', 'off') }}"
    - service: media_player.play_media
      data:
            entity: media_player.samsung_ue50es6715
            media_content_id: 149
            media_content_type: "channel"

My understanding
is

service: script.turnon

then we need tell it what script

entity_id: script.turn_tv_on

and tho other

-

have me stump

1 Like

Check the spaces after the data line
Yaml is very space sensitive

YAML is a piece of shit… …
I’ve run it through Prettify YAML but that doesn’t change anything.

The one thing I need to know, what extra key! is missing from the error message.

Ok, the solution…

This was TWO scripts, but I pasted them into one in the editor… Give me a better error message please!

Creating a fake script that turned on a light and then pasting the code into scripts.yaml fixed everything…