Sony Bravia TV component with Pre-Shared Key

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"

I get all the commands. Thank you very much. So…must be a lot of script to use by alexa and google.

I really just use it for Netflix and I programmed two channels on my cable box that I go to often.

  netflix:
    sequence:
      - service: shell_command.netflix
      - delay: 00:00:04
      - service: shell_command.left
#      - delay: 00:00:01
      - service: shell_command.enter
  cnbc:
    sequence:
      - service: switch.turn_on
        entity_id: switch.tv
      - delay: 00:00:03
      - service: shell_command.hdmi4
      - delay: 00:00:01
      - service: shell_command.num1
      - delay: 00:00:01
      - service: shell_command.num4
      - delay: 00:00:01
      - service: shell_command.num3
1 Like

Can you advice in the shell_command.netflix example.

shell_command:
  netflix: '/home/homeassistant/.homeassistant/bravia/./send_command.sh 192.168.1.66 AAAAAgAAABoAAAB8Aw=='

So it has to be ./send_command.sh ip command

Did you download the program and get it working?

https://github.com/breunigs/bravia-auth-and-remote/archive/master.zip

Yes. I have download and rename the folder to bravia and put in homeassistant folder. Then I also do the print_ircc_codes.sh to get all the commands.

Can you control your tv from the command prompt?

./send_command.sh 192.168.1.66 AAAAAgAAABoAAAB8Aw==

Yes. I can control via ssh. But when putting in shell_command. Do I have to put in with full directory where the send_command.sh is?

I have test send_command.sh via pi user which bravia folder is also in pi account. So I relocated the folder bravia to be in homeassistant folder to use shell_command.

If you can get it to run at the command prompt with the full directory, it should work as a shell command with the same command

/home/homeassistant/.homeassistant/bravia/./send_command.sh 192.168.1.66 AAAAAgAAABoAAAB8Aw==

you can try to change the permission on the file

sudo chown 777 /home/homeassistant/.homeassistant/bravia/send_command.sh

you can try the shell command in the dev.

image

1 Like

Thank you very much for your advice. I will try tonight.

sorry, change permission with below (chown is for ownership)

sudo chmod 777 /home/homeassistant/.homeassistant/bravia/send_command.sh

Thank you very much.

@Sunonline, @RobDYI
I have added a number of commands in the custom compoment which you can use to send to the TV.
See this and this post.

Advantage is that you can use this directly from the component.

That’s great, I already use your custom but didn’t know about this added functionality. When is your custom component going to be integrated into the HA builds?

1 Like