HA + Samsung Tv UE40H6400 doesn't work

Same issues in my log file i found this

17-03-27 10:35:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.tv_salotto fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/samsungtv.py", line 120, in update
    return self.send_key('KEY')
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/samsungtv.py", line 133, in send_key
    self.get_remote().control(key)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/samsungtv.py", line 126, in get_remote
    self._remote = self._remote_class(self._config)
  File "/root/.homeassistant/deps/samsungctl/remote.py", line 10, in __init__
    self.remote = RemoteWebsocket(config)
  File "/root/.homeassistant/deps/samsungctl/remote_websocket.py", line 21, in __init__
    self.connection = websocket.WebSocket()
TypeError: __init__() missing 3 required positional arguments: 'environ', 'socket', and 'rfile'

Same problem with UE40H5300.
When i put the option discover and i don’t put any ip or mac address, i see in the log the discover of the tv and the same image you post but nothing works.
When i put the ip mac address, the tv is no longer recognized by HA.
In another tv i had, the UE32H5300 it works. The TV software is different. As comparative, it seems i have the same problem with the samsung software Smart view for android phones.
In my android phone, if i use Youtube or in the video, the option share » view content on »» it works well in the two tv’s.

same on UA65JS9000. I can get the state displayed using port 8001 and websocket, but nothing much after that.
I have even tried running barebones samsungctl. Doesnt seem to work.

Since it doesn’t work, I wish it wasn’t there. Is there a way to turn off this auto-discovery?

I have the same problem with UE46D6505.
It works on openhab, if anybody want to see the openhab “component” I can try to find a link for it.

I have the same problem with UA65JS9000.
Anyway, here’s the OpenHab Samsungtv addon

There is another .NET project that can control samsung tvs.


I’ve tested this with my TV and it works.

Indeed ue65hu7500 is not working and it looks like all UE systems are not working.
Iam using Openhab at the moment and that is working fine with my TV

It looks that the “peering” goes wrong.
Anyone got the 1ste part to work?
"accept Home Assistant on the TV to allow communication"

Thanks,
Gerrit

Just close it and wait 10 minutes, it’s OK.

Not just UE models. I have a UA60H6400 and I have the same problem. Though my UA46D6600 works fine.

From what I can gather, it looks like everything around the H series is affected. From memory, these are from 2014. Models from before and after that time frame seem to be working fine.

How did you guys installed the websocket client? With which user and what command? I am running HA 0.52 on Python virtualenv.

UE55H7000 not working either, control via HDMI CEC and Logitech Harmony is possible though

Same issues on a Samsung UN40KU6300.

Hi,
Any updates on this topic?

I have almost the same issue as @Stefan609.
My TV (UE48H6500) is not working wit HA. nmap shows same results and discovery component finds the TV on port 7676. I have to manually play with smasungctl (both legacy and websocket methods) to check the communication flow. There are 2 things obvious with this model:

  1. It doesn’t use default port (55000) - which makes me wonder which method should i use
  2. something is going on with the authentication process i guess, since i don’t see the TV showing pin code.

To get your older TV running set

timeout: 3

I have a UE40D5500 model, and after i put timeout TV starts to be recognized and i can turn it off, change volume but it’s impossible to turn on :slight_smile:

2 Likes

I have a UE40ES6300.
Worked fine in 0.59.
Upgraded to 0.62 and it was just showing as offline.
Added timeout 3 and it works again.

media_player.turn_off used to work for me in .59 but no longer works in .61. Turn on works as expected however.

Ah. Solved the issue for me to. The Samsung remote has been working with my old (2012-ish) non-Smart tv until I upgraded to 0.6x. Adding “timeout: 5” worked for me.

Thanks!

Been trying to get this to work with my UE49KU6400 and finally managed to get it to work. The steps to get thos to work were as follows:

  • Install the websocket-client sudo pip3 install websocket-client (Whilst I’m not sure it is necessary or not as well as doing this in the virtualenv I also installed it on the main setup).
  • Set the configuration to the following:

    -platform: samsungtv
    host: 192.168.1.x
    port: 8001
    name: ‘Bed Room - Samsung TV’
    mac: xx::xx:xx:xx:xx
    timeout: 5

  • Due to having made a lot of changes to my system I then rebooted the home assistant server (In my case a RPI 3 sudo reboot now). However you will probably get away with just restarting the Home-Assistant service (sudo service home-assistant@pi restart)

So now I can do the following:

  • Turn Off the TV if already on (However the TV always shows as On)
  • Use the Next and Previous Track Buttons (These allow you to navigate some menus and also skip forward and back in cetain apps but not all)
  • Turn the Volume Up, Down and Mute the Volume.

That’s all I’ve managed so far. But thought this may help a few others that have been struggling to get it to work at all.

I had mine working fairly well (UN40EH5300 and a UN55MU8000) using this code with my Echo:

I currently have it commented out in my config but the service still runs (and paired to my Echo) so I can say things like: Alexa, TV off (or) Alexa, TV on – and it works. Maybe something in here might help someone more savvy than me figure out how to talk to these devices (as I had similar results in HA as posted here) with the python code linked above.