As of 0.117 you can now Cast plex to and google cast device.
I can make it work by entering details into the call service node.
Domain: media_player
Service: play_media
Data:
{
"entity_id": "media_player.chromecast",
"media_content_type": "movie",
"media_content_id": "plex://{\"library_name\": \"Calibration\", \"title\": \"Fireplace 3hrs-1\"}"
}
But I would like to use the the power of node red by creating payloads for the different parts of Data.
So for example I have a change node that sets…
msg.entity_id to… media_player.chromecast
msg.media_content_type to… movie
msg.media_content_id to … plex://{“library_name”: “Calibration”, “title”: “Fireplace 3hrs-1”}
Then in my call service node I have …
Domain: Media_player
Service: play_media
Data:
{
"entity_id": "{{entity_id}}",
"media_content_type": "{{media_content_type}}",
"media_content_id": "{{media_content_id}}"
}
But when trigger the flow it doesn’t work. If I enable the debug I can see it has changed the data.media_content_id to …
plex://{"library_name": "Calibration", "title": "Fireplace 3hrs-1"}
Any Ideas how to stop it changing the characters to text?
Here is some exsample node-red flows
[{"id":"d6e084eb.9f4328","type":"inject","z":"5e5759.72a178a8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":700,"y":480,"wires":[["32907b54.0940a4"]]},{"id":"eb499929.a70008","type":"api-call-service","z":"5e5759.72a178a8","name":"","server":"56e35aef.6eb604","version":1,"debugenabled":true,"service_domain":"media_player","service":"play_media","entityId":"","data":"{\"entity_id\":\"{{entity_id}}\",\"media_content_type\":\"{{media_content_type}}\",\"media_content_id\":\"{{media_content_id}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1210,"y":480,"wires":[[]]},{"id":"32907b54.0940a4","type":"change","z":"5e5759.72a178a8","name":"Set Cast media","rules":[{"t":"set","p":"msg.entity_id","pt":"msg","to":"media_player.chromecast","tot":"str"},{"t":"set","p":"msg.media_content_type","pt":"msg","to":"movie","tot":"str"},{"t":"set","p":"msg.media_content_id","pt":"msg","to":"plex://{\"library_name\": \"Calibration\", \"title\": \"Fireplace 3hrs-1\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":480,"wires":[["eb499929.a70008"]]},{"id":"b3a1065e.9e3e28","type":"api-call-service","z":"5e5759.72a178a8","name":"Cast Plex Fireplace on sony TV","server":"56e35aef.6eb604","version":1,"debugenabled":true,"service_domain":"media_player","service":"play_media","entityId":"","data":"{\"entity_id\":\"media_player.chromecast\",\"media_content_type\":\"movie\",\"media_content_id\":\"plex://{\\\"library_name\\\": \\\"Calibration\\\", \\\"title\\\": \\\"Fireplace 3hrs-1\\\"}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1210,"y":420,"wires":[[]]},{"id":"abb88c7b.0f3f2","type":"inject","z":"5e5759.72a178a8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":700,"y":420,"wires":[["b3a1065e.9e3e28"]]},{"id":"56e35aef.6eb604","type":"server","name":"Home Assistant (working)","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open"}]