Can't trigger media

Hi,

I’m trying to get my Node-Red together with Home-Assistant to play media on a Sonos.I’ve tried everything, but can’t get it to work. See the Node-Red export of the flow :

[{"id":"e9137fba.5ea59","type":"ha-time","z":"331ec620.c9584a","server":"9f6f4213.3787d","name":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityId":"sensor.lightalarm_time_start","property":"state","offset":0,"offsetType":"num","offsetUnits":"minutes","randomOffset":false,"repeatDaily":false,"payload":"$entity().state","payloadType":"jsonata","debugenabled":true,"x":500,"y":380,"wires":[["c672f9c5.1ea688","3d463fd2.31f9e"]]},{"id":"3d463fd2.31f9e","type":"api-call-service","z":"331ec620.c9584a","name":"","server":"9f6f4213.3787d","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.slaapkamer","data":"{\"volume_level\": 0.1}","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":960,"y":480,"wires":[["1edeae47.12b232"]]},{"id":"1edeae47.12b232","type":"api-call-service","z":"331ec620.c9584a","name":"","server":"9f6f4213.3787d","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.slaapkamer","data":"{\"media_content_id\":\"` [ `https://dennusb.nl/test.mp3\",\"media_content_type\":\"music\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1380,"y":480,"wires":[[]]},{"id":"179f9a7d.3d29e6","type":"inject","z":"331ec620.c9584a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":680,"wires":[["3d463fd2.31f9e"]]},{"id":"9f6f4213.3787d","type":"server","name":"Home` ](https://home-assistant.io/images/cast/splash.png%22,%22media_content_type%22:%22music%22%7D%22,%22dataType%22:%22json%22,%22mergecontext%22:%22%22,%22output_location%22:%22payload%22,%22output_location_type%22:%22msg%22,%22mustacheAltTags%22:false,%22x%22:1380,%22y%22:480,%22wires%22:[[]]%7D,%7B%22id%22:%22179f9a7d.3d29e6%22,%22type%22:%22inject%22,%22z%22:%22331ec620.c9584a%22,%22name%22:%22%22,%22props%22:[%7B%22p%22:%22payload%22%7D,%7B%22p%22:%22topic%22,%22vt%22:%22str%22%7D],%22repeat%22:%22%22,%22crontab%22:%22%22,%22once%22:false,%22onceDelay%22:0.1,%22topic%22:%22%22,%22payload%22:%22%22,%22payloadType%22:%22date%22,%22x%22:380,%22y%22:680,%22wires%22:[[%223d463fd2.31f9e%22]]%7D,%7B%22id%22:%229f6f4213.3787d%22,%22type%22:%22server%22,%22name%22:%22Home)  `Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false}]

Error i’m constantly getting is :

“Call-service API error. Error Message: extra keys not allowed @ data[‘media_content_id’]”

Does anyone here know what this is and how to fix it?

I have made some corrections in the flow. please try it. FYI i am not able to play the mp3 link in my setup. If the mp3 link is not dynamic in nature , it would be best you download it and give the local url. anyways try this.

[{"id":"179f9a7d.3d29e6","type":"inject","z":"51045e07.bbf87","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":1560,"wires":[["3d463fd2.31f9e"]]},{"id":"3d463fd2.31f9e","type":"api-call-service","z":"51045e07.bbf87","name":"","server":"9f6f4213.3787d","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.slaapkamer","data":"{\"entity_id\":\"media_player.slaapkamer\",\"volume_level\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":790,"y":1360,"wires":[["1edeae47.12b232"]]},{"id":"e9137fba.5ea59","type":"ha-time","z":"51045e07.bbf87","server":"9f6f4213.3787d","name":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityId":"sensor.lightalarm_time_start","property":"state","offset":0,"offsetType":"num","offsetUnits":"minutes","randomOffset":false,"repeatDaily":false,"payload":"$entity().state","payloadType":"jsonata","debugenabled":true,"x":330,"y":1260,"wires":[["3d463fd2.31f9e"]]},{"id":"1edeae47.12b232","type":"api-call-service","z":"51045e07.bbf87","name":"","server":"9f6f4213.3787d","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.slaapkamer","data":"{\"entity_id\":\"media_player.slaapkamer\",\"media_content_id\":\"https://dennusb.nl/test.mp3\",\"media_content_type\":\"music\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1210,"y":1360,"wires":[[]]},{"id":"9f6f4213.3787d","type":"server","name":"Home` ](https://home-assistant.io/images/cast/splash.png%22,%22media_content_type%22:%22music%22%7D%22,%22dataType%22:%22json%22,%22mergecontext%22:%22%22,%22output_location%22:%22payload%22,%22output_location_type%22:%22msg%22,%22mustacheAltTags%22:false,%22x%22:1380,%22y%22:480,%22wires%22:[[]]%7D,%7B%22id%22:%22179f9a7d.3d29e6%22,%22type%22:%22inject%22,%22z%22:%22331ec620.c9584a%22,%22name%22:%22%22,%22props%22:[%7B%22p%22:%22payload%22%7D,%7B%22p%22:%22topic%22,%22vt%22:%22str%22%7D],%22repeat%22:%22%22,%22crontab%22:%22%22,%22once%22:false,%22onceDelay%22:0.1,%22topic%22:%22%22,%22payload%22:%22%22,%22payloadType%22:%22date%22,%22x%22:380,%22y%22:680,%22wires%22:[[%223d463fd2.31f9e%22]]%7D,%7B%22id%22:%229f6f4213.3787d%22,%22type%22:%22server%22,%22name%22:%22Home)  `Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false}]