I have a 2019 Samsung TV logged into SmartThings. Via the app on my IOS14 phone I can manage the TV as expected. Using this integration I can only turn it off and on or select TV/HDMI. Volume does not work because a SONOS Beam is connected and that does not work. I also use the KPN TV app for watching TV and that is not supported either. Any chance this will ever work?
@Gerard_van_Hamburg what are the things you would like to do?
First related to Sonos beam:
I assume your Sonos beam learned the IR commands for the TV remote? Either you will need an IR blaster like e.g. a Broadlink device, or look into a direct Sonos integration for Home Assistant. You will then have a seperate volume control for Sonos but could even link these buttons together through some custom setup of your UI.
Then the KPN app:
Using this component you can send all kinds of keys to the TV, so almost anything you do from your Samsung remote is also possible using the component. You can make key combinations work as well via key chaining and can start any app as well on command. Not familiar with the KPN app myself:
- are you able to select a TV channel by entering the number keys on your remote while in the app?
- or is everything only selectable with arrow keys?
- to set up the KPN TV app in the app list we would also need to know it’s app id. It’s not a known app yet. Can I ask you to start your TV and open the KPN app, wait for a few minutes and then browse to https://graph-eu01-euwest1.api.smartthings.com/device/list, login with your Samsung account, select your TV to make a printscreen of the tvChannelName? This will normally be the app id to use. Like so:
If you have some patience I’m happy to look with you if we can make it work. Will need some answers from you first though
Hi, first of all, thank you for your response! I am patient and willing to help in any way I can. I will explain the Sonos first ok?
The Sonos Beam is directly connect to the tv with a HDMI cable and the TV settings point to the HDMI output. So the remote control didn’t have to learn the commands. From HA I can control the mute/unmute function when HDMI is connected but I can’t control the volume. When I disconnect the HDMI cable the TV settings change to the local speaker and I can control mute/unmute and volume.
The samsung remote I have does not have number keys anymore. It’s new and fancy, lol. But there is a way to select a channel by entering numbers and that works fine. So both up/down or entering keys works when using the KPN app.
I can log in to the website and select my TV but even after clicking all the pages, there is no logging at all. But when I change the name of my TV via the TV menu it is updated in the website and there is a new log line. Also after that, I can’t find the tvChannelName anywhere.
Depending on the model, even for the same series it might be classic remote or this new one. IMO new TVs support both of them. it all depend on what you get in the package.
Interesting. So the volume control of your remote (volume up, down) does work, correct? You could try to make the following service call from HA UI, Development tools → Services:
Set your TV media_player instead as entity_id and try to make the service call. See if the sound bar does responds to that. Also try sending keys “KEY_MUTE”, “KEY_VOLDOWN”, “ST_MUTE”, “ST_VOLUP”, “ST_VOLDOWN” to see how the sound bar responds.
Also here I am not sure if it works then. But worth a try. As in previous post please use the ‘send_key’ method to test whether it works with key “KEY_1” to get to channel 1 and/or “KEY_1+KEY_4”. Ensure that you have the KPN app open on the TV while trying this. Similarly test “ST_CH1” and “ST_CH14”.
Can you maybe share a screenshot of what you do see (send it privately if you are afraid to share sensitive data)? You need to be under ‘My devices’ and there should be a list of smartthings devices, click on the name of your TV (in the display_name column) and it should lead you to a long page with all details about your TV.
Ok, if I test it via the developer tools I am able to do all I want. Volume up, volume down, mute, all. The way I tested it was by opening the entity via configuration and then click the hamburger menu.
That works for the TV without the Sonos Beam but not with the Beam. IS it better to add a sort of remote control to Lovelace? Or should this work any way?
Key_commands work fine but ST_commands don’t work. I am not sure what the difference is and If I need both but perhaps you can explain?
Thanks by the way for all your help!!
There’s no long list I’m afraid. As I said I know I’m on the right page since I tested by changing the TV name (on the TV) and it is updated here.
And If I want to take a look at the list it tells me to look in the app. The app does not support details yet. Pffff
(The line you see is the report for changing the TV name)
Ok, we are getting somewhere… but not quite there yet.
-
So it might be that absolute volume setting is not supported via HDMI ARC… And that is exactly what the slider in the UI is trying to do (set volume to X when you slid the slider). The TV is simply not capable of forwarding this message to the soundbar. That would explain why it does work fine with the soundbar unplugged. So to have some volume control from the UI you would need to have buttons with a service call behind it: volume up and volume down like you did from the developer tools page. This seems to confirm that: https://nl.community.sonos.com/home-theater-229108/volume-aanduiding-6767825 - let me know if you need help with that.
-
I have no clue what is going on with smartthings on your end… seems it has the TV and can see it is online, but smartthings is not holding any data for the device! Are you able to control the TV via the smartthings app directly? Maybe you could try removing and re-adding the TV from your smartthings app, otherwise I have no clue how to fix that. Normally you would expect the ‘data’ and ‘current states’ row to be filled with lots of parameters. Sadly we now have no clue of the app id for KPN… Unless… I just noticed in your screenshot this:
Do you know if you made that screenshot when the KPN app was open? If so, that is actually the app id we need to have! -
Great to hear that within the KPN app these number keys work! This means you could already configure TV channels to appear in the ‘source’ drop down list so you can switch to them easily and they could be picked up by voice assistants as one of the possible input sources. But you can do this in your configuration.yaml to let’s say have a preset for Eurosport on channel 20 and then have the ability to switch TV to KPN app as well:
media_player:
- platform: samsungtv_tizen
host: <IP>
port: 8002
mac: <MAC>
api_key: !secret smartthings_api_key
device_id: !secret device_id_tv_living
show_channel_number: true
name: <NAME>
source_list: '{"Eurosport": "KEY_2+KEY_0"}'
app_list: '{"KPN":"FjZ4I75rVu.EVA"}'
As a side note - ST_CH1 and ST_CH14 could not work because of something wrong on smartthings side, but another explanation could be that these truly only work for the regular TV mode, rather than inside an app.
Hi Screwdge,
Thank you and indeed we are making some progress.
-
Let’s just forget about this one. I can controll the volume via SONOS because that’s integrated too. As a source I can select TV and control the volume.
-
Yes the app was open but I think the string might incomplete. Because adding that to the configuration gives an error the server can’t start. Perhaps I can find it in the logging? By the way, I removed all devices from the account and started all over again. But still no data visible. My guess is they are just not showing it anymore!
-
The bedroom TV does not have a sound bar and all works fine. One minor issue is that at first I have to press ok on the TV remote to allow changes on every possible change via HA. After that, it works fine.
My last hurdle is now get the Zolder TV working again. Since I added the Bedroom TV it is not showing up in HA anymore.
Can they use the same API key?
media_player:
- platform: samsungtv_tizen
name: TV Zolder
host: 172.xx.xx.xx
port: 8002
mac: xx:xx:xx:xx:xx
app_list: ‘{“Netflix”:“11101200001”,“KPN”:“FjZ4l75rVu.EVA”}’
api_key: bla bla
device_id: bla bla
update_method: smartthings
media_player:
- platform: samsungtv_tizen
name: TV Slaapkamer
host: 172.xx.xx.xx
port: 8002
mac: xx:xx:xx:xx:xx
app_list: ‘{“Netflix”: “11101200001”,“KPN”:“FjZ4l75rVu.EVA”}’
api_key: bla bla
device_id: bla bla
update_method: smartthings
@Gerard_van_Hamburg Is that a literal copy of your configuration?
If you have two TVs in your configuration.yaml it should look like below. Also make sure that the device ids are correct (and unique for each tv of course!). They might have updated in smartthings after re-adding them.
Last, point of the code owner @jaruba recommendation is to just use the default update method (ping). You can leave update_method out of your configuration file. This is the fastest and don’t worry - it still uses smartthings where needed to add the value it brings!
If you have it working again turn your TV on in any mode and see if selecting ‘KPN’ from the dropdown actually makes it switch to the app correctly. And when in the app whether selecting ‘Eurosport’ will make it switch to channel 20.
Also curious if you have voice assistants, they would be a great addition (I use Google assistant and let it put the TV on for me and put it on any channel just by voice and to turn it off during dinner if my wife forgot to do that again )
media_player:
- platform: samsungtv_tizen
name: TV Zolder
host: 172.xx.xx.xx
port: 8002
mac: xx:xx:xx:xx:xx
source_list: '{"Eurosport": "KEY_2+KEY_0"}'
app_list: ‘{“Netflix”: “11101200001”,“KPN”: “FjZ4l75rVu.EVA”}’
api_key: bla bla
device_id: bla bla
- platform: samsungtv_tizen
name: TV Slaapkamer
host: 172.xx.xx.xx
port: 8002
mac: xx:xx:xx:xx:xx
source_list: '{"Eurosport": "KEY_2+KEY_0"}'
app_list: ‘{“Netflix”: “11101200001”,“KPN”: “FjZ4l75rVu.EVA”}’
api_key: bla bla
device_id: bla bla
I can’t thank you enough for your help! Last night, I did some research and I have found some interesting things. When I add the TV to the Smartthings App it and/or log the TV in my SmartThings account (I am not sure at what point the device is added) it creates a new device but with the type ‘Placeholder’. When I change that to ‘2016 Samsung Smart TV’ and add the device ID, (you must do that otherwise you can’t save your changes) I can see the ‘Current States’ changing voor my pre-2019 TV. But it nevers gives any data about any app or something. My 2019 TV only shows the state for on/off by the way. I can’t select '2019 Samsung Smart TV’ so I think this is a dead end. Because also Netflix or YouTube can’t be selected. Well, I can select it but nothing happens.
One other thing is that I’m sure the app id for KPN is wrong. As soon as I select KPN I get an error telling me the server is down. I think I am just selecting an app that does not exist. Also, when I select Netflix, a name appears instead of the digits on the exact same spot you noticed the possible KPN id. So that can’t be the id.
So long story short, I can controll and ‘old’ tv perfectly but all my tests were done on a end 2019 TV and that fails a bit.
To answer your other question. Yeah I have google home active and I can switch the TV’s off or on!
Rather disappointing, given that smartthings seems to go haywire I would suggest you actually remove it from your configuration and give it another shot. Since you do not watch TV via antenna anyway you’re not really missing important features. It might be it does not function just because it is trying via smartthings which is giving some unexpected responses.
Fact that Netflix shows another app id can be… confusingly an app has both a numerical and alphanumerical id. It can be started by using either.
Give it a shot with the home assistant UI again after removing api_key and device_id I’d say. Perhaps then you are able to switch to your apps.
Hi, I’ve not removed the api and key yet but what I do see it that indeed samsung seems to go haywire! I added a third TV, also from after 2016 and within the Samsung app it shows on 24/7, lol. And it asks for permission to control the TV by app like a million times a day, pffff. But i am not giving up yet! I will keep you informed.
Hi I am using @jarubas integration installed via HACS to get further information from my Samsung Q85 TV available in Home Assistant.
I have just added the api_key
and device_id
as described in the set up instructions. I am wondering how to benefit from the “accurate states for HDMI or TV input sources” that is promised.
During the setup procedure I noticed, that the smartthings webpage successfully identifies which of the input sources is currently active
[
"digitalTv",
"HDMI1",
"HDMI2"
]
However within Home Assistant I am still getting TV/HDMI as the only feedback, which does not allow me to differentiate between TV, or HDMI.
source_list:
- TV
- HDMI
- Netflix
- YouTube
- Plex
volume_level: 0
is_volume_muted: false
media_title: ZDF HD
source: TV/HDMI
friendly_name: Samsung Q85_TV
supported_features: 20413
device_class: tv
Is there any way to correct that?
@T1ppes it definitely works when configured properly. It’s difficult to see what’s wrong without your config but off the top of my head:
1 are you sure you set the device_id correctly (as in from the url as described in the guide you link, not network id)
2 did you make update_method: 'smartthings'
in your config?
3 did you set the right scopes for your api_key?
Just guessing…
@T1ppes I agree with what @north3221 said, the most common issue is that users paste the “network id” from SmartThings instead of the “device_id” as described in the readme. You definitely didn’t write the correct info for the SmartThings API in your config.