Control newer Samsung TVs


#83

@chrisaxe21 Can you share the full code for the remote?


#84

Has anyone done any more testing on the 2017 tvs? I have a UN55NU6950/6900 and all I’m able to do is turn on the tv from Homeassistant. No other functions. Once you turn the tv on it goes from off to unknown, then kinda flips between unknown and off even when the tv’s on.


#85

Hi MrUart232.

I have a Samsung TV 2014 H Series and your code is the only one that works for me. Have you managed to finish it? I mean, get it works ‘turn off’ and ‘turn on’. It would be fantastic.

Thanks


#86

Hey,

I tried the above samsung.py code which seems to have done the trick. At least for the status and the volume.
I do also see the correct source, but I still can’t change source nor can I turn off the tv or on.
My TV is a: UE55H6675

Anyone having any experience with this model?


#87

A lot of users have issues with their samsung tv’s (including myself)

On Github kdschlosser is working on a fix.

Keep an eye on this issue on github.


#88

Thanks.

He is working on it hard. Hope he repair the component for encrypted Samsung TVs :slight_smile:


#89

I am in the same situation that you. I control status and volume using the custom_components/media_player/samsungtv.py and the turning on/off via hdmi_cec.

I hope to control everything using only one component some day :slight_smile:


#90

How have you achieved to turn it on and off with that?


#91

It’s easy. You must connect the RPI to your TV by HDMI and setup de hdmi_cec component in Home Assistant.

After that, you can send ‘hdmi_cec’ commands to your TV, like turning on/off

action:
  service: hdmi_cec.power_on

More info here.


#92

Arh yes, that makes sense. I thought you could without.
One thing I can’t get working is the source change.

Before I was using openhab and had that part working too. I really hope I can find a solution to get that working. I was using it in a rule so that my TV switches from one source to another, showing my surveillance cameras when the doorbell rang. Unfortunately that’s no longer possible :frowning:


#93

Anyone else not seeing their tv’s updating after the latest 88.1 update?

This is the error I see in the log:

Error loading custom_components.media_player.samsungtv. Make sure all dependencies are installed

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 147, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/config/custom_components/media_player/samsungtv.py", line 13, in <module> from homeassistant.components.media_player import ( ImportError: cannot import name 'SUPPORT_TURN_OFF' from 'homeassistant.components.media_player' (/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py)


#94

I get “ms.channel.unauthorized” when connecting to Samsung TV UE55NU6035 and I haven’t been able to figure it out.

Here are the logs when pressing the on/off button in the UI:

2019-03-07 16:38:59 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.4552020656] {'event': 'ms.channel.unauthorized'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1133, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1155, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 188, in handle_service
    self._platforms.values(), func, call, service_name
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 278, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 292, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/samsungtv.py", line 214, in turn_off
    self.get_remote().close()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/samsungtv.py", line 138, in get_remote
    self._remote = self._remote_class(self._config)
  File "/Users/henrik/.homeassistant/deps/lib/python/site-packages/samsungctl/remote.py", line 11, in __init__
    self.remote = RemoteWebsocket(config)
  File "/Users/henrik/.homeassistant/deps/lib/python/site-packages/samsungctl/remote_websocket.py", line 30, in __init__
    self._read_response()
  File "/Users/henrik/.homeassistant/deps/lib/python/site-packages/samsungctl/remote_websocket.py", line 72, in _read_response
    raise exceptions.UnhandledResponse(response)
samsungctl.exceptions.UnhandledResponse: {'event': 'ms.channel.unauthorized'}
2019-03-07 16:39:00 INFO (SyncWorker_6) [homeassistant.components.media_player.samsungtv] TV is powering off, not sending command: KEY

#95

I have been following

also but have seen he has stopped. However I also do own an Athom Homey and for that device somebody managed to write an app. For the code see: https://github.com/balmli/com.samsung.smart/tree/cd455cbb5cb27988e7e32e2489cf604e7135843d. Possibly somebody could use this to create a working Hass module.