Bravia Remote Control

Hi all,

I’m trying to figure out the best way to design/build a sony Bravia remote. I’ve gather all the info I need and have been successful in testing each command separately. Later (2013+) Bravia’s have 2 ways of issuing commands but the most reliable one is using XML/Soap POST commands.

I set this up as a test using a switch, as below;

switch:
platform: command_line
switches:
bravia_youtube_launcher:
command_on: “/usr/bin/curl -X POST http://192.168.0.23/DIAL/apps/com.sony.dtv.com.google.android.youtube.tv.com.google.android.apps.youtube.tv.cobalt.activity.ShellActivity
command_off: “/usr/bin/curl -X POST http://192.168.0.23/DIAL/apps/com.sony.dtv.com.google.android.youtube.tv.com.google.android.apps.youtube.tv.cobalt.activity.ShellActivity
value_template: ‘{{ value == “1” }}’
friendly_name: Sony Bravia - Launch YouTube

As you can see, this command only opens YouTube (doesn’t require authentication either but the majority of the others do and are in a slightly different format).

I’ve currently stuck trying to figure out how to present a remote control interface. I’ve seen some other info on Apple TV & Harmony remotes but the base code seems way OTT (and fundamentally different) to what I need. Ideally I need a basic button format which would accept a custom command input as above, there are several different functions already available in Hassio that I’ve seen which might do part of this but are limited or not designed for this sort of operation.

The main thing in my head was to set up several (if not all) of the available buttons and then use a custom card ui to order/display the buttons in the same format as the Sony Bravia TV Remote control.

Aside from that, the smartest way to re-use the code would be to just have one universal command then swap out the main segment of the POST (/DIAL/ and everything after) to save repeating this stuff over and over.

Does anyone have any suggestions on where to get started with this?, I think if I can figure out how to get some buttons set up to execute code in this format that’ll be a start and can build off that!

Thanks in advance,
Lawrence

(PS the other functions which are likely to be used more than the above format shows as below;

X-Auth-PSK: 0000
Cookie: auth=68BFB1B29E36B94CE539293EE7D1E3CDBB2B3D7F
soapaction: “urn:schemas-sony-com:service:IRCC:1#X_SendIRCC”
content-type: text/xml; charset=utf-8
Connection: close
Content-Length: 317
User-Agent: Dalvik/2.1.0 (Linux; U; Android 7.0; SM-G955F Build/NRD90M)
Host: 192.168.0.23
Accept-Encoding: gzip
Cookie: auth=68BFB1B29E36B94CE539293EE7D1E3CDBB2B3D7F

<?xml version="1.0"?>

<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”>
AAAAAQAAAAEAAABgAw==
</u:X_SendIRCC>
</s:Body>
</s:Envelope>)

It’s only the SOAP call (?xml > /s:Envelope) which needs to be swapped out - not the initial call.