That was very helpful and gets me a bit further in my search. I’m able to control episodes through the plex server integration and I cobbled together a way to get it to play a random episode, but it’s very hacky and a little slow due to having to emulate button presses.
Few things:
-
I noticed I need to turn on the TV first before it will pass to open the plex app
-
I’d like to just open the app and select the user, however I have to use the DPAD_CENTER command to select the user, and for whatever reason on the first pass of the DPAD_CENTER command the plex app “refreshes” and shows a splash screen for a second and then shows the user login screen again, so I had to add a second DPAD_CENTER command.
-
Like you said, I had to add the scan clients button and added a slight delay before starting an episode
Here’s what I created in node red
[{"id":"ec0b5a5e3fa0097d","type":"tab","label":"Launch Episode Example Flow","disabled":false,"info":"","env":[]},{"id":"5c3bb4a2b88906e8","type":"api-call-service","z":"ec0b5a5e3fa0097d","name":"Turn on TV","server":"2e31528c.f3973e","version":5,"debugenabled":false,"domain":"remote","service":"turn_on","areaId":[],"deviceId":[],"entityId":["remote.living_room_tv"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":270,"y":200,"wires":[["0d34a8f5ccda601c"]]},{"id":"4c737958f0e2614a","type":"inject","z":"ec0b5a5e3fa0097d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":200,"wires":[["5c3bb4a2b88906e8"]]},{"id":"15bc829bbb910da7","type":"api-call-service","z":"ec0b5a5e3fa0097d","name":"Start Plex","server":"2e31528c.f3973e","version":5,"debugenabled":false,"domain":"remote","service":"turn_on","areaId":[],"deviceId":[],"entityId":["remote.living_room_tv"],"data":"{\"activity\":\"plex://\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":200,"wires":[["bd72840e18dd0362"]]},{"id":"0d34a8f5ccda601c","type":"delay","z":"ec0b5a5e3fa0097d","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":500,"y":200,"wires":[["15bc829bbb910da7"]]},{"id":"bd72840e18dd0362","type":"delay","z":"ec0b5a5e3fa0097d","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":820,"y":200,"wires":[["7fce9c44b2987647"]]},{"id":"e183f2267d9c20a8","type":"api-call-service","z":"ec0b5a5e3fa0097d","name":"Play Bluey","server":"2e31528c.f3973e","version":5,"debugenabled":false,"domain":"media_player","service":"play_media","areaId":[],"deviceId":[],"entityId":["media_player.plex_annabel_plex_for_android_tv_chromecast_google_tv"],"data":"{\t \"media_content_type\": \"EPISODE\",\t \"media_content_id\": \"{\\\"library_name\\\": \\\"TV Shows\\\", \\\"show_name\\\": \\\"Bluey (2018)\\\", \\\"shuffle\\\": \\\"1\\\",\\\"maxresults\\\": 1 }\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":590,"y":540,"wires":[["fcbdfa329a6008f6"]]},{"id":"fcbdfa329a6008f6","type":"debug","z":"ec0b5a5e3fa0097d","name":"debug 72","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":540,"wires":[]},{"id":"7fce9c44b2987647","type":"api-call-service","z":"ec0b5a5e3fa0097d","name":"DPAD_CENTER","server":"2e31528c.f3973e","version":5,"debugenabled":false,"domain":"remote","service":"send_command","areaId":[],"deviceId":[],"entityId":["remote.living_room_tv"],"data":"{\"command\":\"DPAD_CENTER\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":200,"wires":[["d2982d3625c67355"]]},{"id":"d2982d3625c67355","type":"delay","z":"ec0b5a5e3fa0097d","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1180,"y":200,"wires":[["09af96fb3a23b84f"]]},{"id":"09af96fb3a23b84f","type":"api-call-service","z":"ec0b5a5e3fa0097d","name":"DPAD_CENTER","server":"2e31528c.f3973e","version":5,"debugenabled":false,"domain":"remote","service":"send_command","areaId":[],"deviceId":[],"entityId":["remote.living_room_tv"],"data":"{\"command\":\"DPAD_CENTER\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":200,"wires":[["5168dc643dad0d87"]]},{"id":"5168dc643dad0d87","type":"delay","z":"ec0b5a5e3fa0097d","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":980,"y":360,"wires":[["64e4ba354fcda058"]]},{"id":"64e4ba354fcda058","type":"api-call-service","z":"ec0b5a5e3fa0097d","name":"Scan for Plex Clients","server":"2e31528c.f3973e","version":5,"debugenabled":false,"domain":"button","service":"press","areaId":[],"deviceId":[],"entityId":["button.scan_clients_octoplex"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":360,"wires":[["12efaea9f8c550f0"]]},{"id":"12efaea9f8c550f0","type":"delay","z":"ec0b5a5e3fa0097d","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1400,"y":360,"wires":[["e183f2267d9c20a8"]]},{"id":"2e31528c.f3973e","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]