Script vs. Dev environment

Hello,

I have a strange issue with my home assistant. This works fine in the development environment:
Service: media_player.play_media
entity_id: media_player.symfonisk_tischleuchte
media_content_id: http://192.168.2.100:8080/xxx.mp3
media_content_type: music

The MP3 file is played on my Sonos speaker. But if I try the same with a script, I get the following error:
voluptuous.error.MultipleInvalid: extra keys not allowed @ data[‘media_content_id’]

What am I doing wrong?

Thanks for any help.
Fuezguel

You probably forgot the data: tag. The dev tool, everything in that box is put under the ‘data’ section.

- service: media_player.play_media
  data:
    entity_id: media_player.symfonisk_tischleuchte
    media_content_id: http://192.168.2.100:8080/xxx.mp3
    media_content_type: music
1 Like