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

SamsungTV integration re discover TV any time after reboot #64465

Closed
landaisbenj opened this issue Jan 19, 2022 · 66 comments
Closed

SamsungTV integration re discover TV any time after reboot #64465

landaisbenj opened this issue Jan 19, 2022 · 66 comments

Comments

@landaisbenj
Copy link
Contributor

landaisbenj commented Jan 19, 2022

The problem

HA discover my samsungtv (i just have one), and so i could add the integration.
But after every restart, HA want to add my tv every time.. (with translation error).

image

I can ignore, but why this...
[EDIT] After adding twice, i have this after rebooting:
image

What version of Home Assistant Core has the issue?

core-2021.12.10

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

samsungtv

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

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)


samsungtv documentation
samsungtv source
(message by IssueLinks)

@chemelli74
Copy link
Contributor

We can check what happens 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.

Simone

@landaisbenj
Copy link
Contributor Author

landaisbenj commented Jan 19, 2022

Ok. Should i have suppress integration before ?

@landaisbenj
Copy link
Contributor Author

home-assistant.log

I think it's good like this !

@chemelli74
Copy link
Contributor

Man, you have a log full of errors of any kind ;-)
I think you should focus and fix your installation to clean them out.

About Samsung, remove the custom component:

2022-01-19 21:34:52 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration samsungtv_custom which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

I would also remove all configured and ignored SamsungTv, delete the auth in the TV menu, restart HA so to start from a clean situation:

2022-01-19 21:35:06 DEBUG (SyncWorker_6) [homeassistant.components.samsungtv] Access denied in getting remote object

Simone

@landaisbenj
Copy link
Contributor Author

landaisbenj commented Jan 19, 2022

Yes I know. But I don’t know how 😭 especially for some like this:

2022-01-19 21:55:23 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server (0 bytes read on a total of 32 expected bytes)
2022-01-19 21:55:23 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
2022-01-19 21:55:33 ERROR (MainThread) [aiohttp.server] Error handling request

I take your comment. And repost here.

@landaisbenj
Copy link
Contributor Author

Ok so, i'm like this :
image
for this log at start :
home-assistant.log
I can try to re add the integration ?

@chemelli74
Copy link
Contributor

Quite strange the translation error, but yes try to add the integration confirming the configure

Simone

@landaisbenj
Copy link
Contributor Author

Yes, we talk about this here :

#59249 (comment)

So, I add the integration, confirmed in the tv and restart. Seems not discovered anymore 👍

@chemelli74
Copy link
Contributor

#59249 (comment)

Selected language is ?

So, I add the integration, confirmed in the tv and restart. Seems not discovered anymore 👍

Nice!

@landaisbenj
Copy link
Contributor Author

Selected language is ?

French

@landaisbenj
Copy link
Contributor Author

Ok, after some day, i have this appear on my notif panel 👍

image

Did you know if it's a bug ?

@chemelli74
Copy link
Contributor

Ok, after some day, i have this appear on my notif panel 👍

Did you know if it's a bug ?

If you try to configure, what happens ?

Simone

@landaisbenj
Copy link
Contributor Author

Desapear 🤨

@chemelli74
Copy link
Contributor

Desapear 🤨

humm, can you share the log ?

@djansen1987
Copy link

djansen1987 commented Jan 29, 2022

Same issue, also the tv keeps asking for approval. This happens on 3 of my samsung screens

image

(this wil stop ofcourse when you click deny (weiger))

@chemelli74
Copy link
Contributor

@landaisbenj , @djansen1987 do you mind updating to 2022.2.0b5 and then

  • post fresh log
  • post diagnostics ( configuration -> integration -> samsungtv -> download diagnostics)

Thx,

Simone

@landaisbenj
Copy link
Contributor Author

landaisbenj commented Feb 1, 2022

Ok so i'm in now :
image

Have this :
image

This log :
home-assistant.log

And i think, this is diagnostics ?
config_entry-samsungtv-d60f4b349f3570c2a46676978086bd5a.json.txt
image

@djansen1987
Copy link

I don't see that option to download the logs
image

@landaisbenj
Copy link
Contributor Author

Maybe because you are not in 2022.2.0b5

@chemelli74
Copy link
Contributor

This log : home-assistant.log

And i think, this is diagnostics ? [config_entry-samsungtv-d60f4b349f3570c2a46676978086bd5a.json.txt]

Seems the token is not saved here for some reason.
So can you confirm that TV is working right after adding it to HA, but at next reboot you get again a discovery?

Simone

@djansen1987
Copy link

That is what i am seeing as behaviour

This log : home-assistant.log
And i think, this is diagnostics ? [config_entry-samsungtv-d60f4b349f3570c2a46676978086bd5a.json.txt]

Seems the token is not saved here for some reason. So can you confirm that TV is working right after adding it to HA, but at next reboot you get again a discovery?

Simone

@djansen1987
Copy link

djansen1987 commented Feb 1, 2022

Maybe because you are not in 2022.2.0b5

Missed the part on asking me to update, i am on:
core-2021.12.10
supervisor-2022.01.1
not comfortable at the moment upgrading to beta

@landaisbenj
Copy link
Contributor Author

This log : home-assistant.log
And i think, this is diagnostics ? [config_entry-samsungtv-d60f4b349f3570c2a46676978086bd5a.json.txt]

Seems the token is not saved here for some reason. So can you confirm that TV is working right after adding it to HA, but at next reboot you get again a discovery?

Simone

I can change volume with ha on the TV. So tv work fine with ha. Maybe it’s because it’s an old model ? (2015). But if if reboot ha, I don’t have a discovery for the moment.

@chemelli74
Copy link
Contributor

Missed the part on asking me to update, i am on: core-2021.12.10 supervisor-2022.01.1 not comfortable at the moment upgrading to beta

@djansen1987, there is not a official release to update to.

Simone

@chemelli74
Copy link
Contributor

Seems the token is not saved here for some reason. So can you confirm that TV is working right after adding it to HA, but at next reboot you get again a discovery?
Simone

I can change volume with ha on the TV. So tv work fine with ha. Maybe it’s because it’s an old model ? (2015). But if if reboot ha, I don’t have a discovery for the moment.

Your diagnostics says it's using the new websocket method:

        "method": "websocket",
        "model": "UE65KU6680",
        "name": "Samsung",
        "port": 8002

which is token based.

Simone

@djansen1987
Copy link

djansen1987 commented Feb 9, 2022

Still have the issue

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.2.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.7",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "5.10.91",
    "supervisor": "2022.01.1",
    "host_os": "Home Assistant OS 7.2",
    "docker_version": "20.10.9",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "saj_esolar": {
      "version": "1.2.9",
      "requirements": []
    },
    "toon_climate": {
      "version": "1.0.12",
      "requirements": []
    },
    "afvalbeheer": {
      "version": "4.9.2",
      "requirements": [
        "rsa",
        "pycryptodome"
      ]
    },
    "toon_boilerstatus": {
      "version": "1.0.11",
      "requirements": []
    },
    "custom_component_analytics": {
      "version": "0.0.1",
      "requirements": []
    },
    "nodered": {
      "version": "1.0.6",
      "requirements": []
    },
    "philips_airpurifier": {
      "version": "0.4.0",
      "requirements": [
        "aioairctrl @ git+https://github.com/betaboon/aioairctrl@v0.2.1"
      ]
    },
    "philips_airpurifier_coap": {
      "version": "0.7.0",
      "requirements": [
        "aioairctrl @ git+https://github.com/betaboon/aioairctrl@v0.2.1"
      ]
    },
    "hacs": {
      "version": "1.21.0",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "toon_smartmeter": {
      "version": "1.0.18",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "samsungtv",
    "name": "Samsung Smart TV",
    "documentation": "https://www.home-assistant.io/integrations/samsungtv",
    "requirements": [
      "getmac==0.8.2",
      "samsungctl[websocket]==0.7.1",
      "samsungtvws==1.6.0",
      "wakeonlan==2.0.1"
    ],
    "ssdp": [
      {
        "st": "urn:samsung.com:device:RemoteControlReceiver:1"
      }
    ],
    "zeroconf": [
      {
        "type": "_airplay._tcp.local.",
        "properties": {
          "manufacturer": "samsung*"
        }
      }
    ],
    "dhcp": [
      {
        "hostname": "tizen*"
      },
      {
        "macaddress": "8CC8CD*"
      },
      {
        "macaddress": "606BBD*"
      },
      {
        "macaddress": "F47B5E*"
      },
      {
        "macaddress": "4844F7*"
      }
    ],
    "codeowners": [
      "@escoand",
      "@chemelli74"
    ],
    "config_flow": true,
    "iot_class": "local_polling",
    "is_built_in": true
  },
  "data": {
    "entry": {
      "entry_id": "xxxxxx",
      "version": 2,
      "domain": "samsungtv",
      "title": "samsungwktv (QE65Q80TALXXN)",
      "data": {
        "host": "192.168.xx.xx",
        "mac": "70:b1:3d:xx:xx:xx",
        "manufacturer": "Samsung",
        "method": "websocket",
        "model": "QE65Q80TALXXN",
        "name": "samsungwktv",
        "port": 8002,
        "token": "**REDACTED**"
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "xxxx",
      "disabled_by": null
    }
  }
}

@epenet
Copy link
Contributor

epenet commented Mar 7, 2022

Im pretty sure the UDN is changing. We should probably check the mac address as well now that we have it

@bdraco I compared the UDN in discovery logs to the unique_id in the storage (core.config_entries) and they are identical. I am not convinced that is the root cause.
I started looking at the mac address and I have discovered an issue loading it from the device_info. Maybe it won't help for this issue, but I created PR #67804

@epenet
Copy link
Contributor

epenet commented Mar 7, 2022

@bdraco I have investigated the UDN issue some more, and I have discovered that (at least on my television) the udn returned by the REST-API (user/dhcp/zeroconf flows) is not the same as the udn returned by the SSDP discovery.

  • REST-API: "udn":"uuid:c80686d7-86f0-41b1-833f-c591cb111276"
  • SSDP: "UDN": "uuid:ae65b3b6-8db6-49a1-98c1-cd09fbd5d84d"

I think maybe SSDP should be adjusted to use the UDN from the REST-API?

@epenet
Copy link
Contributor

epenet commented Mar 7, 2022

Separate PR created for the UDN mismatch: #67811

@epenet epenet mentioned this issue Mar 7, 2022
22 tasks
@epenet
Copy link
Contributor

epenet commented Mar 8, 2022

The dev branch has been updated again today. Can you please test again?

{
  "domain": "samsungtv",
  "name": "Samsung Smart TV",
  "version": "2022.4.0-20220308",
  "documentation": "https://www.home-assistant.io/integrations/samsungtv",
  "...",
}
  • adjust your configuration file for logging:
logger:
    default: warning
    logs:
        homeassistant.components.samsungtv: debug
        custom_components.samsungtv: debug
        samsungtvws: debug
        samsungctl: debug

image

@landaisbenj
Copy link
Contributor Author

landaisbenj commented Mar 8, 2022

I just do your stuf, and don't remove official integration. In log, i have this, but no longueur have 3 integrations.

2022-03-08 13:50:32 DEBUG (MainThread) [custom_components.samsungtv] Checking if TV 192.168.0.15 is on using websocket
2022-03-08 13:50:32 DEBUG (MainThread) [custom_components.samsungtv] Create SamsungTVWSBridge for 192.168.0.15
2022-03-08 13:50:32 DEBUG (MainThread) [samsungtvws.async_connection] WS url wss://192.168.0.15:8002/api/v2/channels/samsung.remote.control?name=SG9tZUFzc2lzdGFudA==&token=None
2022-03-08 13:50:37 DEBUG (MainThread) [custom_components.samsungtv] Failed to get remote for 192.168.0.15: TimeoutError()

image

And now, samsung entity work again :
image

@epenet
Copy link
Contributor

epenet commented Mar 8, 2022

If the TV is offline, then this is correct behaviour (TimeoutError after 5 seconds)

@landaisbenj
Copy link
Contributor Author

yes TV is offline, i'm on work.

@landaisbenj
Copy link
Contributor Author

landaisbenj commented Mar 8, 2022

So for information, after start by HA i have this :

log
2022-03-08 13:59:27 DEBUG (MainThread) [custom_components.samsungtv] Samsung device found via DHCP: DhcpServiceInfo(ip='192.168.0.15', hostname='localhost', macaddress='e47dbd325f3a')
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.async_rest] Get device info via rest api
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.helper] Processing API response: {"event":"ms.channel.connect","data":{"id":"daaa2900-9e5b-11ec-8488-fbf32eaee30c","clients":[{"id":"daaa2900-9e5b-11ec-8488-fbf32eaee30c","connectTime":1646687788944,"attributes":{"name":"SG9tZUFzc2lzdGFudA==","token":"None"},"deviceName":"SG9tZUFzc2lzdGFudA==","isHost":false}]}}
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.connection] SamsungTVWS websocket event: {'event': 'ms.channel.connect', 'data': {'id': 'daaa2900-9e5b-11ec-8488-fbf32eaee30c', 'clients': [{'id': 'daaa2900-9e5b-11ec-8488-fbf32eaee30c', 'connectTime': 1646687788944, 'attributes': {'name': 'SG9tZUFzc2lzdGFudA==', 'token': 'None'}, 'deviceName': 'SG9tZUFzc2lzdGFudA==', 'isHost': False}]}}
2022-03-08 13:59:27 DEBUG (MainThread) [custom_components.samsungtv] Created SamsungTVWSBridge for 192.168.0.15
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.async_rest] Get device info via rest api
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.helper] Processing API response: {
  "id": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
  "name": "[TV] Samsung",
  "version": "2.1.0",
  "device": {
    "type": "Samsung SmartTV",
    "duid": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
    "model": "16_JAZZL_UHD",
    "modelName": "UE65KU6680",
    "description": "Samsung DTV RCR",
    "networkType": "wireless",
    "ssid": "70:fc:8f:f2:db:8c",
    "ip": "192.168.0.15",
    "firmwareVersion": "Unknown",
    "name": "[TV] Samsung",
    "id": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
    "udn": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
    "resolution": "3840x2160",
    "countryCode": "FR",
    "msfVersion": "2.1.0",
    "smartHubAgreement": "true",
    "VoiceSupport": "true",
    "GamePadSupport": "true",
    "wifiMac": "E4:7D:BD:32:5F:3A",
    "developerMode": "0",
    "developerIP": "",
    "OS": "Tizen"
  },
  "type": "Samsung SmartTV",
  "uri": "https://192.168.0.15:8002/api/v2/",
  "remote": "1.0",
  "isSupport": "{\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\",\"DMP_available\":\"true\",\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"EDEN_available\":\"true\"}"
}
2022-03-08 13:59:27 DEBUG (MainThread) [custom_components.samsungtv] Device info on 192.168.0.15 is: {'id': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'name': '[TV] Samsung', 'version': '2.1.0', 'device': {'type': 'Samsung SmartTV', 'duid': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'model': '16_JAZZL_UHD', 'modelName': 'UE65KU6680', 'description': 'Samsung DTV RCR', 'networkType': 'wireless', 'ssid': '70:fc:8f:f2:db:8c', 'ip': '192.168.0.15', 'firmwareVersion': 'Unknown', 'name': '[TV] Samsung', 'id': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'udn': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'resolution': '3840x2160', 'countryCode': 'FR', 'msfVersion': '2.1.0', 'smartHubAgreement': 'true', 'VoiceSupport': 'true', 'GamePadSupport': 'true', 'wifiMac': 'E4:7D:BD:32:5F:3A', 'developerMode': '0', 'developerIP': '', 'OS': 'Tizen'}, 'type': 'Samsung SmartTV', 'uri': 'https://192.168.0.15:8002/api/v2/', 'remote': '1.0', 'isSupport': '{"remote_available":"true","remote_fourDirections":"true","remote_touchPad":"true","remote_voiceControl":"true","DMP_available":"true","DMP_DRM_PLAYREADY":"false","DMP_DRM_WIDEVINE":"false","EDEN_available":"true"}'}
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.helper] Processing API response: {
  "id": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
  "name": "[TV] Samsung",
  "version": "2.1.0",
  "device": {
    "type": "Samsung SmartTV",
    "duid": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
    "model": "16_JAZZL_UHD",
    "modelName": "UE65KU6680",
    "description": "Samsung DTV RCR",
    "networkType": "wireless",
    "ssid": "70:fc:8f:f2:db:8c",
    "ip": "192.168.0.15",
    "firmwareVersion": "Unknown",
    "name": "[TV] Samsung",
    "id": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
    "udn": "uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d",
    "resolution": "3840x2160",
    "countryCode": "FR",
    "msfVersion": "2.1.0",
    "smartHubAgreement": "true",
    "VoiceSupport": "true",
    "GamePadSupport": "true",
    "wifiMac": "E4:7D:BD:32:5F:3A",
    "developerMode": "0",
    "developerIP": "",
    "OS": "Tizen"
  },
  "type": "Samsung SmartTV",
  "uri": "https://192.168.0.15:8002/api/v2/",
  "remote": "1.0",
  "isSupport": "{\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\",\"DMP_available\":\"true\",\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"EDEN_available\":\"true\"}"
}
2022-03-08 13:59:27 DEBUG (MainThread) [custom_components.samsungtv] Device info on 192.168.0.15 is: {'id': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'name': '[TV] Samsung', 'version': '2.1.0', 'device': {'type': 'Samsung SmartTV', 'duid': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'model': '16_JAZZL_UHD', 'modelName': 'UE65KU6680', 'description': 'Samsung DTV RCR', 'networkType': 'wireless', 'ssid': '70:fc:8f:f2:db:8c', 'ip': '192.168.0.15', 'firmwareVersion': 'Unknown', 'name': '[TV] Samsung', 'id': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'udn': 'uuid:c6a2ea35-bba2-4a2c-96a5-b84cc702b90d', 'resolution': '3840x2160', 'countryCode': 'FR', 'msfVersion': '2.1.0', 'smartHubAgreement': 'true', 'VoiceSupport': 'true', 'GamePadSupport': 'true', 'wifiMac': 'E4:7D:BD:32:5F:3A', 'developerMode': '0', 'developerIP': '', 'OS': 'Tizen'}, 'type': 'Samsung SmartTV', 'uri': 'https://192.168.0.15:8002/api/v2/', 'remote': '1.0', 'isSupport': '{"remote_available":"true","remote_fourDirections":"true","remote_touchPad":"true","remote_voiceControl":"true","DMP_available":"true","DMP_DRM_PLAYREADY":"false","DMP_DRM_WIDEVINE":"false","EDEN_available":"true"}'}
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.async_remote] Get app list
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.helper] Processing API response: {"event":"ed.installedApp.get","data":{"data":[{"appId":"111299001912","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/111299001912/250x250.png","name":"YouTube"},{"appId":"3201909019271","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201909019271/250x250.png","name":"PrivacyChoices"},{"appId":"3201606009910","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201606009910/250x250.png","name":"CANAL+"},{"appId":"3201703012029","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201703012029/250x250.png","name":"OCS"},{"appId":"3201601007250","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201601007250/250x250.png","name":"Google Play Films et séries"},{"appId":"org.tizen.browser","app_type":4,"icon":"/opt/down/webappservice/apps_icon/LocalIcon/org.tizen.browser.png","name":"Web Browser"},{"appId":"20162100006","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/20162100006/250x250.png","name":"e-Manual"},{"appId":"11101200001","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/11101200001/250x250.png","name":"Netflix"},{"appId":"3201512006785","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201512006785/250x250.png","name":"Prime Video"},{"appId":"3201511006428","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201511006428/250x250.png","name":"Rakuten TV"},{"appId":"3201704012212","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201704012212/250x250.png","name":"RMC Sport"},{"appId":"3201901017640","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201901017640/250x250.png","name":"Disney+"},{"appId":"3201606009684","app_type":2,"icon":"/opt/down/webappservice/apps_icon/FirstScreen/3201606009684/250x250.png","name":"Spotify - Musique et podcasts"}]},"from":"host"}
2022-03-08 13:59:27 DEBUG (MainThread) [samsungtvws.connection] SamsungTVWS websocket event: {'event': 'ed.installedApp.get', 'data': {'data': [{'appId': '111299001912', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/111299001912/250x250.png', 'name': 'YouTube'}, {'appId': '3201909019271', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201909019271/250x250.png', 'name': 'PrivacyChoices'}, {'appId': '3201606009910', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201606009910/250x250.png', 'name': 'CANAL+'}, {'appId': '3201703012029', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201703012029/250x250.png', 'name': 'OCS'}, {'appId': '3201601007250', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201601007250/250x250.png', 'name': 'Google Play Films et séries'}, {'appId': 'org.tizen.browser', 'app_type': 4, 'icon': '/opt/down/webappservice/apps_icon/LocalIcon/org.tizen.browser.png', 'name': 'Web Browser'}, {'appId': '20162100006', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/20162100006/250x250.png', 'name': 'e-Manual'}, {'appId': '11101200001', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/11101200001/250x250.png', 'name': 'Netflix'}, {'appId': '3201512006785', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201512006785/250x250.png', 'name': 'Prime Video'}, {'appId': '3201511006428', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201511006428/250x250.png', 'name': 'Rakuten TV'}, {'appId': '3201704012212', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201704012212/250x250.png', 'name': 'RMC Sport'}, {'appId': '3201901017640', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201901017640/250x250.png', 'name': 'Disney+'}, {'appId': '3201606009684', 'app_type': 2, 'icon': '/opt/down/webappservice/apps_icon/FirstScreen/3201606009684/250x250.png', 'name': 'Spotify - Musique et podcasts'}]}, 'from': 'host'}
2022-03-08 13:59:28 DEBUG (MainThread) [custom_components.samsungtv] Generated app list: {'CANAL+': '3201606009910', 'Disney+': '3201901017640', 'Google Play Films et séries': '3201601007250', 'Netflix': '11101200001', 'OCS': '3201703012029', 'Prime Video': '3201512006785', 'PrivacyChoices': '3201909019271', 'RMC Sport': '3201704012212', 'Rakuten TV': '3201511006428', 'Spotify - Musique et podcasts': '3201606009684', 'Web Browser': 'org.tizen.browser', 'YouTube': '111299001912', 'e-Manual': '20162100006'}
2022-03-08 13:59:32 DEBUG (MainThread) [custom_components.samsungtv] Checking if TV 192.168.0.15 is on using websocket
2022-03-08 13:59:42 DEBUG (MainThread) [custom_components.samsungtv] Checking if TV 192.168.0.15 is on using websocket
2022-03-08 13:59:52 DEBUG (MainThread) [custom_components.samsungtv] Checking if TV 192.168.0.15 is on using websocket
2022-03-08 14:00:02 DEBUG (MainThread) [custom_components.samsungtv] Checking if TV 192.168.0.15 is on using websocket
2022-03-08 14:00:12 DEBUG (MainThread) [custom_components.samsungtv] Checking if TV 192.168.0.15 is on using websocket

and this appear :
image

@epenet
Copy link
Contributor

epenet commented Mar 8, 2022

Can you please download the full log, and attach it please (don't copy paste as it is harder to read)

@epenet
Copy link
Contributor

epenet commented Mar 8, 2022

Can you please also attach the latest diagnostics (they contain more information since 2022.3)?

@landaisbenj
Copy link
Contributor Author

@epenet
Copy link
Contributor

epenet commented Mar 8, 2022

I have created PR #67859. You can test it before it is merged by replacing the config_flow.py file in your custom component with this patched file: https://raw.githubusercontent.com/home-assistant/core/971c6531ee9c40235be899215b9260c32f127efa/homeassistant/components/samsungtv/config_flow.py

@landaisbenj
Copy link
Contributor Author

Ok seems to work 😊 all work and discover disappear

@epenet
Copy link
Contributor

epenet commented Mar 8, 2022

For reference can you post log here?
And add comment on the PR

@landaisbenj
Copy link
Contributor Author

@landaisbenj
Copy link
Contributor Author

i'm too slow ^^

@rootkgh
Copy link

rootkgh commented Mar 8, 2022

it is resolve only re dicover case

i confirm re-authentication everydays
my TV is UN65KS8000 (2016 Ver.)

TV power off, log is "TimeoutError"
flug out, log change "ConnectionRefusedError"

flug in, do something and require re-authentication

i attatch dev log
and 2022.2.9 log (same situation, buy log is simple)

i erase DHCP line because it has macaddress in dev log
home-assistant.log.2022.3.4-dev.txt
home-assistant.log.2022.2.9.txt

@epenet
Copy link
Contributor

epenet commented Mar 9, 2022

@rootkgh please update to latest dev. The ConnectionFailure issue should have been fixed with #67850

@rootkgh
Copy link

rootkgh commented Mar 9, 2022

when flug out and in, re-authentication is solved

change point

  1. when ha restart, samsungtv device is twice, so i do delete previous device and use new device
    it is only once
    core.device_registry's id is remain old and new id, so i delete old id
    others files is changed to new id

  2. when flug in, cause new warnning
    image

attatch log file
home-assistant.log_2022.3.4_dev2.txt
e

@epenet
Copy link
Contributor

epenet commented Mar 9, 2022

This one will be solved when xchwarze/samsung-tv-ws-api#72 is merged and the library is updated inside HA:

2022-03-09 21:33:40 WARNING (MainThread) [custom_components.samsungtv] Unexpected ConnectionFailure trying to get remote for 192.168.1.6, please report this issue: ConnectionFailure({'event': 'ms.voiceApp.hide'})

For this one, I think it is only temporary. Maybe it happens because the TV is turning on (accepting connection, but not yet fully responding):

2022-03-09 21:33:19 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2022-03-09 21:33:19 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.samsung_un65ks8000 is taking over 10 seconds
2022-03-09 21:33:29 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2022-03-09 21:33:39 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10

@epenet epenet closed this as completed Mar 9, 2022
@djansen1987
Copy link

Issue is still not resolved for me. Still i get an access pop-up every time i turn on the TV

@epenet
Copy link
Contributor

epenet commented Mar 22, 2022

Check the settings on the TV: Device Connection Manager
Make sure it is set to First Time Only.

@djansen1987
Copy link

Check the settings on the TV: Device Connection Manager Make sure it is set to First Time Only.

This has solved it for me. Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 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

7 participants