I may the helicopter here, but I can’t start any of my Plex videos on any media platform. Please help, what do I do wrong.
So infrastucture:
Plex Media server on my local network 192.168.1.101:32400, reachable, castable, DNLA on.
LG webOS tc, with DNLA possibility, Plex app installed, reach local network
Chromecast Ultra on the local network
I can start the videos on any of the said infrastucture elements (DLNA, Plex App, Cast), but not with Home Assistant
My HA config:
Plex Media Server integration configured and working, I can see if anyone start a video.
Cast config working… at least I can see if somebody start a video on that.
DLNA not showing up in the integrations, so it’s not configured
Home Assistant Media browser is empty.
I tried the following automation:
alias: Play Plex
description: ''
trigger:
- platform: tag
tag_id: 2c502546-eb2d-4f96-9cbf-c8cd41d61d61
condition: []
action:
- service: media_player.play_media
data:
media_content_type: video
media_content_id: '"{"library_name": "Movies", "title": "Soul"}"'
target:
entity_id:
- media_player.lg_tv
- media_player.chromecast8176
mode: single
Nothing at all. I tried direct call with other content_id-s but none of them work.
Please-please help me, what I’m doing wrong? Best would be DLNA, but right now I even don’t care if I stream the movie all across the globe to get back to my TV
Thanks, I’ll review into that. Also, I need it in automation (a child will get RFID cards to set their videos), so main function I’ll search for that it should able to start the video
Thanks anyway, its a very good feature for the non-child members of the family
Hi JurajNyiri!
I’ve tried the plex protocol. Some documentation mentioned video, some movie, but none of them worked. Anyway, let’s try it to debug:
So new code:
alias: Play Plex
description: ''
trigger:
- platform: tag
tag_id: 2c502546-eb2d-4f96-9cbf-c8cd41d61d61
condition: []
action:
- service: media_player.play_media
data:
media_content_type: movie
media_content_id: 'plex://{"library_name": "Movies", "title": "Soul"}'
target:
entity_id:
- media_player.chromecast8176
mode: single
Result: nothing, even Cast not called. In the trace I found:
Call service media_player.play_media on entities media_player.chromecast8176
Stopped because an error was encountered at 14 October 2021, 16:12:53 (runtime: 0.20 seconds)
Plex media not found using payload: ‘{“library_name”: “Filmek”, “title”: “Soul”}’
Looks like it didn’t find the title “Soul” in “Filmek” library in Plex.
1.) I would recommend double checking all the names and titles (also look for spaces at the end! Your library might actually be "Filmek " by accident) but you have probably already done that.
2.) As a next step, make sure that plex integration is using the expected Plex server which includes that library and that movie.
Finally, as the last debugging step for syntax (and/or names) I would recommend to setup the plex card that was recommended by @reotto above. Its super easy and fast to setup via UI and will narrow down the issue further if still not known at this point. If it launches the movie correctly, your syntax is wrong. If it fails to launch the movie, something else is wrong.
Edit: Card has a failover mode, when when it fails to launch the movie through plex, it casts the physical file instead. You can differentiate which method it used by how the cast looks. If there is plex logo, metadata (like title, picture) etc it used plex cast. Please note this down if it did indeed launch the movie, that will narrow down the debugging a lot.
Thanks for helping further
Yeah, I double checked the library, also I copied even the UID of the film It seems as if the integration is broken, but also it’s working in other parts of HomeAssistant
I’ll try @reotto solution as soon as possible and come back with the results. Thank you!
I posted the solution above, but here is my use case for reference for everyone.
I setup a panel/view in HA for every bedroom in my house. The only real difference in each panel is it is set to that specific bedroom and the TV in that bedroom. I use the visible function, and only allow them to see in HA the view for that room which corresponds to the TV in that bedroom.
I have a tablet setup in each bedroom. They can walk up to the tablet and see all the movie art on that view, and when they click play on one of them it will turn on the TV and start playing that movie. I have grand kids, and they absolutely love it. Make it super simple for them to watch their movies-my wife doesn’t have to figure out the remote, navigate to Plex, find the movie, and then play it. They choose and it plays.
So I’ve set up the plex-meets-homeassistant component, and it absolutely worked fine. I’ve selected a cast device as the destination, and it read all the videos from the library, and started the video.
now, just one question: how to automatize it due it still doesn’t workm but it seems the plex integration is fine.
Best: Peter
Did it have all the metadata like picture, name, plex logo etc when it casted? Or did it just look like a usual video cast without any metadata? To be 100% sure, you can disable plex integration, restart hass and then cast through card, see if it looks different or same (this will force it to failover to video cast instead of plex cast).
See my comment above, without this info we do not know where is the error.
So all metadata (picture, name, logo, descirption) were all there.
I’ve disabled Plex integration and rebooted the whole host (once a mont ) ), all of the data stays there. Isn’t this addon gets another channel to Plex instead of the built in integration?
It also started the movie but I didn’t saw it in the Plex integration of Chromecast.
If played file had all the metadata like picture plex logo etc, it looks like your syntax in automation is wrong. It will probably be something with the name, title etc.
It uses the same service call as you are trying to use.
Go to /www/community/PlexMeetsHomeAssistant
Delete .gz and .map files
Open .js file
Look for this.playViaCastPlex = (entityName, contentType, mediaLink) => {
Upload this file back to home assistant (if not edited directly there)
Delete browser cache
Open home assistant page
Right click, Inspect (or developer tools etc, depends on browser)
Go to console
Go to the card, play some movie
You will see an object in console.log, this object contains parameters for your automation that will work, you will know it when you see it
Copy&paste stuff to your automation and it will work
If you do not see console.log:
Make sure you have cleared cache
Use incognito mode
Use another browser
If you see error instead that is coming from the card, it is not using plex integration and casting the file directly, make sure to configure your plex integration properly, restart, reload browser and try again from 7 above.
So now have some time to do this
I tried to do what you wrote, but step4 caused me some problem due may your code changed But do the relevant changes and changed some parameter, so I got on the console what I needed, so thaaaank youuu!!!
It seems the translation of library is needed and I changed it wrong. My library was wrong with this.
So: with your help I got the exact media content ID I needed. THANK YOU FOR THAT!!!