core: Samsung TV can't be added (Websocket error)
The problem
I’m trying to add my Samsung TV, using the Samsung TV integration from the integrations menu. Unfortunately it says the TV is not supported. It’s a 2017 model running Tizen (UE55MU7000). I had it running with the tizen custom integration, but removed it a while back. This made me wonder why it wouldn’t work with this integration.
When I turned on debug logging while adding the TV, I receive the following log:
2022-03-14 12:07:10 DEBUG (SyncWorker_3) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': 'xx.xx.xx.xx', 'method': 'legacy', 'port': None, 'timeout': 31} 2022-03-14 12:07:10 DEBUG (SyncWorker_3) [homeassistant.components.samsungtv] Failing config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': 'xx.xx.xx.xx', 'method': 'legacy', 'port': None, 'timeout': 31}, error: [Errno 111] Connection refused 2022-03-14 12:07:10 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'host': 'xx.xx.xx.xx', 'method': 'websocket', 'port': 8002, 'timeout': 31} 2022-03-14 12:07:10 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Working but unsupported config: {'name': 'HomeAssistant', 'host': 'xx.xx.xx.xx', 'method': 'websocket', 'port': 8002, 'timeout': 31}, error: ('Invalid close opcode %r', 1005) 2022-03-14 12:07:10 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'host': 'xx.xx.xx.xx', 'method': 'websocket', 'port': 8001, 'timeout': 31} 2022-03-14 12:07:10 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Working but unsupported config: {'name': 'HomeAssistant', 'host': 'xx.xx.xx.xx', 'method': 'websocket', 'port': 8001, 'timeout': 31}, error: ('Invalid close opcode %r', 1005)
It looks like the config is failing on the web socket. When I check the API with:
http://xx.xx.xx.xx:8001/api/v2/
I’m returned the correct information of the TV:
{"device":{"FrameTVSupport":"false","GamePadSupport":"true","ImeSyncedSupport":"true","OS":"Tizen","TokenAuthSupport":"true","VoiceSupport":"true","countryCode":"NL","description":"Samsung DTV RCR","developerIP":"0.0.0.0","developerMode":"0","duid":"xxxxxxxx","firmwareVersion":"Unknown","id":"uuid:xxxxxxx","ip":"xx.xx.xx.xx","model":"17_KANTM_UHD","modelName":"UE55MU7000","name":"[TV] Samsung TV","networkType":"none","resolution":"3840x2160","smartHubAgreement":"true","type":"Samsung SmartTV","udn":"uuid:xxxxxx","wifiMac":"none"},"id":"uuid:xxxxxxxx","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV] Samsung TV","remote":"1.0","type":"Samsung SmartTV","uri":"http://xx.xx.xx.xx:8001/api/v2/","version":"2.0.25"}
Do you know what is going wrong during the setup of the integration?
What version of Home Assistant Core has the issue?
core-2022.3.4
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
samsungtv
Link to integration documentation on our website
https://www.home-assistant.io/integrations/samsungtv/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
I have created a documentation PR: https://github.com/home-assistant/home-assistant.io/pull/22019 If you feel that the documentation could be further improved then I suggest you open a follow-up PR.
I’ve finally found the issue… First I thought it was firewall related, but temporarily turning off my LAN rules did not work.
Now I found out that for some reason it could not handle the TV being on another IP subnet. When HA is running on e.g. 192.168.x.x and the TV on 10.0.x.x, it will have trouble connecting and will not show the connection prompt on the tv. When I moved the TV to the same subnet, the connection was made instantly.
Thought I’m glad I’ve found the issue, this is not really where I would want to have the TV. I prefer to put it back on its own subnet. Smart TV’s these days are getting too smart. Is this possible?