Message malformed: extra keys not allowed @ data['script']

I am following Mark Watt Tech’s guide on creating Alexa Actionable Notifications. I am at the stage where I post the Github script on Home Assistant but I am getting the error: “Message malformed: extra keys not allowed @ data[‘script’]”

What am I doing wrong? Here’s the script:

script:
  activate_alexa_actionable_notification:
    description: 'Activates an actionable notification on a specific echo device'
    fields:
      text:
        description: 'The text you would like alexa to speak.'
        example: 'What would you like the thermostat set to?'
      event_id:
        description: 'Correlation ID for event responses'
        example: 'ask_for_temperature'
      alexa_device: 
        description: 'Alexa device you want to trigger'
        example: 'media_player.bedroom_echo'
    sequence:
      - service: input_text.set_value
        data:
          entity_id: input_text.alexa_actionable_notification
          value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
      - service: media_player.play_media
        data:
          entity_id: "{{ alexa_device }}"
          media_content_type: skill
          media_content_id: amzn1.ask.skill.3c5se72-47b2-430-a43-d134543949a

If you store scripts in a dedicated file and include it by script: !include scripts.yml, the you need to discard the script: top-level element in that included file.

So it starts with:


activate_alexa_actionable_notification:
  description: 'Activates an actionable notification on a specific echo device'
  fields:

Thanks. That fixed it!

1 Like