-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening Youtube URL feature not working #145
Comments
Do you have errors in the log? Can you please attach diagnostic info? |
I only got one error. Here is the diagnostic info
|
I don't see diagnostic file attached here. |
Sorry, it took me some time to figure out how to get the file. Finally, I managed to download it. Here is the diagnostics file: |
Please generate diagnostic file when TV is turned on. |
Here you go. This diagnostic info has been collected after I turned on the television. |
You need to configure an app to launch YouTube in |
You see, but is properly configured? If you select the app from the list, is launched on the TV? |
Yes, I tried with YouTube and Spotify and both of them seem to work. Netflix and PrimeVideo are not working. |
Hard to find the issue in this case. Please enable debug log for integration, try to use the feature and than attach log file to this thread. |
I'm having the same issue with my Samsung UN65TU7000FXZA. HA version 2022.4.5, SamsungTV Smart v0.6.3. Calling the service in Developer Mode in HA doesn't throw an error, but does nothing on my TV. Diagnostic file below: config_entry-samsungtv_smart-f1068c8a40015fdd261c744428cbc23d.json (2).txt Using the following to call the service:
Below is a relevant snippet of the debug logs. To test, I switched to the Netflix app with a remote, then called the service for the URL, which did nothing. I then called the YouTube app itself, which worked as expected. Looks like the following line is the culprit here: |
Can confirm, using a Samsung QN55Q60AAGXZS, HA version 2022.6.6, SamsungTV Smart 0.7.2. TV is not opening the YouTube video sent as url media type. Using the service calling:
I get the following messages in the log:
There seem to be multiple things happening here. A 500 error in the UPNP control, not detecting the URL as a YouTube video and also not opening the browser with the URL. It seems that it also doesn't detect the browser as an app because I al so get this debug message when listing the apps:
Although when opening the browser it is detected as |
I had the same issue. Looked for the error message Youtube video ID not found in the code and found this block: if b"v" not in url_query:
_LOGGER.debug("Youtube video ID not found")
return None
video_id = str(url_query[b"v"][0]) Changed the part I thought it was that the value types functions changed in Python recently. I'm running Home Assistant on this Python version:
According to the documentation it has been Anyways, @ollo69, I'd advise changing this in Also I think this relates to #127 |
Still, this feature is not working. Anyone has any update on this ? |
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Still after so many revisions, I cannot get this feature to work on my Samsung Frame 2021 |
This worked nicely for solving the problem with not identifying the url as Youtube url nor obtaining video ID. However, after solving this, nothing happens, the app is not launched:
Youtube is correctly configured, as I can launch youtube app in the TV from the integration. However, "run app" with youtube link does nothing in the TV. The Internal Server Error with upnp still remains |
Same thing. I fixed the Youtube video ID not found but Internal server error is still present |
I fixed in last release the query string parsing as suggested in this thread. Unfortunately if TV do not react properly to the launch request with app_type: DEEP_LINK and meta_tag: <video_id> I don't know how to fix this. With my TV this command is working properly. |
With the last release YouTube app opens on QN90B, but it stops at the home screen and won't open the video from the url |
I still have the same issue. Youtube app opens correctly when selecting from app_list, but it is impossible to launch any video. However, I have found this doc about a youtube api used to control youtube on TV from an external device, which could be used to cast a video from HA. And it is a youtube API, not related to samsung, so I think it will work better on any TV with a youtube app. This is the link, in case @ollo69 wants to take a look. Maybe it could be implemented in the integration as a new feature |
Thanks @fherreror, looks like a full protocol to implement. I'll do some tests on next days and will give you a feedback. |
@ollo69 I have also found this implementation of the protocol, though written in Go. It may be useful: https://github.com/MarcoLucidi01/ytcast I have been testing the protocol. It returns a XML response, in which it includes With this screenID (that I think is the same always), you have to retrieve the Lounge token (lounge seems to be the youtube concept for Room, linking screens with "remotes", remotes being the devices connected to control Youtube). This throws a XML answer with the lounge token. This token expires, so you have to refresh it from time to time. Then you have to create the connection to the screen, get events on what is playing on youtube, etc. Then you can send commands to control YT. They are listed in the annex of the wiki I linked before. Finally you have to disconnect from the TV using the other command. This is what I have been able to discover until now. However I think that the implementation in the link in this post is well defined. |
I found this other implementation in python, much simpler than the previous one: In this one, you only need the screenId that you can obtain as described in my previous post (and I can confirm that screenId is mantained along time, as it is the same now than some hours ago, and I have turn off TV many times). |
Thanks again, I will start some test this w.e. |
Added doc for casting videos to Youtube, as described here: ollo69#145 (comment)
This is already implemented, and it works on my TV. Are you able to open the YouTube app from integration or you use the TV remote for this? Did you configure YouTube app in apps list? PS. Thanks for PR, I will review this w.e. |
You are right. It works. |
More info about the problem:
I think integration does not update info when change to Live TV, only when changing to app |
Yes, it is because app still running in background. Probably if you exit from the app instead of just switching the source, information are updated. I will make some more analysis this weekend to see if I can better determinate open (and not running) app. |
I've made some more tests. |
* Update README.md Added doc for casting videos to Youtube, as described here: #145 (comment) --------- Co-authored-by: ollo69 <[email protected]>
this problem is more generic and related to wrong information that SmartThings do not update. |
Thanks for all.
So, as you see, integration gets that TV is on Live TV and even chanel name. However, in entity status, I get this:
Some versions ago, it worked with no problem. It used to take some seconds to update, but it updated at the end. Now, it does not update. I am going to see If I can get some more info on what the problem may be, but I am not sure where the code updates the entity state. |
Nothing changed integration side about app detection from many version. What probably is changed is SmartThings that do not refresh anymore the information. |
Hi:
Debug is enabled. In my previous post I included what debug was showing, which reflected all the info. I have installed development environment, and I think I have found the problem (though I am not sure how to fix it). When I change to TV Live, the self object updates with source TV/HDMI. Then, _get_running_app is called, and this is where TV/HDMI is overwritten. This method detects that there is an app running and so, it overwrites running app. Anyway, before calling _get_running_app, the selg object has the correct info TV/HDMI, and is _get_running_up the method that overwrites it. |
You should provide some more logs because status of the apps are returned by the ws channel when the status of running app changes. Of course, if your TV do not update this information this is the issue. |
These are the logs. In this logs, I changed first from TV to Netflix and then again to TV. TV changed source ok, integration did not.
What I don't understand is why logs show that integration knows that current source is dtv and even channel name, but entity does not "refresh" with this info. |
More logs:
As soon as I Change from app to TV Live, the debug logs show the change with almost no delay. ¿Is this coming from TV or from SmartThings? BTW, in my previous post, when I mentioned |
For what I can see seems that information returned by ws channel are very limited. Give me some more time to analyze this situation (btw totally different from information returned by my TV), it could be that require a different management, I was assuming that the problem was in SmartThings, but probably is in limited information from ws.
yes, this was clear to me |
Ok Thanks. If you need me to make any additional test or to get any additional data, just tell me. |
Can you check if changing the source from TV remote provide different output in the log compared to changing source from HA? I saw in #224 some different behavior in ws response but I do not understand the reason. |
ok. Yes, it is showing different behaviour.
As you can see, app_id changes to Netflix, but source remains in TV/HDMI.
Here go the debug logs changing app with TV remote and the diagnostics file: |
please install last beta release v0.11.4b1 and let me know if it fix the issue. I expect that now running app come only from SmartThings, could be a little bit more slower but should work. |
@ollo69 now it works.
|
Strange also this. The only reason is that netflix(in this case) is excluded from running app, but this can happen only if message from web socket was received, message that I don't see in your previous logs. |
Here it goes. As I see, in WS input source remains always the same when an app is launched (as it is not changed, actually), and what is changed is channelName. If channelName in app_list --> there is an app running --> set source = app(channel_name) and set app_id=app_id(channel_name) Anyway, at this moment, the only thing not working in my case is that when I change to any app, Source in atributes is not changed and media info is not updated. |
I think that I found the issue. This was something introduced in v0.10.0! Because my TV returns spontaneously list of running apps on every changes, in code review I forgot to call a specific method to query app status on interval. Unfortunately not all model works in the same ways. Please try last release and let me know if it works or still there are issue. |
Yes!! Now it works!! Than you so much for all the effort!! |
Thank you @ollo69 This is amazing. I can now open YouTube links in The Frame TV 2021. |
I close this, feature now is working. Thanks everybody for support and suggestion, open a new issue if you found some new related problems. |
Describe the bug
![image](https://user-images.githubusercontent.com/47345141/159244006-6f8fcc50-54aa-4c71-96bd-69fcb4bf5765.png)
Cannot cast youtube URLs as mentioned in the 4th point of release notes.
I used the below config. Let me know in case any modification is required.
![image](https://user-images.githubusercontent.com/47345141/159244419-a5607e09-81d7-4726-a0d7-b00e4f08ed8d.png)
Expected behavior
Open youtube URL
Screenshots
If applicable, add screenshots to help explain your problem.
Environment details:
Output of HA logs
Paste the relavant output of the HA log here.
Additional context
N/A
The text was updated successfully, but these errors were encountered: