In the webostv component docs, it mentioned pylgtv, so I went looking there and seems like this is definitely possible, so I tried out the following successfully
from pylgtv import WebOsClient
client = WebOsClient('1.2.3.4')
apps = client.get_apps() # At this point your TV will prompt you to authorized pairing app
youtube_app = [ app for app in apps if app['title'] == 'YouTube' ][0]
youtube_id = youtube_app['id'] # Mine returned "youtube.leanback.v4"
client.launch_app_with_content_id("youtube.leanback.v4", "dQw4w9WgXcQ") # It works!
The tricky part was determining the youtube id, which was “youtube.leanback.v4”. I imagine it will only change with a major youtube app update.
That’s good news!
However to be honest I didn’t understand how you extract the id: "youtube.leanback.v4" i(s it python script?) neither the second part of how to use the service: webostv.command
When you find some time please explain a bit
Certainly. First I was using the “Developer Tools > Services” in the home-assistant UI trying to invoke the possible services. I noticed that there were several services that started with webostv.* specifically the webostv.command and the documentation that was associated with it referred to a external python project called pylgtv. I installed pylgtv on my local machine and was playing around, calling get_apps returned a list of all the apps (and for each app there was a title, id, etc). I saw a function there called launch_app_with_content_id and I fed it app='youtube.leanback.v4', contentId='dQw4w9WgXcQ'. Looking at the function, it was also using EP_LAUNCH = "system.launcher/launch"
Given this info, I tried to see how I can feed it in to home-assistant’s webostv service. Noticed the last commit which was by @PotatoDrug which enabled passing the command + payload (and I took a guess that payload is where I would cram id/contentId)
Thanks for the details. I hope that it will be doable with the 0.111 release. When you know how we can call to play a particular playlist from youtube please leave here an example.
I am also wondering if with this way we could call a particular movie from Netflix for example. I think it could.
Hello,
thank for the messge. not yet. i had to postpone this, because i had other major issues. but i will get back to this , this week! and will let you know for sure. but the delay of 20 seconds didnt work.
Do u include the whole url or just the letter&numbers sequence at the end?
For some reason if i use just the latter youtube app launches but no video starts. If i use the whole url it opens the app and loads the video as a small window in the middle of a white screen.
To get it open normally i have to edit the url and replace the “watch” part with “tv” and only then it asks me if i am sure i want to play it…
It worked! the problem is in the yaml code actually when i done the code with your specifications, for some reason on the call action button enter it didnt recognize the media player. so i had to manually ad again the media player
on the picture i had to add again the media player there. because i didnt show