Core: Samsung TV 2016 No longer working in 0.63

Created on 11 Feb 2018  Â·  31Comments  Â·  Source: home-assistant/core

Just updated and restarted homeassistant 0.63.
Samsung TV (2016 model) is not working after update.
Was fine in previous releases.
Restarted homeassistant again to be sure, still not working.
TV shows as OFF even when on.
Power button in homeassistant does nothing.
Not seeing any error in home-assistant.log

Rolled back to 0.62.1 and is working normally.
(Windows 10, Python 3.6 64bit)

All 31 comments

I'm seeing the same issues for 0.63 on CentOS-7 with Python 3.6 for Samsung TV's.

Also seeing "FileNotFoundError: [Errno 2] No such file or directory: 'ping': 'ping'" for Device_Tracker for these and others, plus Cookie issues for ZoneMinder. Seems a lot of things just got broke so there's probably a simple common cause somewhere (hopefully).

I can not say anything about ZoneMinder but for the samsung TV there is a change in how it detects ON/OFF.

Hackashaq666 Could you please open a terminal and ping your TV:
ping _ip_

When I ping TV when off I get "Destination host unreachable"
When I ping TV when on I get reply "bytes=32 time<1ms TTL=64"

Component is working after rollback to homeassistant 0.59.2 and websocket-client 0.43.0.

could you also run which ping

Mine is behaving unstable with 0.63. Shows tv as off/on without it being turned on/off. Worked flawlessly with 0.61

config:

- platform: samsungtv
  host: 192.168.66.32
  name: Stue TV
  timeout: 9

state:

19:58:51 <HA1337> TV just changed from on to off
19:58:56 <HA1337> TV just changed from off to on
20:24:10 <HA1337> TV just changed from on to off
20:24:15 <HA1337> TV just changed from off to on

sorry “which ping” is not valud in windows

The problem is that ping is not working the implemented way on Windows, in CentOS there is something wrong with PATH so the script do not find ping command.

We could go with this solution: #11179

Or we could write a pure python ping

I can use homeassistant 0.63.3 if I downgrade the samsung.py component to earlier version.

So I have HomeAssistant(0.63.2) and the following configuration for my Samsung Q6F (2017 model):

platform: samsungtv
host: 192.168.1.XX
port: 8001
name: TV
timeout: 5
mac: cc:XX:XX:XX:XX:XX

I can only see the status (ON or OFF) and the only interaction working(random) it’s Turn ON the TV, the remaning options doesn’t work, like: Turn OFF, volume UP/DOWN, change channel....
I cannot really tell if it was working or not before with this new 2017 model, but I have other Samsung TV from 2014, and that TV used to work in an older homeassistant build, but now it's not working either with same behaviour.

@tiagoroxo My guess is that your issue is likely that you are missing the 'websocket-client' library that is needed for the newer samsungs. Its not being installed automatically like its should.

The On\Off state reporting and "turn on" functions work because they don't use functions from that library. Everything else does however.

thanks for your feedback. I can give a try and install the correct version of the 'websocket-client' library, if you can give me the instructions, and then I will let you know the outcome.

My 2017 UE49MU6179 Tv can only be turned on using Home Assistant, but neither turned off or controlled otherwise using Home Assistant 0.63.0, 0.64.0 or 0.64.1 .

I am using the provided Docker container on a Raspberry Pi3. It it required to bind the container to the Raspberrys network (--net=host or network_mode: host (for Docker Compose)), otherwise not even turing it on works.

The configuration is identical to tiagoroxo, except for the IP address of course.

@tiagoroxo

Assuming you’re not using HassIO, SSH into the Pi and run these
sudo su -s /bin/bash homeassistant
cd /srv/homeassistant
source bin/activate
pip3 install websocket-client
(then restart homeassistant or pi)

@m0wlheld I'm not sure how docker works, sorry.

I put in a request to fix this here. Looks like it'll maybe be in 0.64.2 release
https://github.com/home-assistant/home-assistant/pull/12769

@Murph24
Thanks for your feedback.
So I updated to the latest Home Assistant build (0.64.3) available in hassbian and executed the following:

pi@hassbian:/home $ source /srv/homeassistant/bin/activate
(homeassistant) pi@hassbian:/home $ pip3 install websocket-client
Requirement already satisfied: websocket-client in /srv/homeassistant/lib/python3.5/site-packages
Requirement already satisfied: six in /srv/homeassistant/lib/python3.5/site-packages (from websocket-client)
(homeassistant) pi@hassbian:/home $ deactivate
pi@hassbian:/home $ sudo reboot

After the changes, now I got a notification on the TV, if I wanted to accept the remote controller or not, I have accepted it, and now, I have more control but the control it's "erratic".
Example:
Reboot the HA and TV, and tried the following:

  1. In HA Dashboad I pressed "TURN OFF" - The TV turns off, but in the HA Dashboard I see that the TV remanins with the satus ON for a couple of seconds (+/- 15 ?!).
    capture1
  2. I press on "TURN ON" - The TV turns on, and in HA dashboard, it takes 10 seconds(+/-) to update the status from OFF to ON.
  3. Waited 1 minute(+/-) and tried to TURN OFF again the TV, and nothing happened.
  4. Waited 1 more minute(+/-) and tried to TURN OFF again the TV, and nothing happened.
  5. If I open the TV Card, and play with the volume settings(UP/DOWN), after 2 attempts, I can control the volume UP or Down, mute, and then I again have control to Turn OFF the TV...
    capture2

But this is very "erratic"... it's not consistent the behaviour.

Just to remind that my Tv it's the following: Samsung Q6F (2017 model) with Tizen OS.
And and I have the following configuration:

platform: samsungtv
host: 192.168.1.XX
port: 8001
name: TV
timeout: 5
mac: cc:XX:XX:XX:XX:XX

My 2017 UE49MU6179 Tv can only be turned on using Home Assistant, but neither turned off or controlled otherwise using Home Assistant 0.63.0, 0.64.0 or 0.64.1

To correct myself: With HA 0.64.3 I can

  • turn the TV on (but not off)
  • control the TV's volume (up/down/mute)

No more actions are provided by the UI.

I have also been seeing issues related to ping with the samsungtv component. I started noticing them in 0.63.2 (though they may have been around longer) and still notice them in 0.64.3.

This is on a Mac Mini. Ping is on my machine. Its parent directory is in my PATH. I seem to be running hass as the same user that has access to the binary.

$ which ping
/sbin/ping

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

$ whoami
broox

$ ps aux | grep hass
broox            2224   0.0  0.0  2441988    472 s000  R+    1:58PM   0:00.00 grep hass
broox             658   0.0  2.6  2735344 110888   ??  S     9:56AM  19:15.11 /usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python /usr/local/bin/hass

I am running hass using the autostart script: hass --script macos install

Traceback:

Update for media_player.samsung_tv_un60ks8000 fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/media_player/samsungtv.py", line 136, in update
    stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1333, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'ping'

Things have changed with 0.64.3 or my setup. My 2017 UE49MU6179 can currently be

  • turned on and off (after the the CI module has been initialized which takes about 15sec)
  • muted, volume turned up and down

Obviously, the skip forward and back actions are transmitted to the Tv, but have no meaning when watching LiveTV. They could cause some action when using a audio or video app like Netflix or Spotify, haven't tested it yet.

For me, every action that is provided by the UI is working now.

Hi,
I have a Samsung UE40MU6470 and with after the upgrade of Hass.io (v0.64.3) I'm noticing that many times the commands that I ask are not executed: I have to switch off and switch on the TV to be able to restore control from HA.

PS: Do you know how I can change the volume of the TV via google home? With it for now I can only turn on and off the TV.

Thanks

I now also have intermittent responses with calling services to my Samsung TV (UA65KS8000)

-- My config --

media_player:
  - platform: samsungtv
    name: Samsung TV
    host: 192.168.0.14
    port: 8001
    mac: f8:3f:51:22:78:1c
#timeout: 3

New to this (please don't flame) so not exactly sure what I was doing but after finding running the following in the console (HASS) I was then able to control the TV (Vol up/down, mute, On/Off)

apk add --update python
apk add --update py-pip
pip install websocket-client
apk add --update python3
pip3 install websocket-client

But just when i thought it was all working I ended up in the same boat as "tiagoroxo" where unless I sent a few dummy "vol up" before the turn off command it refused to turn execute.

Currently running over WiFi so unsure if that contributes to the problem but found in another thread that i may need to add: "# get_status_via_rest: True" to wake the newer Samsung TV Wifi Sleep instead of the dummy actions

Testing now...

Update: No change :(

I don't think this is a wifi problem.

My install is a hardwired old C-series to a hardwired Hass.io instance on Ubuntu. I have a similar problem as others: The first time Hass comes up, I can power off the TV. Forever after that, I can't power it down without sending a random set of (mute or volume). If I restart the hass docker and then tell it to power off the TV, it will every time.

@broox I had this problem on 0.65.4 and upgrading to 0.65.5 just fixed it.

I have also updated but still the same problem, restart HA and it works again for one off/on cycle before needing to either reset HA or spam volume Up and down prior to sending another off command. :(

Yep - still broken here on older C-series as well.

And I haven't found a pattern to what it takes to get it working again... mute does on occasion, but more often than not, it doesn't. This most recent time, I had to hit volume up twice. On a previous attempt, volume up didn't work at all to reawaken the functionality.

Is there a way to just turn off the logs? Eeeh

just updated to 66.1 hoping to fix this issue.. unfortunately still the same as succinctly reported by Meesen0743 "...restart HA and it works again for one off/on cycle before needing to either reset HA or spam volume Up and down prior to sending another off command" additionally on my system (Pi running Hassbian) Turning ON always works

Previously Only Volume UP/Down & Off commands worked (continuously)

I have a fix to the ping issue. In the file samsungtv.py which (for me on my Mac) is located at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/media_player/samsungtv.py I edited the following line:
_ping_cmd = ['ping', '-n', '-q', '-c1', '-W1',
to say
_ping_cmd = ['/sbin/ping', '-n', '-q', '-c1', '-W1',
and all the log errors about ping not being found are fixed.

I too am noticing inconsistent on/off controls. Seems to work like once if I restart HA. I'm running hassbian latest (66.1) with a samsung UN60KS8000

After upgrading to newest homeassistant version, I came back here searching for a solution, only to see my solution above still works. How does one fix this?

Here's a more permanent solution for us on macOS:
sudo ln -s /sbin/ping /usr/local/bin/ping
it links the ping binary (normally in /sbin/ to /usr/local/bin, which is within the $PATH)

Come here to echo that I also encounter the same issue as what @tiagoroxo, @EdoMax9, and @Meesen0743 described. Power Off does not work unless I spam a couple of volume up and volume down commands via the UI.

I believe I found the root cause and just put up a pull request for the fix: #14587. It'd be great if you guys can help verifying the fix as I have only one TV model to test with.

The pr looks real nice, that will make it more reliable for sure!

Den tis 22 maj 2018 20:40Ong Vairoj notifications@github.com skrev:

Come here to echo that I also encounter the same issue as what @tiagoroxo
https://github.com/tiagoroxo, @EdoMax9 https://github.com/EdoMax9,
and @Meesen0743 https://github.com/Meesen0743 described. Power Off does
not work unless I spam a couple of volume up and volume down commands via
the UI.

I believe I found the root cause and just put up a pull request for the
fix: #14587 https://github.com/home-assistant/home-assistant/pull/14587.
It'd be great if you guys can help verifying the fix as I have only one TV
model to test with.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/12302#issuecomment-391097645,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMaamulAe264ilAl1tdikd4ykU-0ml0ks5t1FuKgaJpZM4SBWNS
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheZoker picture TheZoker  Â·  3Comments

MartinHjelmare picture MartinHjelmare  Â·  3Comments

Konstigt picture Konstigt  Â·  3Comments

piitaya picture piitaya  Â·  3Comments

moskovskiy82 picture moskovskiy82  Â·  3Comments