Core: Samsung TV not supported

Created on 18 Mar 2020  Â·  37Comments  Â·  Source: home-assistant/core

The problem


Samsung TV model MU6125 is not working.

Screenshot 2020-03-18 at 18 36 00

Environment

  • Home Assistant release with the issue: 0.107.0
  • Last working Home Assistant release (if known): 0.8x.0
  • Operating environment (Hass.io/Docker/Windows/etc.): Hass.io
  • Integration causing this issue: Samsung TV
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/samsungtv/

Additional information

I was under the impression that in version 0.107.0 would support all Samsung TVs.

samsungtv

Most helpful comment

UE55MU6199
Same debug output. Modifying bridge.py to change the order of ports for websocket connection to first try 8002, then 8001 solves it.
Additional debugging info:
2020-03-19 13:33:25 DEBUG (SyncWorker_3) [samsungtvws.remote] WS url ws://xx.xx.xx.xx:8001/api/v2/channels/samsung.remote.control?name=xxxxxxxxxxxxxxx 2020-03-19 13:33:25 DEBUG (SyncWorker_3) [samsungtvws.remote] Connection closed.
So it appears that if connection to 8001 is unsuccessful (which it will be on current firmware versions as although the port is still open, SSL is preferred), port 8002 is never even tried.

All 37 comments

Hey there @escoand, mind taking a look at this issue as its been labeled with a integration (samsungtv) you are listed as a codeowner for? Thanks!

@beloso Please show us the debug log of the config flow.

How do I get those?

logger:
  default: info
  logs:
    homeassistant.components.samsungtv: debug

Here they are:

2020-03-18 22:07:26 DEBUG (SyncWorker_15) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.2.140', 'method': 'legacy', 'port': None, 'timeout': 31}
2020-03-18 22:07:42 DEBUG (SyncWorker_15) [homeassistant.components.samsungtv] Failing config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.2.140', 'method': 'legacy', 'port': None, 'timeout': 31}, error: [Errno 111] Connection refused
2020-03-18 22:07:43 DEBUG (SyncWorker_15) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'host': '192.168.2.140', 'method': 'websocket', 'port': 8001, 'timeout': 31}
2020-03-18 22:07:43 DEBUG (SyncWorker_15) [homeassistant.components.samsungtv] Working but unsupported config: {'name': 'HomeAssistant', 'host': '192.168.2.140', 'method': 'websocket', 'port': 8001, 'timeout': 31}

@tulindo can you say something to this issue?

Just wanted to add the same issue in my case with model UE32M5620.

2020-03-19 11:20:30 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.2.111', 'method': 'legacy', 'port': None, 'timeout': 31}
2020-03-19 11:20:30 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Failing config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.2.111', 'method': 'legacy', 'port': None, 'timeout': 31}, error: [Errno 111] Connection refused
2020-03-19 11:20:30 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'host': '192.168.2.111', 'method': 'websocket', 'port': 8001, 'timeout': 31}
2020-03-19 11:20:31 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Working but unsupported config: {'name': 'HomeAssistant', 'host': '192.168.2.111', 'method': 'websocket', 'port': 8001, 'timeout': 31}

UE55MU6199
Same debug output. Modifying bridge.py to change the order of ports for websocket connection to first try 8002, then 8001 solves it.
Additional debugging info:
2020-03-19 13:33:25 DEBUG (SyncWorker_3) [samsungtvws.remote] WS url ws://xx.xx.xx.xx:8001/api/v2/channels/samsung.remote.control?name=xxxxxxxxxxxxxxx 2020-03-19 13:33:25 DEBUG (SyncWorker_3) [samsungtvws.remote] Connection closed.
So it appears that if connection to 8001 is unsuccessful (which it will be on current firmware versions as although the port is still open, SSL is preferred), port 8002 is never even tried.

@escoand. You're probably right. I would skip return if port is 8001 (so it will try on 8002). I will maintain it for port 8002.
No time to fix it in those days. CN you handle it?

I've confirmed your theory @escoand. I've tried it locally with a custom version and for TVs that use port 8002 we never get to that port due to the return when using 8001.

However, once that's fixed I ran into another issue with this new component version. The TV will be flooded with token confirmation popups. I suspect the token is not being saved/used correctly. I'm still looking into that but curious if anyone else with a Samsung TV would be able to test? The steps are:

  1. Delete your samsung TV if you already have it added
  2. Place the folder here: https://github.com/escoand/home-assistant/tree/patch-2/homeassistant/components/samsungtv in your custom_components directory. This is located in your HA config directory
  3. Restart HA.
  4. Add your TV. You should get an authorization prompt on your TV at this stage.
  5. Restart HA and try to control your TV a few times and confirm you don't get any future authentication prompts on the TV

@tulindo Have you seen this?

@stephanmiehe after the restart the problems are gone? That would mean the config entry changes after creating the media player. And after the restart the newly initialized media player takes the right values from the config entry.

However, once that's fixed I ran into another issue with this new component version. The TV will be flooded with token confirmation popups. I suspect the token is not being saved/used correctly. I'm still looking into that but curious if anyone else with a Samsung TV would be able to test?

I've followed your steps and successfully added a Samsung QN75Q7FAM. I can issue commands OK and haven't seen any additional prompts so far.

@snook but the auth request are only gone after HA restart?

@escoand No issues after reboot, can still control the TV OK, no additional prompts.

@snook but before there were?

@escoand No, previously I had the issue at the beginning of this ticket. I've had two other Samsung's working fine, I hadn't ever been able to connect my 3rd Samsung, the QN75. After .107 I was still unable to connect receiving the message "this Samsung TV device is not supported". Adding the files to custom_components as mentioned by @stephanmiehe, I was able to add the TV through discovery and it appears to all be working as expected.

@snook OK, I meant if you needed a restart yo have this TV working correctly?

@escoand sorry but this period I can"t test and develop.
In my TV never saw any confirmation popup

@escoand I did not have to do any restarts in order to get the TV to work OK, everything worked the first time after adding the files to the custom_components directory.

Hardware: Raspberry Pi 4 Model B - 4 GB
Environment: Home Assistant (Hassio)
HassOS 3.12
Home Assistant 0.107

I was able to test this some more today and can confirm that this is an isolated issue. Resetting the TV to factory settings resolved the issue. I’ve tested with 3 different Samsung TV models now and everything works as expected.

To be honest I'm a bit confused. We have an issue but do not know why and what and after a reset it's fixed and we do also not know. Right?

So we can just merge the mentioned PR and it's working afterwards? I not really happy with this situation...

I think we can merge the current PR because to me that is an issue regardless and will prevent a lot of TVs even getting to the access confirmation prompt.

For the second issue (multiple access confirmation prompts) I'm happy to continue to share information here or we can open a new issue with the details. I've only been using the configuration file to declare my TVs since I need WOL functionality. It sounds like @beloso got the issue when using the integration assistant. I'll try that path with my TVs and see if I can reproduce the behavior.

Thanks for fixing this, folks. I installed 0.107.5 today and things are working without any side effects :thumbs_up

I've confirmed your theory @escoand. I've tried it locally with a custom version and for TVs that use port 8002 we never get to that port due to the return when using 8001.

However, once that's fixed I ran into another issue with this new component version. The TV will be flooded with token confirmation popups. I suspect the token is not being saved/used correctly. I'm still looking into that but curious if anyone else with a Samsung TV would be able to test? The steps are:

1. Delete your samsung TV if you already have it added

2. Place the folder here: https://github.com/escoand/home-assistant/tree/patch-2/homeassistant/components/samsungtv in your `custom_components` directory. This is located in your HA config directory

3. Restart HA.

4. Add your TV. You should get an authorization prompt on your TV at this stage.

5. Restart HA and try to control your TV a few times and confirm you don't get any future authentication prompts on the TV

Hi

I wasn't sure whether to respond to this which sounds like the same problem, or open a new issue.

I have added a Samsung TV UE46D7000 to HA and it is working as expected. I had a single prompt on the TV to allow the network remote, which I OK'd. However, I continue to get a 'Sending handshake' entry in the HA log file every 11 seconds. No further prompts are displayed on the TV.

This does not appear to be a problem, other than filling up the log file and of course I'm guessing unnecessary network traffic.

I tried adding the custom_component from the dev branch (core/homeassistant/components/samsungtv/) - not sure if that is any different to the one included with 0.108.4, but it does the same thing.

Many thanks

2020-04-16T09:54:05.015678099Z 2020-04-16 10:54:05 INFO (SyncWorker_18) [root] Sending handshake.
2020-04-16T09:54:16.018059539Z 2020-04-16 10:54:16 INFO (SyncWorker_11) [root] Sending handshake.
2020-04-16T09:54:27.022592474Z 2020-04-16 10:54:27 INFO (SyncWorker_18) [root] Sending handshake.
2020-04-16T09:54:37.020702511Z 2020-04-16 10:54:37 INFO (SyncWorker_16) [root] Sending handshake.
2020-04-16T09:54:48.024214299Z 2020-04-16 10:54:48 INFO (SyncWorker_4) [root] Sending handshake.
2020-04-16T09:54:59.020704606Z 2020-04-16 10:54:59 INFO (SyncWorker_14) [root] Sending handshake.
2020-04-16T09:55:10.016140434Z 2020-04-16 10:55:10 INFO (SyncWorker_17) [root] Sending handshake.
2020-04-16T09:55:21.018907439Z 2020-04-16 10:55:21 INFO (SyncWorker_15) [root] Sending handshake.

@mr-onion-2 This logging is from the underlying external library. First it's missing own package name and also not level INFO imo. Currently we create a new connection to the TV on every update request from HA. There seems to be an API endpoint to request the status without a new connection, but it's atm not used. So we have to life with this logs, for now. Feel free to open a PR.

@escoand I have somewhat similar problem.
i own a Samsung UE50RU7172UXXH. i added the following in configuration.yaml:
samsungtv:

  • host: x.x.x.x(ofcourse i put the IP of the tv here)

this works, but i can't change the name of the device, it's called "Unnamed Device".

so this is when i typed the following in configuration.yaml:
samsungtv:

  • host: x.x.x.x(ofcourse i put the IP of the tv here)
  • name: Samsung_TV

when i save the config, i can't even reboot hass.io. i have te reboot the whole host system.
and when i do, i get the following:

Logger: homeassistant.config
Source: components/samsungtv/__init__.py:16
First occurred: 20:45:07 (1 occurrences)
Last logged: 20:45:07

Unknown error calling samsungtv CONFIG_SCHEMA
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 732, in async_process_component_config
return component.CONFIG_SCHEMA(config) # type: ignore
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 386, in validate_mapping
cval = cvalue(key_path, value)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 205, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 285, in _exec
v = func(path, v)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/src/homeassistant/homeassistant/components/samsungtv/__init__.py", line 16, in ensure_unique_hosts
[socket.gethostbyname(entry[CONF_HOST]) for entry in value]
File "/usr/src/homeassistant/homeassistant/components/samsungtv/__init__.py", line 16, in
[socket.gethostbyname(entry[CONF_HOST]) for entry in value]
KeyError: 'host'

@ruddiee Please try the newest 0.109.0 and the configuration in the web interface. There you should be able to do what you want. Additionally, the YAML config will be deprecated and removed in the future.

Anyway, your post is quite hard to read because you didn't use code formatting.

@ruddiee Despite your post is hard to read I would say you have one dash too much in front of the name. It has to be:

samsungtv:
  - host: x.x.x.x
    name: Samsung TV

@escoand i am using homeassistant 0.109.1

I Will try the following tomorow morning:

​samsungtv​:
  - ​host​: ​x.x.x.x​
    ​name​: ​Samsung TV

@escoand sadly it's still showing up as an unknown device

Have you tried the config via the UI?

that's not possible, when i open the settings of the entity it says the following:
"This entity does not have a unique ID, therefore the settings cannot be managed from the user interface."

I mean remove it from the yaml and get your TV discovered, or add it by hand on the integrations page.

@escoand I removed my settings from configuration.yaml, removed the Samsung TV integration. added the integration again, gave the IP address of the TV (samsung UE50RU7100) and gave it a name. it gave a pop-up on the TV, i clicked allow. It works now :)

thanks!

I have a problem, the integration cannot discover the TV, the unknown device. I tried with another new HA installation and it finds it. Are there any log files to delete? How can I proceed? Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Konstigt picture Konstigt  Â·  3Comments

coolriku picture coolriku  Â·  3Comments

ofuangka picture ofuangka  Â·  3Comments

neonandu picture neonandu  Â·  3Comments

arangates picture arangates  Â·  3Comments