Websocket in Hass.io

The Web ui still shows:

after pip install websocket-client

@Jonny_Davey yes, exactly. :smiley:

Has anyone managed to get this working. I have a samsung TV and the only way to turn it on is with websockets. I had this running on ubuntu and now just moved to a pi with hassio and cant get it to work.

Another +1 here - I’ve configured my Samsung TV as per the following:

- platform: samsungtv
  host: 10.0.1.199
  port: 8001
  mac: 84:a4:66:9:3:1b
  name: "Lounge Room TV"

The on/off control doesn’t work however, I suspect due to the missing websockets side of things.

Happy to provide more debugging if necessary - only 48 hours new to Hass.io so far however so still quite new to it all!

I had a Samsung TV working, it was on the first attempt to use HASSIO, but I had to accept the use on the Samsung TV. I am now back home (different Samsung TV) and I can’t control the TV from HASSIO.

In the information on the component it state that "When the TV is first connected, you will need to accept Home Assistant on the TV to allow communication."

How can you accept it on the TV if you miss it when you first start HASSIO? Has this been an issue for others?

I did use https://raw.githubusercontent.com/home-assistant/home-assistant-dev-helper/master/ha-websocket.html
Create and save as .html file and run it. Result is:

Connection to Home Assistant over WebSocket

Socket closed

sorry don’t get it, what am i looking at? :smiley:

Click on link. Save code from browser as .html file.
Double click to run same file and you will see output.

Yes i have done that and got the same output, and now. :wink:

Socket closed.

Hi @loki
We’re you able to get this working?

I’m wanting to get my Samsung working on hassio too

Nope, still nothing.

Any updates here with Samsung TV’s. I have a UN65KS8000 I would like to get working with HASSIO. I report all of the issues everyone else above have mentioned.

I have found the solution to the problem.

To correctly install websocket-client you have to follow the following steps:

sudo systemctl stop [email protected]
sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
pip3 install websocket-client
exit
sudo systemctl start [email protected]

and with that it will be properly installed and will work correctly.

I hope I do not bother to relive the thread.

regards

Are you using Hass.io or full home assistant? I didn’t think any of your commands would work in hass.io

1 Like

This is the frustrating part of home assistant. I am running Hass.io through virtual box and found this as well as some other ‘apps’ that just wont work. Installed on windows through python - and it works. All a little confusing.

Hi, did anyone get this to work? I am also running hassio and I bought a samsung TV that I cannot control…

Anything yet on this? No websockets

For those that have just ran that linked HTML code above as-is, and it failed… there’s a reason: Authentication: https://developers.home-assistant.io/docs/api/websocket#authentication-phase
Just for a test, comment out the “ws.send” and ONLY send the "type": "<token>" with “ws.send”.

Now the output should be

{"type": "auth_ok", "ha_version": "<version#>"}

{"type": "auth_required", "ha_version": "<version#>"}

Connected...

Now you’ll see you’re authenticated and can continue forth. (I’m just starting out and discovered this)

Can you paste the full line you had success with? Cause I don*t get it working as you described (And I guess maybe I don’t use it properly!)