Improving Samsung TV Control

Oh wow thanks for letting me know!

@SimplyGardner follow the guide from the readme on how to get the device id, in the guide it specifically says that you need to get this from the url, and that “Device Network ID” is not the same thing as the “Device ID” which is needed for this component

hi,
ive tried install the new version and im getting the following error

2020-07-02 10:59:59 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.samsung_tv fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 239, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 239, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/samsungtv_tizen/media_player.py", line 429, in update
    self._get_running_app()
  File "/config/custom_components/samsungtv_tizen/media_player.py", line 330, in _get_running_app
    root = json.loads(data.encode('UTF-8'))
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

media_player:

  • platform: samsungtv_tizen
    host:
    port: 8002
    mac:
    app_list: ‘{“Plex”: “3201512006963”, “Netflix”: “11101200001”, “Prime Video”: “3201512006785”, “YouTube”: “111299001912”}’

could someone please help me resolve this?

@phairplay it looks like you’re getting an error while attempting to identify the running app, you could try one of these 2 possible solutions:

1 Like

Okay I’ve tried with both the number and alpha code and once with just the alpha.

My tv is a ue 2016 model and I dont have any smart things.

Is there anything else I can try.

@phairplay What is the response when you go to this page in a browser? http://{host}:8001/api/v2/applications/{value} replace {host} with your TVs host IP and {value} with any of the app_list IDs you’ve set in app_list

1 Like

@jaruba
thank you for the quick response I really appericate it.
so it did what you suggested and it came back with a 404 error. so I looked into the tv settings

I found that the device manager was set to deny, so I did the following steps

1, Delete the token
2, Removing everything from my config then restarting HA
3, Added everything back to the config back but give it a different name
4, restarted HA again
now it’s working as expected.

:+1:

@phairplay Great! I’m happy you got it working. It seems that someone must of selected “deny” on the access pop-up when you updated the component, thus adding HA’s IP to the TV blacklist.

1 Like

Hi,

Everyone else issues since the latest HA release? Everything worked fine before the update…

The source isn’t updated anymore and when I select a source manually, the source is changed on the TV itself, but the TV shows as ‘off’ directly after that command.

Yeah, constantly getting allow/deny/block pop ups on screen.
I’ve not looked into it yet and had to delete the component so I can watch TV.
Likely be alright once I re-install it and get a new token.

@fpschris Reinstalling the component manually usually resolves the authorization pop-up spam. I’ve yet to find a way to fix this behaviour after updating, my theory is that the authorization file needs to be deleted before a new authorization request is sent, as that’s where I currently believe the issue is coming from. Requires further investigation though.

Hi everyone, I installed Samsung Tizen, I change the channel, I turn the TV on and off, but I can’t control the volume. why?

@brazil885 What year was your TV made in? This component is specifically for 2016+ models.

qe55q7fna 2018

@brazil885 The second Q in ur TV model code means that it was made in 2017+, it should work with this component. To note, the volume controls and starting media playback use the UPnP protocol, as opposed to the other protocols used in this component for the rest of the features. UPnP requires a second authentication pop-up, if u want my guess, u denied that pop-up on ur TV and ur HA IP has been blocked for that protocol, check the TV settings, see what’s blocked, try to unblock it manually.

Hi guys,
I have a odd issue when I select prime video it correctly switches over, yet the media_title states TV/HDMI,
Is there anyway to resolve this?

I would like to created an automation based on the source being watched.

@phairplay You can try setting the app_list manually as explained in this file (for best results set both of the app IDs for the app, separated by “/”):

Otherwise, you can enable the SmartThings API, this will also enable the current running app state, while also showing you if the TV is selected, what channels are on the TV, which HDMI source is selected, allow you to change between HDMI sources, etc.

ok, instead for the pop up problem that comes out of continuous? How can I solve?

I have an application on my Samsung TV called molotov (French online TV). I can’t find the id value for the app_list.
I am not a big fan of smartthings api as it is cloud based. So, how can I find the id for this particular app?
Thanks,
GV

@greengolfer nope, there are only 2 ways to get the app id, one is the smartthings api, and the other is through a call to the ws api (which is not foolproof, and requires coding)