Samsung Smart TV - No control?

@pegatron89 try https://github.com/xchwarze/ha-samsungtv-custom/
I made this fork for work only with 2016+ tv models

I just installed the hacs version which is linked to a repo for @roberodin, It shows as my tv is switched off, even though it is on. If i turn it off it is able to power it up, and if i send the power key from the services it can turn the tv off and on. no errors though

I just seen the comment you removed. i will try and install the one from your repo and report back in about 10 minutes

Same result as above. I dont get any errors. any ideas?

@pegatron89 looks like your TV doesn’t handle apps in the same way
if you have netflix installed could your try to go to this url and post the answer?
http://YOUR_IP:8001/api/v2/applications/11101200001

netflix didnt load even though i have it installed. i tried it with the plex ID and got:

{“id”:“3201512006963”,“name”:“Plex”,“running”:false,“version”:“4.5.1”,“visible”:false}

Edit:

Using your samsungtv_qled i can call a service and load apps, tested apps are Netflix and Plex and Youtube so that part is working. I would think the rest would work if it stayed online

@pegatron89
Sorry i dont upload all files
try this https://github.com/xchwarze/ha-samsungtv-custom/releases/tag/v1.1.1

1 Like

Works now! I can control the tv off and on, change the volume and mute! thanks a lot @xchwarze

Is there any way to put in the apps and/or source? I can only toggle through hdmi rather than selecting hdmi1 or hdmi2 directly but i think thats down to the tv

Thanks for testing @pegatron89 !
Maybe this weekend update the component to add that

No problem. Thank you for finding a solution, If you need anything else tested let me know more than happy to. Will try it on the wifi tomorrow see if it works there.

Also seen this on the samsung api / sdk, not sure if it might help with changing which hdmi input you want.

Update to version 3.0.0 with new protocols and fixes
-ctl_beta
-ctl_qled

I get:

id “11101200001”
name “Netflix”
running true
version “9.0.0”
visible false

with:
http://192.168.1.131:8001/api/v2/applications/11101200001

So I think my TV should use port 8001? 8002 does not return anything.

I will try the latest from roberobin now.

But
 How do I get the “tile” into HA? I currently add via lovelace in the editor and press the orange “+” then choose “media control” and then I seet he name I created in my config:

  • platform: samsungtv_custom
    host: 192.168.1.131
    port: 8001
    mac: 8c:79:f5:29:7d:fc
    sourcelist: ‘{“TV”: “KEY_TV”, “HDMI”: “KEY_HDMI”, “ONKYO”: “KEY_HDMI4”}’
    protocol: ws
    name: Samsung Q70

But then I do not see the volume, sources, etc. in the tile, what am I doing wrong here?
image

EDIT:
Now getting:
image

with:

  • platform: samsungtv_custom
    host: 192.168.1.131
    port: 8001
    mac: 8c:79:f5:29:7d:fc
    sourcelist: ‘{“TV”: “KEY_TV”, “HDMI”: “KEY_HDMI”, “ONKYO”: “KEY_HDMI4”}’
    protocol: ctl_qled
    name: Samsung Q70

But sourcelist is empty and cannot control TV:

image

EDIT2:
When I manually turn OFF TV it still says it is on in the interface
 And not responding to cammands

@sender I check it, wait for 3.0.3

@xchwarze I tested your component. It’s very reactive much more than mine, no more lag, but the state isn’t accurate. When I turn my TV off it turns it off in HA but 1 minute later it turns back on in HA while my TV is still off.

I tried to fix mine, the KeyError: “visible” issue seems to be related with the applications and id localization. @pegatron couldn’t load netflix with my id. I tried to delete the least importants but if you still have issues you should try to remove it 1 by 1 to find problematic ones. I’ve added a script to run on your PC app_list.py, it will list the apps installed on your TV with their respective ids.

I am seeing similar behavior with @roberodin latest build 3.0.2. TV continues to show on in HA even when it is off. Also, sometimes the TV randomly turns on (this happens more so immediately after the TV is turned off).

@giefca thanks for test!
try this:

  1. config timeout in 1-3 secons
  2. edit in media_player.py:
    MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(seconds=1)
    MIN_TIME_BETWEEN_SCANS = timedelta(seconds=2)

Still the same issue but it oscillates between on and off faster after the TV is turned off and after the state stays on.

I had the same issue when I was trying to make my component, I couldn’t find a solution with the send_key method so instead I checked if the upnp server was up or down. Upnp server turns back on for a minute after the tv is turned off but otherwise it’s very reliable.

@sender check the source list in 3.0.3 version, wait 2 minutes after restart HA for get correct state of all entities, also as advice you can configure all combinations at the same time to see the result of each protocol like this:

  • platform: samsungtv_custom
    name: “Samsung TV beta 8001”
    host: XX
    port: 8001
    mac: “XXXX”
    sourcelist: ‘{“TV”: “KEY_GUIDE”}’
    protocol: ctl_beta
  • platform: samsungtv_custom
    name: “Samsung TV beta 8002”
    host: XX
    port: 8002
    mac: “XXXX”
    sourcelist: ‘{“TV”: “KEY_GUIDE”}’
    protocol: ctl_beta
  • platform: samsungtv_custom
    name: “Samsung TV ws 8001”
    host: XX
    port: 8001
    mac: “XXXX”
    sourcelist: ‘{“TV”: “KEY_GUIDE”}’
    protocol: ws
  • platform: samsungtv_custom
    name: “Samsung TV ws 8002”
    host: XX
    port: 8002
    mac: “XXXX”
    sourcelist: ‘{“TV”: “KEY_GUIDE”}’
    protocol: ws
  • platform: samsungtv_custom
    name: “Samsung TV qled 8001”
    host: XX
    port: 8001
    mac: “XXXX”
    sourcelist: ‘{“TV”: “KEY_GUIDE”}’
    applist: “YouTube, Netflix, Prime Video”
    protocol: ctl_qled
  • platform: samsungtv_custom
    name: “Samsung TV qled 8002”
    host: XX
    port: 8002
    mac: “XXXX”
    sourcelist: ‘{“TV”: “KEY_GUIDE”}’
    applist: “YouTube, Netflix, Prime Video”
    protocol: ctl_qled

2019-10-18%2019_15_20-Window

1 Like

with 3.0.3, the TV keeps turning on even after it is turned off. Also, I am not able to turn off the tv from inside HA.

With ctl_beta, I can turn the TV on from HA (but the status does not update in HA). Here’s what I see in the logs:

Fri Oct 18 2019 14:47:46 GMT-0400 (Eastern Daylight Time)
Update for media_player.living_room_tv fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 268, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 448, 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 "/home/homeassistant/.homeassistant/custom_components/samsungtv_custom/media_player.py", line 198, in update
    self.send_key("KEY")
  File "/home/homeassistant/.homeassistant/custom_components/samsungtv_custom/media_player.py", line 218, in send_key
    self.get_remote().control(key)
  File "/home/homeassistant/.homeassistant/custom_components/samsungtv_custom/samsungctl_080b/utils.py", line 303, in wrapper
    result = func(*args, **kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/samsungtv_custom/samsungctl_080b/websocket_base.py", line 261, in control
    ' -- is the TV on?!?'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

@giefca i tried your component again with no luck (i had to revert it back to wifi to avoid an ethernet cable stretched along my floor) I am going to fix my tv up with a permanent ethernet over the weekend rather than wifi. I will try your component again then.

@xchwarze your component worked fine on ethernet but wont connect at all on wifi, i changed the mac & ip address but it does not connect.

@giefca try using the content of me component master branch. I add a new config param “update_method” set update_method=ping

@pegatron89 mmmm too strange, let me test it over the weekend with my television