Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.81.0] Samsung TV not working #17802

Closed
Gio76 opened this issue Oct 26, 2018 · 223 comments · Fixed by #24716
Closed

[0.81.0] Samsung TV not working #17802

Gio76 opened this issue Oct 26, 2018 · 223 comments · Fixed by #24716

Comments

@Gio76
Copy link

Gio76 commented Oct 26, 2018

Home Assistant release with the issue:
0.81.0b2

Last working Home Assistant release (if known):
0.80.3

Operating environment (Hass.io/Docker/Windows/etc.):

  • Hass.io on a Raspberry Pi 3 Model B (32gb SD)
  • Hass.io supervisor 138
  • HassOS 1.11

Component/platform:
samsungtv

Description of problem:
Media player not working under 0.81.0b2. It shows off although the TV is on. Reverted back to 0.80.3 and everything started working again. No specific errors in the log.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

media_player:
  - platform: samsungtv
    host: 192.168.86.67
    name: '[TV] Bedroom'
    mac: [REDACTED]

@Hackashaq666
Copy link
Contributor

Hackashaq666 commented Oct 26, 2018

Similar problem here, 2016 model year tv, homeassistant 0.81.0b2, raspberry pi 3b+, hass-os.
Homeassistant frontend shows as TV as "unknown" instead of "on".
I can adjust volume, and turn off from the frontend.
When TV is off, the frontend correctly shows TV as "off", however I cannot turn on from frontend, and log shows samsungtv component is taking longer than expected.
Reverted to 0.80.3, and all functions, front end display work as expected.

@arsaboo
Copy link
Contributor

arsaboo commented Oct 26, 2018

experiencing the same issues...not sure what changed

@Gio76 Gio76 changed the title Samsung TV not working on 0.81.0b2 [0.81.0] Samsung TV not working Oct 27, 2018
@Gio76
Copy link
Author

Gio76 commented Oct 27, 2018

updated to 0.81.0 and the issue is still there

@Murph24
Copy link

Murph24 commented Oct 27, 2018

@Gio76

I'm having this issue as well. Unfortunately, it looks like this is a TV firmware update problem. Samsung may have broke or disabled the websocket control. Is your TV on the new firmware 1250?

Here is the underlying library HA uses:
Ape/samsungctl#93

@RRacer
Copy link

RRacer commented Oct 27, 2018

I use the Samsung TV component to turn on or off a few lights based on the state of the TV.
When I updated to 0.81.0 the automation will not trigger.
Updated from .80.2 where it was working.
Using an UE65KS7005.
Downgraded to 0.80.3 and it started working again.

@Gio76
Copy link
Author

Gio76 commented Oct 28, 2018

@Murph24

I'm currently on 1530. If they disabled the websocket that would explain why I don't get a prompt from the TV to allow access to external devices. That sucks, I relied heavily on this components for automations

@Gio76
Copy link
Author

Gio76 commented Oct 28, 2018

@Murph24

I actually don't think the TV firmware is the culprit of the issue. In fact I just downgraded to 0.80.3 and everything is working fine. For reference my TV is a 2015 model: UA55J6200

@Tacchi1983
Copy link

Tacchi1983 commented Oct 28, 2018

I have the same problem. When tv is on the state reports as unknown. In 0.80.3 everything is fine. So the problem isn't a firmware update by samsung. Is it still the same with 0.81.1 ? Hopefully there is a solution because i have few automations too with that

@kennedyshead
Copy link
Contributor

There was a change in 0.81 where we removed the ping-check and started sending empty key to determine if the TV is on, this was done due to the fact that a TV in standby mode would answer to ping command and therefor never off.
There where also a change to use unknown rather than on, the frontend did not display play/pause in on mode.

I think we can resolve the "off"-bug if I could get someone to run a couple of scripts on broken system.

@Tacchi1983
Copy link

Tacchi1983 commented Oct 28, 2018

My tv reports always correctly as off in standby mode. Also the ping components report as off. I dont have the off bug in 0.81, only the unknown. Hopefully u can change the unknown state. Grtz

@Gio76
Copy link
Author

Gio76 commented Oct 28, 2018

@kennedyshead

Anything I can help with?

@pablolassalle
Copy link

There was a change in 0.81 where we removed the ping-check and started sending empty key to determine if the TV is on, this was done due to the fact that a TV in standby mode would answer to ping command and therefor never off.
There where also a change to use unknown rather than on, the frontend did not display play/pause in on mode.

I think we can resolve the "off"-bug if I could get someone to run a couple of scripts on broken system.

@kennedyshead

Me too, if I can help running some script or test, please tell me. My TV is a J5500 from 2015.

@arsaboo
Copy link
Contributor

arsaboo commented Oct 28, 2018

I have NU8000 and seeing the same issue. Let me know if there is anything that I can help with.

@Devqon
Copy link
Contributor

Devqon commented Oct 28, 2018

Also having issues, cannot turn on the TV, and when it is on the state is 'unknown'

@kennedyshead
Copy link
Contributor

@Gio76 If you try running samsungctl --host 192.168.0.10 --name myremote KEY and give me that output That is if you have the always off problem.
For the turn on problem I think its because it does not support wake on lan.

@PDekker
Copy link

PDekker commented Oct 28, 2018

I can confirm this issue. When the tv is on the state reports unknown. It is not due to a firmware upgrade (d8000 model)

Issue originated in 81.0

@tmonck
Copy link
Contributor

tmonck commented Oct 28, 2018

Not sure if this will help but this is the error from my logs. I am having the same issue that I can't mute/unmute, turn on, or turn off. The tv is a MU8000 and all of those commands were working in .80.3

Update for media_player.samsung_tv_remote fails
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/media_player/samsungtv.py", line 124, in update
self.send_key("KEY")
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/media_player/samsungtv.py", line 145, in send_key
self.get_remote().control(key)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/media_player/samsungtv.py", line 130, in get_remote
self._remote = self._remote_class(self._config)
File "/usr/local/lib/python3.6/site-packages/samsungctl/remote.py", line 11, in init
self.remote = RemoteWebsocket(config)
File "/usr/local/lib/python3.6/site-packages/samsungctl/remote_websocket.py", line 30, in init
self._read_response()
File "/usr/local/lib/python3.6/site-packages/samsungctl/remote_websocket.py", line 67, in _read_response
response = self.connection.recv()
File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 298, in recv
opcode, data = self.recv_data()
File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 315, in recv_data
opcode, frame = self.recv_data_frame(control_frame)
File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 328, in recv_data_frame
frame = self.recv_frame()
File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 360, in recv_frame
return self.frame_buffer.recv_frame()
File "/usr/local/lib/python3.6/site-packages/websocket/_abnf.py", line 334, in recv_frame
frame.validate(self.skip_utf8_validation)
File "/usr/local/lib/python3.6/site-packages/websocket/_abnf.py", line 149, in validate
raise WebSocketProtocolException("Invalid close opcode.")
websocket._exceptions.WebSocketProtocolException: Invalid close opcode.

@tmonck
Copy link
Contributor

tmonck commented Oct 28, 2018

@kennedyshead I'm also willing to run scripts to help

@Gio76
Copy link
Author

Gio76 commented Oct 29, 2018

@Gio76 If you try running samsungctl --host 192.168.0.10 --name myremote KEY and give me that output That is if you have the always off problem.
For the turn on problem I think its because it does not support wake on lan.

This is the output:

Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl==0.7.1', 'console_scripts', 'samsungctl')()
  File "/Library/Python/2.7/site-packages/samsungctl/__main__.py", line 110, in main
    with Remote(config) as remote:
  File "/Library/Python/2.7/site-packages/samsungctl/remote.py", line 9, in __init__
    self.remote = RemoteLegacy(config)
  File "/Library/Python/2.7/site-packages/samsungctl/remote_legacy.py", line 22, in __init__
    self.connection.connect((config["host"], config["port"]))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 61] Connection refused

@Hackashaq666
Copy link
Contributor

@Gio76 If you try running samsungctl --host 192.168.0.10 --name myremote KEY and give me that output That is if you have the always off problem.
For the turn on problem I think its because it does not support wake on lan.

Hi, can you clarify this a bit? Are you saying certain TV's don't support wake on lan or the updated samsungtv component doesn't support wake on lan?

As I understand it, the old component used wake on lan successfully to turn on TV if necessary.

@kennedyshead
Copy link
Contributor

@Gio76

  1. is 192.168.1.10 the ip of your TV? (just making sure ;) ).
  2. Is this in ON or OFF mode?

@kennedyshead
Copy link
Contributor

and also, try setting the port to 8001 in yaml config.

media_player:
  - platform: samsungtv
    host: 192.168.86.67
    port: 8001
    name: '[TV] Bedroom'
    mac: [REDACTED]

@Gio76
Copy link
Author

Gio76 commented Oct 29, 2018

@Gio76

  1. is 192.168.1.10 the ip of your TV? (just making sure ;) ).
  2. Is this in ON or OFF mode?
  1. My TV's IP is different. I have of course updated the command line when testing:
    samsungctl --host 192.168.86.67 --name myremote KEY
  2. You mean if the TV was on or off when I run the command? The traceback I previously sent you, was executed with the TV ON. If the TV is OFF (stand-by) I get this instead:
Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl==0.7.1', 'console_scripts', 'samsungctl')()
  File "/Library/Python/2.7/site-packages/samsungctl/__main__.py", line 110, in main
    with Remote(config) as remote:
  File "/Library/Python/2.7/site-packages/samsungctl/remote.py", line 9, in __init__
    self.remote = RemoteLegacy(config)
  File "/Library/Python/2.7/site-packages/samsungctl/remote_legacy.py", line 22, in __init__
    self.connection.connect((config["host"], config["port"]))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 60] Operation timed out

and also, try setting the port to 8001 in yaml config.

media_player:
  - platform: samsungtv
    host: 192.168.86.67
    port: 8001
    name: '[TV] Bedroom'
    mac: [REDACTED]

Port 8001 has never worked for me, even when the component used to actually work (prior to 0.81.0). If the TV is OFF (stand-by) is correctly shows ass off, however if the TV is ON the entity shows as unknown

@kennedyshead
Copy link
Contributor

kennedyshead commented Oct 29, 2018

Unknown is unfourtunatly the new ON mode, it will give you the paus/play buttons.

Test this file as a replacement for components/media_player/samsungtv.py in your installation:
https://gist.github.com/kennedyshead/f37d8e3194343594eacc6cdb22fc5c41
@Gio76

@Gio76
Copy link
Author

Gio76 commented Oct 29, 2018

@kennedyshead

Sorry to the silly question, but since I am using Hass.io, do I create the folders components/media_player/ inside config?

@Devqon
Copy link
Contributor

Devqon commented Oct 29, 2018

Unknown is unfourtunatly the new ON mode, it will give you the paus/play buttons.

Test this file as a replacement for components/media_player/samsungtv.py in your installation:
https://gist.github.com/kennedyshead/f37d8e3194343594eacc6cdb22fc5c41
@Gio76

This is correct, I read it in the release notes of 0.81.0. Though I find it more a weird workaround.
See #6969

@kennedyshead
Copy link
Contributor

Oh... hm sorry, I have 0 experience with Hass.io... This file will show you the correct status for the TV as far as I can tell from your stacktrace.
You should enable anynet allshare what ever on the TV and it will work as intended anyway.

@kennedyshead
Copy link
Contributor

@Devqon I think its a bit weird to, but I have 0 knowledge of the frontend code and It will do until that is fixed (if it gets a fix). We should create an issue for it

@Answer-1
Copy link

@byackee
Copy link

byackee commented Oct 15, 2019

I just recently bought a new Samsung UA65RU7100W and was really hoping to get lucky with this integration.
Unfortunately it didn't come up in any auto-discovery so I then went to manually enter the info in configuration.yaml
What I found works was

  • WOL
  • power state (if using port 8001.)

I changed the port to 8002 but that broke the power state and there was no other bits working either.

I am using Home-assistant Docker container and it didn't even give me the authorization message on the TV so I did a wget from my docker host wget http://xxx.xxx.xxx.xxx:8001 and then found that this gave me the authorization message on the TV. I accepted this but still no luck. the media controls come up with error {'event': 'ms.channel.unauthorized'} each time.

If I browse to http://xxx.xxx.xxx.xxx:8001 with an approved IP it now gives me a 401 error. Googling hasn't helped but I am guessing that I need to have some sort of username and password for the TV?
I believe this could be the missing bit to make this module work but I can't be certain. hopefully this helps someone else in troubleshooting and resolving this issue.

Hi,

I have exactly same on Samsung The Frame 2019

@xchwarze
Copy link

xchwarze commented Oct 17, 2019

Hello!
I use this fork https://github.com/xchwarze/ha-samsungtv-custom/releases in 2016+ tv
All TizenOS tv should work

@AlexeyUkolov
Copy link

AlexeyUkolov commented Oct 17, 2019

Have the same issues with 2017 UE49MU9000 TV.
Using this fork [https://github.com/xchwarze/ha-samsungtv-custom/releases] : I can only turn the TV on from HA, but after that the status of device remains "Off" and nothing more working. I even can't turn the TV off.

Tried to add the TV through SmartThings. In this case I get a switch, that only allows me to turn the TV off.

So using these both methods I can only turn the TV on and off through 2 different entities...

@xchwarze
Copy link

@AlexeyUkolov Sorry i dont upload all files
try this https://github.com/xchwarze/ha-samsungtv-custom/releases/tag/v1.1.1
tested OK in HA 0.100.1 in Samsung MU6300

@AlexeyUkolov
Copy link

AlexeyUkolov commented Oct 18, 2019

@xchwarze thank you! Now it works, with the port 8002. Excellent work, thank you again!

@xchwarze
Copy link

thanks @AlexeyUkolov !

@n3snah
Copy link

n3snah commented Oct 21, 2019

@xchwarze I tried using your custom component.
it recognised the TV was on but that was about as far as I could get. the TV kept popping up an authorize message which I kept accepting but changing channels and other actions didn't seem to do anything.

@arsaboo
Copy link
Contributor

arsaboo commented Oct 21, 2019

@laywah2016 Restarting HA took care of the issue for me.

@xchwarze
Copy link

@ laywah2016 test lastest release
https://github.com/xchwarze/ha-samsungtv-custom/releases

@AlexeyUkolov
Copy link

@xchwarze thank you for the new release, all looks excellent (especially the source list). The only issue for me now is that "TV" as a source does not work. I also tried KEY_DTV and KEY_ANTENNA - all without any effect. All the orhers sources are switching. Have you any idea?

@xchwarze
Copy link

thanks @AlexeyUkolov !
I am working on it but without the documentation of samsung.remote.control it is very difficult to achieve.
Maybe if I got the binary of samsung.remote.control (tizen binary from tv) I could add several improvements

@lukasz-galos-ps
Copy link

Hi,
I can check status of my tv, but i am not authorized to any changes (volume change, power off).
I recived below info:
Failed to call service media_player/volume_mute. {'event': 'ms.channel.unauthorized'}

Regards
Łukasz

@lukasz-galos-ps
Copy link

I can also power on TV, but others are unauthorized, power off also

@n3snah
Copy link

n3snah commented Nov 1, 2019

Unfortunately still no luck. I tried rebooting HASS, I also stopped and started my docker container.

@maximosm
Copy link

For me only open(on). I have try ports 8001 and 8002 but no luck.Is there any help or is total cuted from samsung last update the remote?

@xchwarze
Copy link

I make this version for tizen tvs https://github.com/xchwarze/ha-samsungtv-custom/releases
Tested on mu6300 and others 2017+ models

@maximosm
Copy link

maximosm commented Dec 16, 2019

I make this version for tizen tvs https://github.com/xchwarze/ha-samsungtv-custom/releases
Tested on mu6300 and others 2017+ models

I have test it at my ue58mu6199 but still have the same problem.Only on.

@hjm79
Copy link

hjm79 commented Dec 17, 2019

I make this version for tizen tvs https://github.com/xchwarze/ha-samsungtv-custom/releases
Tested on mu6300 and others 2017+ models

Can you show me the settings? (configuration.yaml)

I have mu6300 too.

@AlexeyUkolov
Copy link

AlexeyUkolov commented Dec 17, 2019

@hjm79
Not sure that is usefull, but this works for my MU9000 (LAN connected)

media_player:
      - platform: samsungtv_custom
        host: 192.168.1.2xx
        port: 8002
        mac: "84:c0:ef:ec:86:xx"

@hjm79
Copy link

hjm79 commented Dec 17, 2019

@hjm79
Not sure that is usefull, but this works for my MU9000 (LAN connected)

media_player:
      - platform: samsungtv_custom
        host: 192.168.1.2xx
        port: 8002
        mac: "84:c0:ef:ec:86:xx"

Doesn't it work with wifi?

@AlexeyUkolov
Copy link

AlexeyUkolov commented Dec 17, 2019

I haven't checked.

@xchwarze
Copy link

Wifi doest support WakeOverLan.
I think there is one option to activate the fire via WS. If they activate it and do not complete the mac address it should work

@tulindo
Copy link
Contributor

tulindo commented Mar 12, 2020

@escoand and @MartinHjelmare shouldn't we close this one as well?

@escoand
Copy link
Contributor

escoand commented Mar 12, 2020

Obvious yes. Wasn't aware of it.

@arsaboo
Copy link
Contributor

arsaboo commented Mar 12, 2020

Closing this for now. Please open new issue if you are having trouble with Samsung TVs.

@arsaboo arsaboo closed this as completed Mar 12, 2020
@FirasBayazed

This comment has been minimized.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.