Sony Bravia TV component with Pre-Shared Key

Thanks!
The only stations that the API provides are those available in the built-in TV tuner (e.g. DBV-C).
Your HDHomerun will be connected via HDMI? Then that data is not available.

HDHomerun is a network (IP) tuner. Android 7 allows the TV to use the tuner as is if it was a built-in. However, I noticed that the API will not detect channels on my TVs on the build-in tuner either, despite setting - ‘HD’ in the config options.

1 Like

I also have a HDHomerun and would love to be able to pass a channel number. It is working to change the channel up and down if the TV starts on the correct source, but I can’t figure out how to pass a channel number or if I can?
Also, the Source “Channels” is not shown and no channel list is pulled.
The HDHomerun uses “Channels” which is Sony’s flavor of “Android Live Channels”. So if I change the source to “HDMI 1” I can’t get it back to view the HDHomerun.

1 Like

Currently the channels from the following sources are loaded

# tv:dvbc = via cable, tv:dvbt = via DTT, tv:dvbs = via satellite
if result['source'] in ['tv:dvbc', 'tv:dvbt', 'tv:dvbs']:
    original_content_list.extend(self.get_source(result['source']))

and

# physical inputs
if result['source'] in ('extInput:hdmi', 'extInput:composite', 'extInput:component'):
    resp = self.bravia_req_json("sony/avContent", self._jdata_build("getContentList", result))

So if you can discover how the HDHomerun is seen by the TV (maybe tv:ip of extInput:ip?) then I can add that to see if that works.

You can have a look at this post Sony Bravia TV component with Pre-Shared Key - #74 by gerard33.
You can replace Netflix in

media_content_id: Netflix

with Num1, Num2, Num3 (more channels not supported at the moment, but I can extend that).
Can you check if that works?

Should my TV report that it’s playing netflix in HA? When I’m watching Netflix the media player component reports “No info: TV resumed after pause.”

Using media_content_id: Num1 did work, but how do I enter multiple numbers? For example channel 232

Ah, now I see. Only Num1, Num2 and Num3 are setup. Num4 didn’t work.
I also set the media_content_type to channel. So 1 thru 3 did work, but I was only able to get 1 number at a time.

What file is that contained in? I couldn’t find it in the braviatv_psk.py file.

The Sony API doesn’t provide info if Netflix or another app is opened (at least not on my non Android TV).
So based on some checks I try to show if an app is opened or the TV is resumed after pause (in that case no program info is available). Apparently this can differ per TV, so I will make the text that is shown a bit more general.

It’s part of the pySonyBraviaPSK library from Pypi.

Given my Logitech Harmony Hub can’t get to the “Live Channels” source, I don’t have high hopes. I have a sneaking suspicion it’s not supported.

However, if it can get to a place where I can send “Num2 Num3 Num2” to change to channel 232, then it will be near parity with what Harmony can do.

Would it be possible to Launch Kodi and control it (as a bonus) using the same method as the Netflix suggestion?

Im having a problem with false turn on and false turn off. Im watching tv and have a automation that when i turn off the tv it turns off my cable box. But sometimes, the tv state goes to on and off and on and off… Several times while the tv is always on! This makes my cable box goes insane!

Whats is wrong? What can i do? Am i the only one with this problem?

Tia

That’s strange as the state only changes to off when TV doesn’t return the state active.
Can you try to find in which cases this happens?

You can fix this by adding a for option in the trigger of your automation as shown here.

That should be possible, but I can’t test and implement it as I have a Sony without Android TV.
Maybe someone here who can help with this?

I would be more than happy to :grinning:

How do I switch the built in tuner input? When I select the source via my remote Hassio shows it as being on “source: tv:atsct” but I do not see that in the source list?

I was able to get it to work with this script, but only Num1, Num2, Num3 work. Any way to choose a specific channel?
" sequence:

  • data:
    entity_id: media_player.sony_bravia_tv
    media_content_type: tvshow
    media_content_id: Num2
    service: media_player.play_media"

Currently the following sources are supported
```tv:dvbc = via cable, tv:dvbt = via DTT, tv:dvbs = via satellite````
I will add the tv:atsct source so you can test if that works.

Will make a post here when the new version is available.

Correct, I have only added these options to see if this works. Will add the other channels as well.

Not sure how/if you can choose a combination of numbers, eg 232. I think it should be possible as the TV doesn’t immediately switches to a channel after you have entered a number via the remote.