Skip to content
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

Attention Required | Reconfigure | Everytime #60278

Closed
pickonedev opened this issue Nov 24, 2021 · 41 comments
Closed

Attention Required | Reconfigure | Everytime #60278

pickonedev opened this issue Nov 24, 2021 · 41 comments

Comments

@pickonedev
Copy link

The problem

Hi!

I am using this "Samsung Smart TV" integration, with 6 TV's which I have in my house and... Every few days, home assistant will ask me to reconfigure the integration. Why is doing this? It is annoying to do that every few days.

I use "DLNA Digital Media Renderer" integration as well, with all TV's, and this integration has never ask me for reconfigure...

I tried all the possible TV settings about persmissions and still nothing. I check the devices permissions and all good, Home Assistant is set to "Allow" on all TVs...

Any advices?

Thank you in advance.

What version of Home Assistant Core has the issue?

core-2021.11.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Samsung Smart TV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/samsungtv/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

samsungtv documentation
samsungtv source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @escoand, @chemelli74, mind taking a look at this issue as it has been labeled with an integration (samsungtv) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@pickonedev
Copy link
Author

And again... This time, even if I press "Allow" on my TV, the notification still appears, still ask me to Reconfigure, still ask me for permission...

Screenshot https://ibb.co/3yPdPVC

@chemelli74
Copy link
Contributor

Hi, we can try to check if something appears in debug logs, add the following to configuration.yaml , restart HA, and post the log:

logger:
  default: warning
  logs:
    homeassistant.components.samsungtv: debug
    samsungtvws: debug
    samsungctl: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

Also test with this code: https://pastebin.com/sFzPJvMA (you have to change the IP of your tv).

I bet the issue is in the library.

Simone

@pickonedev
Copy link
Author

Is this the proper log?
home-assistant.log

About that code, how can I use it? I'm a newbie to Home Assistant, can you please explain to me what I have to do with the code?

Thank you!

@pickonedev
Copy link
Author

I tried to run the code as python and I got this error in the logs

2021-11-26 11:07:13 ERROR (SyncWorker_4) [homeassistant.components.python_script.samsung.py] Error executing script: __import__ not found

@chemelli74
Copy link
Contributor

Are you running the script from HA ssh session ?
If not you need to install the library: "pip install samsungtvws".

Simone

@pickonedev
Copy link
Author

I done it, but I could not copy the text from terminal.
I made a screenshot.
screenshot

@chemelli74
Copy link
Contributor

Do you get notification for auth on TV if you run the script several times ?

Simone

@pickonedev
Copy link
Author

I ran the script >10 times but no notification appear...

I found out that this problem which I have, appear after I let the TV off for 1-3 days, then when I start it, could ask me or not, it is random...

@chemelli74
Copy link
Contributor

I found out that this problem which I have, appear after I let the TV off for 1-3 days, then when I start it, could ask me or not, it is random...

Will test it once back from WE as I'm not at home.
Will update you.

Simone

@pickonedev
Copy link
Author

Thank you! Have a nice weekend

@chemelli74
Copy link
Contributor

Hi, after 3.5 days off I switched on my tv from HA and without any re-prompt.
Different behaviors linked to different models; I fear nothing we can do about it.

Simone

@pickonedev
Copy link
Author

I can understand this, but... what I can't understand, is why the "DLNA Digital Media Renderer" integration, never ask me for this, but "Samsung Smart TV" integration is doing?

@chemelli74
Copy link
Contributor

I can understand this, but... what I can't understand, is why the "DLNA Digital Media Renderer" integration, never ask me for this, but "Samsung Smart TV" integration is doing?

DLNA is a protocol that is not based on authorization as far as I know. So you are never asked to authorize your client.

Simone

@chemelli74
Copy link
Contributor

I found out that this problem which I have, appear after I let the TV off for 1-3 days, then when I start it, could ask me or not, it is random...

Is that happening also with the library direct call (outside HA), right ?

Simone

@pickonedev
Copy link
Author

pickonedev commented Dec 2, 2021

Well... it is happening even another thing. I forgot to mention. Sometimes, when I need to reconfigure de integration, I press "submit" in HA, I press "Allow" on my tv (even if is already allowed) and it is not working... Take a look at the photos...

I found out that i'm not the only one, with this issue... I have another two friends, with the same problem... but does not care for them because they don't use the integration anymore....

So, in these photos, everytime I click "submit", then "allow on the tv", I get that error and it will do like this till I click deny

WhatsApp Image 2021-11-30 at 12 12 17
WhatsApp Image 2021-11-30 at 12 12 17 (1)

@chemelli74
Copy link
Contributor

Are you using DHCP by any chance ?

Simone

@pickonedev
Copy link
Author

pickonedev commented Dec 2, 2021

No no

Using DHCP with almost any device configured to Home Assistant, could not work properly....

@chemelli74
Copy link
Contributor

Using DHCP with almost any device configured to Home Assistant, could not work properly....

Your own (wrong) opinion. I have everything on DHCP but HA itself.

Simone

@epenet
Copy link
Contributor

epenet commented Feb 16, 2022

Can you please check if the new patch release 2022.2.8 has improved the situation?

@zigomatichub
Copy link

zigomatichub commented Feb 18, 2022

I'm receiving this reconfigure popup as well. It's always happening when tv is off.
When TV is on, I click on reconfigure in HA and it's ok. No need to check on TV, nothing appear and it's resolved. It's weird ...
I also observe some strange message from the event when I switch off the TV.
I get status change and inactive then 30sec after I receive status change and active then again after -+1min, I receive status change + inactive.

@chemelli74
Copy link
Contributor

I click on reconfigure in HA and it's ok. No need to check on TV, nothing appear and it's resolved. It's weird ...

Can you please add diagnostics (menu configuration -> integration -> samsung tv -> download diagnostics ) to this thread ?

Simone

@zigomatichub
Copy link

zigomatichub commented Feb 22, 2022

@chemelli74
With the latest version of HA 2022.2.9, I think you changed something because I can't reproduce. The issue is gone.
I still receive the status / active/ inactive but it's a minor issue.

Thank you for all the work done

@zigomatichub
Copy link

zigomatichub commented Feb 22, 2022

@chemelli74. After a restart of HA, I get the reconfigure (it appear one time till now since 2022.2.9).
Same as before, just click with no need of confirmation on the TV

@chemelli74
Copy link
Contributor

@chemelli74. After a restart of HA, I get the reconfigure (it appear one time till now since 2022.2.9). Same as before, just click with no need of confirmation on the TV

log, log, log ;-)

Simone

@zigomatichub
Copy link

zigomatichub commented Feb 24, 2022

Hello @chemelli74
I activated logs and restarted the HA instance.
Config yaml looks like this:

logger:
default: warning
logs:
samsungtv: debug

I'm receiving the popup in integration screen of HA but I don't know when... ( I think it's coming when TV is up but not sure about that)

I checks the logs and I don't see anything. :(
The only message related to the IP of the TV is :
WARNING (MainThread) [async_upnp_client.profiles.profile] Failed (re-)subscribing to: uuid:blablabla
reason: UpnpConnectionError("Cannot connect to host 10.0.4.50:9197 ssl:default [Connect call failed ('10.0.4.50', 9197)]", None)

At that moment is when I stopped the TV.

Edited : OK I see in the post upper that I'm not putting correct logging information. It's for next time ;)

@chemelli74
Copy link
Contributor

Please add the following to configuration.yaml , restart HA, and post the log:

logger:
  default: warning
  logs:
    homeassistant.components.samsungtv: debug
    samsungtvws: debug
    samsungctl: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

And add diagnostics (menu configuration -> integration -> samsung tv -> download diagnostics )

@zigomatichub
Copy link

zigomatichub commented Feb 25, 2022

For the moment, TV is OFF
After the restart of HA and no popup requesting to reconfigure, I receive every 10sec these 2 lines:
[homeassistant.components.samsungtv] Create SamsungTVWSBridge for name (10.0.4.50)
[samsungtvws.remote] WS url wss://10.0.4.50:8002/api/v2/channels/samsung.remote.control?name=SG9tZUFzc2lzdGFudA==&token=None

It use more or less 11 SyncWorker_11

config_entry-samsungtv-3614c14c97c8b280df78d43b2cd39a86.json (2).txt

It's a polling mechanism to see when tv is up ?

@zigomatichub
Copy link

@chemelli74
A logfile in attachment.
The integration is stopping when I receive this:
2022-02-26 18:49:28 DEBUG (SyncWorker_9) [homeassistant.components.samsungtv] Access denied in getting remote object
(At that moment, the TV was off )

I click one time to reconfigure but tv was Off and I click again to reconfigure when tv was ON.

issue.log

@epenet
Copy link
Contributor

epenet commented Feb 28, 2022

For the moment, TV is OFF After the restart of HA and no popup requesting to reconfigure, I receive every 10sec these 2 lines: [homeassistant.components.samsungtv] Create SamsungTVWSBridge for name (10.0.4.50) [samsungtvws.remote] WS url wss://10.0.4.50:8002/api/v2/channels/samsung.remote.control?name=SG9tZUFzc2lzdGFudA==&token=None

It's a polling mechanism to see when tv is up ?

Yes, the current implementation uses a 10-second polling to check if the TV is on.
I hope to remove this when #67369 is finalised.

@epenet
Copy link
Contributor

epenet commented Mar 3, 2022

I'm pretty sure #67541 would fix this. If you have the chance to test it it would be appreciated.

@epenet
Copy link
Contributor

epenet commented Mar 3, 2022

The patch has been merged, but it is too interwined with the latest refactoring to be tagged in a patch release.
It will be available in 2022.4
Feel free to use it as a custom component until then...

@epenet epenet closed this as completed Mar 3, 2022
@sidwin9
Copy link

sidwin9 commented Mar 12, 2022

Hello,
I have exactly the same problem but since version 2022.3.0 it happens several times a day instead of happening after a few days with previous versions.

@epenet
Copy link
Contributor

epenet commented Mar 12, 2022

@sidwin9 please follow these steps to check if it is OK on latest dev: #67632 (comment)

If it is not fixed please open a new issue

@w35l3y
Copy link
Contributor

w35l3y commented Apr 6, 2022

follow these steps to check if it is OK on latest dev: #67632 (comment)

2022-04-06 08:57:43 ERROR (SyncWorker_3) [homeassistant.util.package] Unable to install package async-upnp-client==0.27.0: ERROR: Cannot install async-upnp-client==0.27.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

I will wait 2022.4

@epenet
Copy link
Contributor

epenet commented Apr 6, 2022

It should be out later today
Or you can adjust manifest.json to set async_upnp_version == 0.26.0 (compatible with 2022.0.3) in the custom component

@w35l3y
Copy link
Contributor

w35l3y commented Apr 6, 2022

log.txt

I am using 2022.3.8
Samsung TV UN55JU7500 (2015)

Currently, I am using https://github.com/roberodin/ha-samsungtv-custom
I don't know whether I selected the best "protocol", but at least it is working the basic commands like un/mute, vol -, vol +

media_player:
  - platform: samsungtv_custom
    host: 192.168.0.112
    port: 8002
    mac: "xx-xx-xx-xx-xx-xx"
    sourcelist: '{"WiiU": "KEY_HDMI2", "RaspberryPi": "KEY_HDMI3"}'
    applist: "YouTube Kids, YouTube, Netflix"
    protocol: ctl_qled

@epenet
Copy link
Contributor

epenet commented Apr 6, 2022

I suggest that you check your model in 2022.0.4 when it is available
Performance will be much better than ha-samsungtv-custom because it will be 100% async.

If you find some bugs/errors, you can open a new issue.
If there are some features that are available in ha-samsungtv-custom but not in the core component, you can open a PR and I will happily review it

@w35l3y
Copy link
Contributor

w35l3y commented Apr 6, 2022

I suggest that you check your model in 2022.0.4 when it is available

I only tested un/mute, vol + and vol -. They are working now.
I will check all functionalities later. Thanks for your work.

The only problem is that it is flooding the log with the same message when TV is turned off.

2022-04-06 13:51:41 DEBUG (MainThread) [homeassistant.components.samsungtv] Checking if TV 192.168.0.112 is on using websocket
2022-04-06 13:51:41 DEBUG (MainThread) [homeassistant.components.samsungtv] Create SamsungTVEncryptedBridge for 192.168.0.112
2022-04-06 13:51:41 DEBUG (MainThread) [samsungtvws.encrypted.remote] Tx: GET http://192.168.0.112:8000/socket.io/1/?t=1649263901972
2022-04-06 13:51:47 DEBUG (MainThread) [homeassistant.components.samsungtv] Failed to get remote for 192.168.0.112: TimeoutError()
2022-04-06 13:51:47 DEBUG (MainThread) [homeassistant.components.samsungtv] Failed to get remote for 192.168.0.112: TimeoutError()

@epenet
Copy link
Contributor

epenet commented Apr 6, 2022

Last reply on this thread, as it is a closed issue: log flooding is kind of expected when debug is enabled.

@home-assistant home-assistant locked and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants