Improving Samsung TV Control

Is there a way to get the app listings (the ID or from the TV (Samsung q8fn)?
I have a Tablo and want to put that into the app_list
e.g. app_list: '{“Tablo”:“ID#_here”, “Netflix”: “11101200001”, etc…}

@gregmb If you enable the SmartThings API, it will show the alphanumerical ID (only) of the running app as the media title in the HA UI.

@jaruba fyi, since I disconnected my old 4 in 1 Aeon Labs multisensor, no more ghost auto switch on from Q70R. I suspect the red diode that was in sight from ir TV receiver. Now with 6 in 1 multisensor led is green, no more interactivity :wink: very strange

Hi,
Thanks for your work, i really enjoy what you did here. I’ve had the same issues your talked about with the other components you’ve’ talked about.

How ever, I’m having some trouble while trying to use the option to switch to another app outside of the card itself (card works fine and switches the apps perfectly).

I’m checking it using services at developer options.
this is what i’m trying to do:

{
entity_id: media_player.samsung_tv_remote,
media_content_type: "app_list",
media_content_id: "Netflix",
}

I’ve tried without “”, tried APP_LIST as well.

Any help?
THANKS!

I’ve figures it out.
In case someone else also has that issue, if should be done using “select_source” service and here is an example:

{ 
"entity_id": "media_player.samsung_tv_remote", 
"source": "Spify" 
}

@jaruba first of amazing work, thank you! I’d tried HA Samsung integration but this is so much richer. Got it set up nicely on a couple of Samsung TVs, working great.

I have one issue on it not picking up off state, remains on in Home Assistant when I use remote to switch off (saw that other thread you mention above, so will try that and see if fixes it)

I have a request, to see if possible or if could be a feature request:

I use HD HomeRun as one of the Samsung TVs doesn’t have an aerial. Is there any way to add the URLs for HD Homerun DLNA channels to this? if I use the media_play service:

entity_id: media_player.kitchen_tv
media_content_id: 'http://hd-homerun-ip:5004/auto/v101'
media_content_type: "url"

So I could create switches or other integrations/automations. Just wondering if there is a way to use already that I cant figure out, or if support could be added? Tired source_list, app_list and channel_list. Didn’t expect them to work but worth a shot. Also tried “mycontent-video-player/url”

Either way, awesome stuff well done!

@roberodin Hello, I’m looking for some help with HACS (ver 1.6.0) integration accessing HA (ver 0.115.6) supervised in docker under Ubuntu 18.04. Is there a setting that allows HACS integration (samsungtv custom) to use an included module in HA (samsungctl). It can not find it but HA’s integration using it works. Or must the dependencies in the HACS integration be manually loaded. Thanks

@jaruba I love your work! Got it working with Smartthings API key, can even change to youtube and the other stuff. Only Problem i have is that the TV ist not updating its state over smartthings altough the API Key obviously works. When i set the Update method to ping the TV state starts to update but extremly slow. When i set it to Smartthings the tv is stuck in its current state and does not get it when i turn it on with the remote. I switched to you integration because i had the same problem with the normal one, controllable but state is not updating. Any recommandation where to look to solve this?

My TV is a Q60R

`media_player:

  • platform: samsungtv_tizen
    name: Living room TV
    api_key: xxx
    device_id: xxx
    host: xx
    port: 8002
    mac: xx
    update_method: ping`

@HomeBase you are in the wrong thread, this thread is for samsungtv-tizen (not samsungtv-custom) and it’s not maintained by roberodin.

@north3221 that should be the correct way of casting a video to DLNA, but the TV might not support the video / audio encodings required to play it, if “hd-homerun-ip” in your example is an actual host instead of a LAN IP, then I suggest using the LAN IP directly

@north3221 @flex96 the update methods react differently depending on your network setup and TV model, the short answer is that your TV doesn’t really turn off when you turn it off, there is a grace period in which the TV only turns off the display, but is still turned on (you can see that by how fast it turns on after you turn it off, this is believed to be a feature, so you can turn on the TV fast if you turned it off by mistake), i also got reports that if the TV is not on the same LAN subnet the states act worst, but there is no way to get accurate states with Samsung TVs, it will take some time before it shows as off (because it’s not actually off yet) and it will sometimes turn on for small periods on an interval (because although the display is off, it does actually turn on by itself from time to time, users believe this is to sync data with SmartThings)

Hi @jaruba thanks for the reply.

On the state of my TV not going off, I followed the advice on the other thread you shared and reset it all. It was a bit of a pain to get back, issues connecting, but once I got it reset and back up and running, now works fine.

On the DLNA, sorry I should have been more clear. It works, if I call the service, the is a placeholder not hostname, I use the actual IP and it works, I have added some switches so can use google assistant to turn the channels on.

What I was asking is, as a feature request, would you be able to add URLs as channels? I could then add things like BBC1 directly as channel inputs and even use GA voice to change channel… Or in fact is there a way it already works? I couldn’t figure it out from the current config options

Like I said appreciate if not, I am not clear how difficult it would be to allow url inputs into the config and update the backend to be aware its a url, not a channel number

thanks

@north3221 I was a contributor that added code to make change TV channel by voice work. You will need to add a channel_list to your configuration.yaml with the name and channel number combination for each TV channel you wish to add as described here under channel_list.

After that restart HA and make sure to resync your devices with Google Assistant (either via HA via services -> request_sync) or by speaking the voice command to google to sync devices.

Afterwards whenever the TV is on you should be able to say the voice command given the name you entered in the channel_list, .e.g. (‘change TV to Eurosport’). You should also be able to see the TV channel as a ‘source’ input item in the HA UI and change it that way.

Hi @Screwdge thanks very much for the swift reply.

I have that set up and working on the TV that has the aerial connected. What I’m asking here is if I can somehow use a URL as the channel instead of channel number.

I imagine this is a code change. I have hd homerun which broadcasts the channels via dlna on my network.

The TV can play it with the service calls but of course a URL is not a valid input for the channel config you refer to. I did try but couldn’t get it to work.

I’m wondering if it’s an easy code change to allow URL as a channel source, that way I can use my dlna hd homerun and could potentially work for other uses like IPTV…

@north3221 @Screwdge I’m not against such a change, the only thing that’s needed is to check if the channel number starts with “http”, in which case it handles it like a video stream and casts to DLNA

Sounds good to me and happy to make the addition, will try and find some time over the weekend.

@north3221: do you have some example service calls you make as a reference?
@jaruba: if you’re ok i’m happy to become a contributor to the project and make the changes that way.

@Screwdge I sent u an invite to become a collaborator to the project, I think you should be able to use a public video stream to test this, like:
https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

@jaruba & @Screwdge awesome thank you. I took a look through the code to see if I could figure it out and it works! The way you have it set up makes it very easy, I added a couple of lines in the async_select_source method:


elif source in self._channel_list:
            source_key = self._channel_list[ source ]
            ch_media_type = MEDIA_TYPE_CHANNEL
            if source_key.startswith("http"): ch_media_type = MEDIA_TYPE_URL
            await self.hass.async_add_job(self.async_play_media,ch_media_type, source_key)

Tested and it works via HA UI and GA voice… Of course it doesn’t pick up the channel source in the UI, it just shows ‘Mycontent-Video-Player’, I’m guessing we cant fix that as seems cannot read current app data, otherwise we could also get playing state

Only thing we could do is if source == Mycontent-Video-Player then display last channel call name, but would only work if controlled via HA, anyone playing media directly it wouldn’t update. I can live with this :slight_smile:

NB BigBuckBunny is fine for testing as you said:

service: media_player.play_media
data:
  entity_id: media_player.kitchen_tv
  media_content_id: >-
    http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
  media_content_type: url

1 Like

@north3221 I don’t think we need to hack the title as u suggested. It should be possible to set and get custom video titles when casting to DLNA, but that requires more tinkering and is not required for an initial version of this.

@north3221 @jaruba that was indeed an easy change :+1: - option is added to the component code including a docs update. Indeed requires some time/investigation to get titles right for playing URLs. I’ll also try and have a look at it when I have some time.

I’m not sure about your instructions on getting the app ID from the Samsung TV.
‘enable SmartThings API’ - where? on the TV, on mobile device, on Home Assistant ?
Currently I have the smart thing app on my phone and it only shows ‘Tablo’ within the icon of the Samsung TV.

@gregmb read the documentation of the component carefully, you need to enable the SmartThings API in the ha-samsungtv-tizen component.