IP control of Sony TV with HA

I got this to work from my mac so it can be integrate into HA to control my Sony TV. I wanted more control than the bravia component. It is really easy to setup, I changed my sony TV passcode to 0000 and set it to ip control.

for Netflix

$ ./send_command.sh 192.168.2.112 AAAAAgAAABoAAAB8Aw==

List of command

ActionMenu
Analog
Analog2
AnalogRgb1
AndroidMenu
Assists
Audio
AudioMixDown
AudioMixUp
Blue
BS
BSCS
ChannelDown
ChannelUp
ClosedCaption
Component1
Component2
Confirm
CS
CursorDown
CursorLeft
CursorRight
CursorUp
Ddata
DemoMode
DemoSurround
Digital
DigitalToggle
Display
DOT
Down
DpadCenter
DUX
Enter
EPG
Exit
FeaturedApp
FeaturedAppVOD
FlashMinus
FlashPlus
FootballMode
Forward
GGuide
GooglePlay
Green
Hdmi1
Hdmi2
Hdmi3
Hdmi4
Help
Home
iManual
Input
Jump
Left
Media
MediaAudioTrack
Mode3D
Mute
Netflix
Next
Num0
Num1
Num11
Num12
Num2
Num3
Num4
Num5
Num6
Num7
Num8
Num9
OneTouchTimeRec
OneTouchView
Options
PAP
Pause
PhotoFrame
PicOff
PictureMode
PictureOff
Play
PopUpMenu
PowerOff
Prev
Rec
Red
Return
Rewind
Right
ShopRemoteControlForcedDynamic
Sleep
SleepTimer
Stop
SubTitle
SyncMenu
Teletext
TenKey
TopMenu
Tv_Radio
Tv
TvAnalog
TvAntennaCable
TvInput
TvPower
TvSatellite
Up
Video1
Video2
VolumeDown
VolumeUp
WakeUp
Wide
WirelessSubwoofer
Yellow

3 Likes

A full list of command for my bravia.

num1: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAAAw==’
num2: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAABAw==’
num3: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAACAw==’
num4: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAADAw==’
num5: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAEAw==’
num6: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAFAw==’
num7: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAGAw==’
num8: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAHAw==’
num9: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAIAw==’
num0: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAJAw==’
num11: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAKAw==’
num12: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAALAw==’
enter: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAALAw==’
gguide: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAOAw==’
channelup: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAQAw==’
channeldown: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAARAw==’
volumeup: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAASAw==’
volumedown: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAATAw==’
mute: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAUAw==’
tvpower: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAVAw==’
audio: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAXAw==’
nediaaudiotrack: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAXAw==’
tv2: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAkAw==’
input: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAlAw==’
tvinput: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAlAw==’
tvantennacable: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAqAw==’
wakeup: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAuAw==’
poweroff: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAvAw==’
sleep: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAvAw==’
right: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAAzAw==’
left: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA0Aw==’
sleeptimer: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA2Aw==’
analog2: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA4Aw==’
tvanalog: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA4Aw==’
display: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA6Aw==’
jump: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA7Aw==’
oicoff: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA+Aw==’
oictureoff: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA+Aw==’
teletext: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAA/Aw==’
video1: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABAAw==’
video2: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABBAw==’
analogrgb1: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABDAw==’
home: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABgAw==’
exit: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABjAw==’
picturmode: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABkAw==’
confirm: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAABlAw==’
up: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAB0Aw==’
down: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAQAAAAEAAAB1Aw==’
closedcaption: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAKQAAAAQAw==’
component1: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAKQAAAA2Aw==’
component2: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAKQAAAA3Aw==’
eide: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAKQAAAA9Aw==’
rpg: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAKQAAABbAw==’
oap: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAKQAAAB3Aw==’
tenkey: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAMAw==’
bscs: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAQAw==’
ddata: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAVAw==’
stop: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAYAw==’
pause: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAZAw==’
play: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAaAw==’
rewind: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAbAw==’
forward: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAcAw==’
dot: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAdAw==’
rec: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAgAw==’
return: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAjAw==’
blue: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAkAw==’
red: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAlAw==’
green: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAmAw==’
yellow: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAnAw==’
subtitle: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAoAw==’
cs: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAArAw==’
bs: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAsAw==’
digital: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAAyAw==’
options: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAA2Aw==’
media: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAA4Aw==’
prev: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAA8Aw==’
next: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAA9Aw==’
dpadcenter: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAABKAw==’
cursorup: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAABPAw==’
cursordown: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAABQAw==’
cursorleft: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAABNAw==’
cursorright: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAABOAw==’
shopremotecontrolforceddynamic: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAABqAw==’
flashplus: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAB4Aw==’
flashminus: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAB5Aw==’
demomode: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAJcAAAB8Aw==’
analog: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAHcAAAANAw==’
mode3d: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAHcAAABNAw==’
digitaltoggle: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAHcAAABSAw==’
demosurround: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAHcAAAB7Aw==’
ad: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAAA7Aw==’
audiomixup: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAAA8Aw==’
audiomixdown: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAAA9Aw==’
photoframe: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABVAw==’
tv_radio: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABXAw==’
syncmenu: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABYAw==’
hdmi1: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABaAw==’
hdmi2: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABbAw==’
hdmi3: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABcAw==’
hdmi4: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABdAw==’
topmenu: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABgAw==’
popupmenu: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABhAw==’
onetouchtimerec: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABkAw==’
onetouchview: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABlAw==’
dux: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAABzAw==’
footballmode: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAAB2Aw==’
imanual: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAAB7Aw==’
netflix: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAABoAAAB8Aw==’
assists: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAAA7Aw==’
featuredapp: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABEAw==’
featuredappvod: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABFAw==’
googleplay: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABGAw==’
actionmenu: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABLAw==’
help: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABNAw==’
tvsatellite: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABOAw==’
airelesssubwoofer: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAAB+Aw==’
androidmenu: β€˜/Users/user/bravia/./send_command.sh 192.168.2.112 AAAAAgAAAMQAAABPAw==’

1 Like

Dear, I have installed the original component for the sony bravia tv. I configured it fine. The tv shuts on and off with alexa voice commands. I want also control other things, like turning on netflix, but I don’t know how to do this. Where do I have to put all this command lines? I am New with home assistant, so forgive me for asking maybe stupid questions. Thank you in advance!

For you to do this, you need to have access to the command line of where Home Assistant is installed. I have a mac where i downloaded the program above and can simply run the program called send_command.sh like this

./send_command.sh 192.168.2.112 AAAAAgAAABoAAAB8Aw==

Are you on a Raspberry PI and how did you install?

Hello RobDYI, Thank you for the Quick reply! I have installed home assistant on a Raspberry Pi indeed. Greetings and Thank you for helping me!

Hi

I have two older model Sony Bravia TVs with network port, however they’re not compatible with the bravia component - from memory there is no where to put the PSK in the TV etc.

Would this command option work with the the older models?

Thanks

To install and try you need to ssh into your Pi, probably the same way you installed HA.

These are the command to type, you need to setup your TV as below.

git clone https://github.com/breunigs/bravia-auth-and-remote
cd bravia-auth-and-remote
./send_command.sh 192.168.2.112 AAAAAgAAABoAAAB8Aw==

Setup TV

You need to set your TV to use a pre-shared key.

Navigate to: [Settings] β†’ [Network] β†’ [Home Network Setup] β†’ [IP Control]

Set [Authentication] to [Normal and Pre-Shared Key]

There should be a new menu entry [Pre-Shared Key]. Set it to 0000. If you choose
anything else, you need to change the PSK in the send_command.sh script.

Hey RobDYI, I feel stupid right now. Sorry :-). I installed home assistant with this video https://youtu.be/c2IUIUnxjUY. So I am not sure what you mean by ssh. Is there a video or some thing that shows me the way? Thanks a lot! Greetings

I don’t think you can install this program on your installation. I think you have hass.io installed which I don’t.

I’m on hass.io with a 2013 bravia and I send commands like this (option button on the remote)

shell_command:
  sony_options: |-
    curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_SendIRCC xmlns:u="urn:schemas-sony-com:service:IRCC:1"><IRCCCode>AAAAAgAAAJcAAAA2Aw==</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>' http://10.0.1.4/sony/IRCC?

Hi @RobDYI, do you know how to install this script when running HA in a Docker container? Is this still the easiest way for full IP control over the Sony Bravia? Thanks for the help.

You can google for ip control bravia and their are several different github project that you can try. I would suggest using this custom components as it added some basis ip control like on and netflix but not all. I really only needed the numbers in ip control so I can program changing channels.

I found your script yesterday and I thought I would give it a try. While it was working, I now suddenly had this error coming up:

./send_command.sh 192.168.1.6 aaaaaqaaaaeaaabgaw==
Command failed (HTTP_CODE: 500, try running it in a console)

And I am running it in a console :stuck_out_tongue:

Perhaps your TV ip address changed. I set mine as static.

Mine is static too… And can also ping it.

is there an instruction for hassio? those run this run that are aliens to me :slight_smile:
or maybe can share their configs and scrips for me.

I would try this if it fits your needs.

thanks. I want to make use of the shell commands. but I am not sure how to find the path of where config folder is on hassio

Hi, can you explain this for me? I have a sony android tv and try to get this to work

I don’t use hass.io but I think its fairly tied down so you might no be able to run shell commands on the same machine as the hass.io.

You can try another computer on the network like here.