Sony Bravia TV component with Pre-Shared Key

I am working on that. I already made a PR for the PSK version, but that was rejected as it was an extra component next to the existing Bravia (PIN version) component.
So I have now made a new version which combines both the PSK and existing PIN connection to one component. It’s available at:

As I want to be sure the current PIN version stays working correctly for people using that version, I am looking for some people to test that part. Currently it’s tested by one user, but some more would be better.

So if there are any other people willing to test that version to see if the PIN connection is still working then that would be great :grinning:

That new version should be put into custom_components/media_player? Or should I replace bravia component in the HA install? (I’ve got 2015 Android TV model if that matters)

So I’m running the latest version and now have it configured to 3 different Sony TVs. All are running with a different PSK and all seem to be working.
I can also report that ATSC is working, and the channels do show up as a Source and the program info displays correctly.

Is there a way I can manually add channels to the source list? The ATSC channels are in the same “Channels” app as the HD Homerun channels. Even though I’m not seeing them as a source, could I manually add a channel as source?

@NLJ you can indeed install it in custom_components/media_player. There is a sample config.yaml on my Github repo which you can use.

What is shown as source on the states page (dev tools) when you have selected a HD Homerun channel?
Maybe I can add that source just I did for tv:atsct.

Source isn’t listed when it’s on an HD Homerun channel. It does appear as “tv:atsc” when on one of the antenna channels.
However, the guide displayed on the TV integrates the Antenna (ATSC) and HD Homerun channels into one list. That’s why I was wondering if there was a way to force a channel into the source list to see if it would tune properly.

I just put that into my HA and got this in log:
2018-04-08 00:26:06 ERROR (MainThread) [homeassistant.setup] Error during setup of component media_player
Traceback (most recent call last):
File “/home/hassio/ha36/lib/python3.6/site-packages/homeassistant/setup.py”, line 145, in _async_setup_component
component.setup, hass, processed_config)
AttributeError: module ‘custom_components.media_player’ has no attribute ‘setup’

(latest version from your git repo)

Can you share the config.yaml file for the bravia_psk part?

- platform: braviatv_psk
   name: Bravia
   host: 10.x.x.x
   mac: ff:ff:ff:ff:ff:ff
   android: True

Actually even if I commented this out I still had that error in log. I had to rename custom_components so that HA doesn’t try to use this.

Is your folder/file structure like this?

config/
  custom_components/
    media_player/
        braviatv_psk.py

Yes. Exactly like this.
Edit 1:
Yesterday I updated 0.67.1 (that’s what .HA_VERSION shows) and just now I enabled your component without any problems. When I had probs with this earlier I just renamed custom_components to c_components and commented out relevant entries in configuration. Now I reversed all this and… it just works… Can’t say I understand… Must be something in the platform…
Anyway I’m testing this now :slight_smile:
Edit 2:
Is it supposed to re-use bravia.conf created with HA media_player.bravia? I’m using PIN mode with Bravia Android TV 2015 (currently running Android 7.0). Your component cant distinguish between tv beeing on or off but that’s all it can. Can’t turn it of or on, can’t change volume can’t even see what’s playing. PIN is correct cause media_player.bravia works correctly at the same time

This component has been working great, however, I just realized that my Source List is no longer showing (not sure when it stopped).

It does show a good sized list in Dev States, but not on the front end. Any ideas?

I’m on the latest version found HERE

{
  "volume_level": 0.19,
  "is_volume_muted": false,
  "media_content_type": "tvshow",
  "media_series_title": "No info (resumed after pause or                                           app opened)",
  "source_list": [
    "KASA HD",
    "NMPBS",
    "H and I",
    "Movies!",
    "KRQE",
    "FoxNM",
    "MeTV   ",
    "KWBQ-TV",
    "Bounce",
    "HDMI 1",
    "HDMI 2",
    "HDMI 3/ARC",
    "HDMI 4",
    "Video 1",
    "Video 2/Component"
  ],
  "friendly_name": "Sony Bravia",
  "supported_features": 23993
}

Are you on the beta version of HA (0.68)?
Then this issue will have caused it I think
https://github.com/home-assistant/home-assistant/issues/14098.

1 Like

I am indeed, not sure why the beta train didn’t cross my mind with this error,

Thanks for finding that and thanks for your hard work on this component!

1 Like

Can this component be used to extract the status of the App? I have a Sony Bravia Android TV, the default component only shows the input on HA. If I’m using any streaming service, it only shows ‘App’
I want an automation based on the status of the TV when streaming (idle, playing, paused etc)
Is this possible using this custom component?

That is not possible as the TV doesn’t provide the idle, playing, paused etc. info via the API.

@gerard33

This is working great for me, thank you so much!
Is it possible to now pass commands through home assistant via ifttt to select sources or channels etc?
It would also be great if we can set volume by percentage like in this video?

Hello, I just setup sony bravia tv with pre-shared key. I used default config setting from the github. However, I would like to be able to change the app like netflix and spotify. How do I put in the config or any other setting need. Please kindly advice.

  - platform: braviatv_psk
    name: Sony TV
    host: !secret sony_ip
    psk: sony
    mac: !secret sony_mac
    amp: False
    android: True
    sourcefilter:
      - ' HD'
      - HDMI

The media player in ha frontend show correctly, I can turn on/off. In Source show hdmi1-4. I would like to be able to change to netflix and other apps from ha frontend as well.

I do that with this method.

or

Thank you very much. I will try Sony Bravia TV tonight.

I still cannot do the share project youtube part o.O"