My TV model is KU6400, and the basic commands are working (power on/off, volume and mute). I still don´t know how to create commands, just begging with Home Assistant…
If you have no success try to disable auto discover. I´m not sure, but I think Home Assistant was getting my computer ip (Windows 10) instead the TV ip…
# Discover some devices automatically
discovery:
ignore:
samsung_tv
If everything works you will see a message in your TV asking permission to be controlled by external device.
You can check this configuration in your TV.
Mine is like that: Settings / Network / Expert Settings / Mobile Device Manager / Mobile Notification = First Time Only
Did you ever get this issue working on Hassbian? I am having the same issue as you are.
I’ve confirmed that I can manually use the samsungctl script to connect to my TV and it works great. However, when I try loading Samsungtv through Home Assistant, I have this same websocket import issue, even though I’ve installed websocket-client using pip3.
I’m wondering if it’s same to reload Home Assistant using Raspbian instead.
Well, it seems that I may have spoken too soon. As soon as I posted this, I did some more digging and found the problem, at least for me. I installed Home Assistant using the Hassbian image, rather than the Raspbian Lite image. In looking at the documentation for Hassbian, I had forgotten that Hassbian installs HomeAssistant into a Python virtual environment. Because of this, when I was running sudo pip3 install websocket-client, it was installing websockets for the global python environment, but not specifically for the virtual environment that HomeAssistant was using.
After doing this, I reloaded Home Assistant, I’m no longer getting the websocket import error. Even better, my Samsung TV now responds via Home Assistant!!
i disabled discovery for samsung_tv and added it manualy, changed the port to the newer one and so the on/off state works great but i can’t controll it with hass.io.
from what i read here https://home-assistant.io/components/media_player.samsungtv/, is that we need to do pip3 install websocket-client so i connect with putty and gave this command. Then i get this error: core-ssh:~# pip3 install websocket-client -ash: pip3: not found
i believe we cannot do this with hassio but then how can we have the samsung tv platform working?
I can power it on and off, adjust the volume, mute and unmute. While on Netflix i can use the fast forward and rewind button but the play button doesn’t appear. It does when it’s off… kinda odd.
Model: Samsung 6 Series (60) (UE60KU6000)
configuration.yaml
media_player:
- platform: samsungtv
host: 192.168.129.20
port: 8001
mac: b8:bb:af:de:0f:36
name: Living Room TV
It would be great if we could control the play/ pause too and see on what source the tv is to get some fun automtion like when watching netflix, dim the lights or set a scene!
I have a 2016 Tizen, Model UN65KS850D
using samsungctl from my debian laptop i get the same results as i get from my raspberry pi HA installation. (0.51.2). Which leads me to believe the problem lies with samsungctl and not HA’s integration of it.
~$ samsungctl --host 192.168.22.6 --method websocket --interactive --port 8001
Traceback (most recent call last):
File “/home/root/.local/bin/samsungctl”, line 11, in
sys.exit(main())
File “/home/root/.local/lib/python3.5/site-packages/samsungctl/main.py”, line 101, in main
with Remote(config) as remote:
File “/home/root/.local/lib/python3.5/site-packages/samsungctl/remote.py”, line 10, in init
self.remote = RemoteWebsocket(config)
File “/home/root/.local/lib/python3.5/site-packages/samsungctl/remote_websocket.py”, line 25, in init
self._read_response()
File “/home/root/.local/lib/python3.5/site-packages/samsungctl/remote_websocket.py”, line 67, in _read_response
raise exceptions.UnhandledResponse(response)
samsungctl.exceptions.UnhandledResponse: {‘event’: ‘ms.channel.timeOut’}
I’m a decent tech, but a fairly novice scripter. Anything I can provide to help troubleshoot, i’d be happy to do.
Hi.
I have a Samsung UE55KU6000 and Home Assistant (HASSBIAN, not HASS.io)
I had the same problem, ImportError: No module named ‘websocket’
We are working in a virtualenv and the command sudo pip3 install websocket installs the module in the system instead of the virtualenv. If I activate the virtualenv and try to install the module I get a “permission denied”.
Inside de virtualenv with sudo the module is installed again in outside of the virtualenv.
I got it working:with the next steps.
Connect to the virtualenv:
source /srv/homeassistant/bin/activate
Set permissions for the user ‘pi’ so we can install without sudo.
sudo chown pi:pi -R /srv/homeassistant/lib
sudo chown pi:pi -R /srv/homeassistant/include
Set permissions back for the user ‘homeassistant’
sudo chown homeassistant:homeassistant -R /srv/homeassistant/lib
sudo chown homeassistant:homeassistant -R /srv/homeassistant/include
You can check if module is properly installed in your virtualenv
pip3 freeze
If you have more errors due to permissions in another folder, chown is your way to go.
I hope this helps someone, cheers.