Sony Bravia TV component with Pre-Shared Key

There is no favourites option in the API of the TV which can be used for this, but you can add your list to the sourcefilter so only these channels will be shown in the source list.

  - Channel1
  - Channel2

Is this something I can implement in the code of the component?

retracted as I am a moron and put in the wrong IP address. working fine


I don’t see the “IP control” or “pre-shared key” options on my bravia tv, how can I make this work… my tv won’t even register a pin code for HA.

Without these options in your TV it will not work.
Is your TV in this list from 2013 or newer? Otherwise your TV won’t support this.

Hi! The plugin is working for me on my Sony Bravia “Non Android TV” but I’m encountering a strange issue… I can switch on the TV but the toggle will not switch it off! How that’s possibile?
any guess?
And the status of the TV on the interface is not updating… for example other components if I turn them on directly from the Device the system show the status correctly but with this one no…

That’s strange indeed. Can you share your yaml config for the TV and some log information when using the TV?

Sure thing!

My configuration for the TV is the following:

# SonyTV
media_player bedroom tv:
  - platform: braviatv_psk
    name: BedroomTV
    psk: sony
    mac: 60:6D:C7:6F:9D:5E
    amp: False
    android: False
      - ' HD'
      - HDMI

and thats the error that I have in the log as soon as I press the power off button:

Sat Jan 06 2018 15:12:06 GMT+0000 (GMT)

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/”, line 182, in _step
result = coro.throw(exc)
File “/usr/lib/python3.6/site-packages/homeassistant/”, line 1031, in _event_to_service_call
yield from service_handler.func(service_call)
File “/usr/lib/python3.6/site-packages/homeassistant/components/media_player/”, line 408, in async_service_handler
yield from getattr(player, method[‘method’])(**params)
File “/usr/lib/python3.6/asyncio/”, line 332, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.6/asyncio/”, line 250, in _wakeup
File “/usr/lib/python3.6/asyncio/”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/media_player/”, line 292, in turn_off
File “/config/deps/lib/python3.6/site-packages/braviarc/”, line 311, in turn_off
File “/config/deps/lib/python3.6/site-packages/braviarc/”, line 252, in get_command_code
File “/config/deps/lib/python3.6/site-packages/braviarc/”, line 245, in _refresh_commands
if not resp.get(‘error’):
AttributeError: ‘NoneType’ object has no attribute ‘get’

just to let you know, the TV is connected via Wifi so I don’t know if that can make the difference…

Is that the correct IP address of the TV in your config? Because it’s the same IP address that I use and that’s why it’s in the example config.

Yes, now connecting the TV via the Ethernet Cable is working, and the TV have a static ip adress as listed.
Everything now work instead of the power on. I can switch off the TV, change the volume and even the input but I can’t switch it on… Any guess?

Should I try to change the ip in the tv and in the config as well?

Can you check your MAC in the TV settings? That is used to turn on the TV and it probably changed now you are using a Ethernet cable. If so update it in the config and after a HASS restart it should work.

I only changed one lines in braviarc_psk:
if result[‘source’] in [‘tv:dvbs’]: # tv:dvbc = via cable, tv:dvbt = via DTT
and sorted the output.

1 Like

1st of all great job! I was looking for something like that for a while. Motivation was to control Sony TV via Amazon Alexa. It is now working thanks to this component and HA Amazon skill. I can turn TV on and of, switch channels by voice commands. Didn’t find way how to control volume yet. What cannot figure out is how to change source for channels. I use dvb-s but have listed dvb-t in sources. Any hint how to change source please?

Looking for anything like below in …psk but no success.

1 Like

I will update the component so dvb-s is also supported and post it here once the new version is available (probably tomorrow).

1 Like

@kroebi, @sreokkyl, a new version of the component is available which includes the tv:dvbs option.
There were also some other small changes (way info is shown when TV is started via HASS and no info is available yet, swichting channels is now also possible when no program info of a channel is available).

Can you please test this version and let me know if it works as expected?
The latest version is available at

1 Like

It is working exactly as expected. Many thanks @gerard33! With channels filtering, you have all you need without deep technical knowledge thanks to your Sony Bravia TV component. Once again, great job!

Only 1 thing I realised now is that next & previous track buttons not working. Tried to restart HA, switchTV off and on but still same. This is only thing with problem.

Good to see it’s working!

Can you elaborate a bit more on the previous and next buttons? Can’t you switch channels when you are watching TV? And are you using the dvbs source in that case?

I use dvbc and can use these buttons to switch channels when watching TV. When not watching TV the buttons can be used for the regular previous and next commands, e.g. when an app is opened.

When I watching TV and click on previous and next buttons, nothing happen on TV but I can see info banner “Service media_player/media_next_track called” popped up on HA overview + details from “ui” below. I also tried to revert back to previous psk version. It is working, buttons are changing channels on my TV. So there is some difference between previous and new version. Btw, it is more comfortable for me to change channels from “source” as I have all my favourite channels filtered so not a big problem :slight_smile: but it took out the ability to ask Alexa to change channels (tracks - “Alexa next track on TV”) by voice commands. I’ll invest more time to the voice commands, that’s the future plan. Other than that, everything is working great. I’ll try to compare psk versions but my knowledge here is really poor, just starting with smart home currently.

On “haas open ui” is below for version with problematic next&previous buttons:
2018-01-14 21:15:49 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=media_player, service=media_next_track,, service_call_id=4522422056-9>
2018-01-14 21:15:49 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=4522422056-9>

I have also tested to send commands from It is all working. So I can create scripts in HA, add them to the groups in Amazon Alexa and call groups. It will also work but your component have all in one place + added value of frontend with nice functions. Let me know if you need more info and thanks for your work!

1 Like

Another alternative if you can’t find needed commands.

I indeed made some changes in the way the next and previous are working when TV is being watched. I did this because another user (on Discord) mentioned that he could not change channels when no channel information was found (so an empty channel).

I have updated this in a new version which can be downloaded from here (other link than above).
Can you please try this and see if the switching of channels is working again?

Just came across this project and try to implement it. It kinda works but when i try to turn on the tv it turns on but i get this error and HA thinks the tv is off:
2018-01-15 00:50:52 ERROR (SyncWorker_9) [custom_components.media_player.braviatv_psk] No data received from TV, probably it has just been turned off. Error message is: ‘NoneType’ object is not subscriptable

Fixt it! Had a typo in my psk :sweat_smile:

1 Like