ollo69 / ha-samsungtv-smart

đź“ş Home Assistant SamsungTV Smart Component with simplified SmartThings API Support configurable from User Interface.
Apache License 2.0
405 stars 58 forks source link

Continuous Authorization Request on TV Screen with Samsung The Frame TV (2022 model) #260

Closed StefanoGiu closed 3 months ago

StefanoGiu commented 11 months ago

Describe the bug The integration keeps on sending authorization requests to both the TV I have (Samsung the Frame 85 and 65, model 2022)

Expected behavior Connectivity should be stable

Environment details:

Output of HA logs 2023-07-07 11:13:11.918 WARNING (MainThread) [homeassistant.components.samsungtv] Unexpected ConnectionFailure trying to get remote for 192.168.1.40, please report this issue: ConnectionFailure({'event': 'ms.channel.timeOut'})

Additional context The TV is connected to the NW switch via ethernet cable and has a stable connection.

ollo69 commented 11 months ago

Continuously receive this kind issue. Honestly there are nothing that I can do, this is handled by the TV and not by integration. I can only provide some suggestion:

1) remove all Samsung TV integrations from HA (not only disable, please remove / uninstall / delete) 2) Be sure that native integration is disabled / ignored (of course you cannot remove that one) 3) Clear all existing external devices authorized on the TV 4) Be sure that TV is configured to "ask only once" for authorization 5) Cold boot the TV (unplug power supply for at least 1 minute) 6) Reconfigure the integration in HA

If this not solve, I have not idea on what can be the issue, but in 99% will fix the problem.

StefanoGiu commented 11 months ago

I already tried that before, still not working.

ronyn77 commented 9 months ago

I'm encountering the same issue with my QE77S95C, which happens to be the latest model of 2023. However, this problem doesn't occur with other connected devices, such as my iPhone. The permission was only requested once.

StefanoGiu commented 9 months ago

How to fix this? It's very annoying to have a continuous popup on the TV screeen...

ronyn77 commented 9 months ago

The solution proposed by Ollo69 appears to have resolved all of my related issues, not just the popups that were occurring upon every restart of Home Assistant. Additionally, I deleted the SmartThings integration in HA. To ensure thoroughness, I also reinitialized the SmartThings API key by first deleting the previous one and then granting access only to the items specified in the guides. Previously, I had granted access to all items. Another step I took was to navigate to the network settings on the TV: Settings -> Network -> Expert Settings, and I enabled "IP Remote." These actions, collectively, seem to have resolved all of my problems.

ronyn77 commented 9 months ago

The solution proposed by Ollo69 appears to have resolved all of my related issues, not just the popups that were occurring upon every restart of Home Assistant. Additionally, I deleted the SmartThings integration in HA. To ensure thoroughness, I also reinitialized the SmartThings API key by first deleting the previous one and then granting access only to the items specified in the guides. Previously, I had granted access to all items. Another step I took was to navigate to the network settings on the TV: Settings -> Network -> Expert Settings, and I enabled "IP Remote." These actions, collectively, seem to have resolved all of my problems.

Unfortunately, after writing that post, I discovered that it's not entirely true in my case. One issue remains unresolved: I placed the mediaplayer entity of the TV on the dashboard. However, even if the TV is on, after a certain period—though it varies, maybe a couple of minutes—the entity status changes to "off." To get it working again, I have to use the TV's remote to turn it off. When I turn it back on using the remote, the mediaplayer entity goes online again. But this only lasts for a while before the same issue occurs again. While the entity shows that it's online, everything works fine. But once it shows as "off" on the dashboard, nothing works anymore. This means I can only press the power button on the media player entity, which, of course, doesn't work.

github-actions[bot] commented 8 months ago

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.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 7 days with no activity.

Opontios commented 6 months ago

This issue is persisting despite doing everything that is described as a solution in all those issue reports. And it's very annoying first, and second if you don't approve the notification on time, the integration looses control of the TV, so it can't be turned off, for example, when you're leaving home and you have an automation that turns everything off, you see the notification popping up, and you have to go to the TV and approve, else the TV stays on. I realize that the TV is not storing the approval of notification, and although you can see Home Assistant among the approved devices, the TV is asking it again. Isn't it anything that can be done to solve this? Else it becomes impossible to use this integration on a regular bases.

ronyn77 commented 6 months ago

I don't think it's about the integration... It solely depends on the TV's faulty firmware. I experienced the same issue with my S95C. After several resets of the TV and toggling all the notifications in the TV menu on and off, it started working.

Opontios commented 6 months ago

I don't think it's about the integration... It solely depends on the TV's faulty firmware. I experienced the same issue with my S95C. After several resets of the TV and toggling all the notifications in the TV menu on and off, it started working.

Ok, intuitively I can sense that the issue must be with the TV's firmware, but one argument against that is that I have 2 different Samsung models with different firmware versions and different year of manufacture, and it happens on both, and second, why isn't it asking approval for all the other devices connected to the TVs?

ronyn77 commented 6 months ago

I had the exact same problems with my Samsung S95C initially. It worked for other devices but not for Home Assistant. After resetting and frequently changing the settings, the annoying pop-ups finally stopped. Honestly, I don't remember the exact reason, so it seemed rather random. Please note that you have to disable the notifications and give approval. Also, be aware that if you hard restart Home Assistant, it might prompt you again. If it still doesn’t work, your last resort for turning the TV on and off is to use an external device. In my case, I have a Google Chromecast attached to the TV. With the Google devices in my house, I can control the TV using Google Chromecast. Alternatively, if you use Node-RED, you can create flows to manage this. If you have an Apple TV, I believe you can do the same.

ollo69 commented 6 months ago

I understand the frustration of people that continuously receive popup notification on the TV, but let me say that the process is very simple:

1) Try first connection with the TV (without a token) -> during this phase the popup is shown on the TV and when the user confirm the token is generated and sent back to the integration 2) The integration store the token in the config entry 3) Next time the integration try to connect, it use the stored token. If the TV consider the token not valid anymore, a new popup is shown and a new token is released, and the integration replace the previous one with the new one.

The reason for which the previous token is not considered valid anymore, can vary, I put here just a couple of cases that I know:

1) The TV is configured to always ask for authorization (and not only the first time) -> in this case the token is not considered valid all the time, popup always appear 2) Other Integrations / software from the same HW try to communicate with the TV (this is the typical case where multiple Samsung TV integration are enabled and configured) -> in this case the TV probably invalidate the token because another integration try to connect with a different one. It is important to have only 1 integration configured, all the others should be disabled / removed. I'm thinking about implement a notification message to alert about another TV integration configured (eg. the native one, that BTW use auto-discovery and must be ignored!!!).

I do not have any element to understand exactly what happen, one possible option is enable the debug log for integration to analyze the log when token is requested again. In my case I have a 2022 Samsung TV configured from about 1 year, never received popup after first configuration.

For now I reopen this issue, just to see if someone can provide additional information.

ollo69 commented 6 months ago

I would add just another think: could somebody test if native integration have the same issue?

Opontios commented 6 months ago

I would add just another think: could somebody test if native integration have the same issue?

Frankly, I was considering the same thing the last days, to install the native integration and test it. The issue is that I started using your integration from the beginning, I never used the native, and never wanted to use it, so it always stayed as "ignored'. (By the way, thanks for all the effort made). And of course the "ask for authorization only the first time" setting was always enabled. I will follow your advice and enable the integration's debug. It must be done in the integration's page, right?

ollo69 commented 6 months ago

Honestly I would be surprised discovering that native integration do not have the same issue, but in that case I will further investigate in possible difference between the 2 integration. The real limitation of native integration is that it doesn't use SmartThings and this limit a lot the controls for the TV, especially for the part related to the control and information about sources and channels

It must be done in the integration's page, right?

Yes, should exist an option "Enable debug tracing" that I think is enough

akirayamamoto commented 5 months ago

I was having this issue with the official integration. I followed all the steps ollo69 mentioned and I also did the following:

I know this is not the official integration, but I just wanted to shed some light, I hope this helps.

github-actions[bot] commented 3 months ago

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.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 7 days with no activity.

Opontios commented 3 months ago
* Disabled polling :( - 

Can you explain what exactly do you mean by that? What polling?

felipecrs commented 2 weeks ago

Your tips worked for me. Thanks a ton!