New Sony Bravia TV integration for 2015 - 2016 alpha

just try going into and coming out of options just in case as it sets a few things up

ok ive now added every button thats supported on my TV, Ive not tested them all but ive updated github again so feel free to test.

its slowed the smart app down abit. and my thoughts are that ill remove the buttons that i cant really see people using but ill leave them available in the smart app to be uncommented if anyone did want to use them.

Im also looking at adding media player controls as we have play stop pause etc available, we may be able to use a media player button depending on how they work

once this is all done, i may look into a smart app that can do more than just turn the TV on and off. Id like to be able to turn the TV on and at least switch to netflix, or switch to hdmi3 and have different buttons for different launch controls. but no promises on that one

1 Like

Regarding this from the OP:

“Note: Within the Device on the SmartThings IDE the Device Network ID for Device instance must be hex of IP address and port in the form of 00000000:0000 (i.e. 10.0.1.220:80 is 0A0001DC:0050) - if you check the logs the smart device will log the correct address that you can copy paste, once the IP address has been set. If this is not set you wont get updated on/off status. Apparently you can get the Device handler to set it but ive not been able to properly test this yet.”

I’ve gotten the device network ID after creating the device from the device details (click on the device in the My Devices screen.

I’ve entered the network ID in the settings for the device, using both formats:

00000000:0000
00000000-0000

And I can turn off the TV, and some commands work (Source, changing directly to an input) but others don’t (can’t turn on TV, Netflix button doesn’t do anything).

I have simple IP control enabled on the TV, setup the PSK and entered it in the app and confirmed connection there. Authentication is Normal and Pre-Shared Key. I haven’t found a WOL setting anywhere on the TV and suspect it doesn’t support that.

@steve.bratt

Tried the test wth the Rest Web Service client, this was the raw response below, didn’t work for me. Tried it from my Chromebook.

Response (RAW)
{“error”:[5,“Illegal JSON”]}

Request tab (replaced some characters of my IP and PSK PW):

POST http://192.168.X.XX/sony/system
Accept: application/json
X-Auth-PSK: XXXXX
Content-Type: application/json

“method”:“getMethodTypes”,“version”:“1.0”,“params”:[“1.0”],“id”:4694

Equivalent curl command (Replace with real password):
curl -i -H Accept:application/json -H X-Auth-PSK:XXXXX -X POST http://192.168.X.XX/sony/system -H Content-Type: application/json -d ‘“method”:“getMethodTypes”,“version”:“1.0”,“params”:[“1.0”],“id”:4694’

Any suggestions? I can turn off, can’t turn on.

XBR75X850C - Android TV.

Can you tell me the full IP address of your TV and what hex your using?

If you log on to the smartthings ide across the top of the screen where you have my smart apps my device handlers, you should see “live logging” click that. Then open your phone
Open the sony TV in smart things and click the cog in the top right corner. Make sure the IP address. Is correct and click done. Now quickly go back to the live logging page that you have open on your computer you should see a message with the correct hex pop up.

It only pops up once you click done in settings.

The fact that you get a bad json message means your TV is responding so we’re halfway there let me check the instructions and see if we can’t get it working. I think Android tv’s may be different to the none Android tv that I have but I’ll see what I can do.

@Danabw I was close please do the following:

change the drop down to POST
in the URL type http://your tv’s ip address/sony/system
click accept at the top and click application/xml
click “add header” at the top and enter, X-Auth-PSK in the NAME field and the Psk passphrase you setup on your TV in the value field
click the body tab
in the empty white text box below the body tab paste the following text

{“method”:“getMethodTypes”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

click the “send” button at the top right.

(it was application xml not json and i missed the curley brackets around the string

if you get the above one working can you also change the body part and get the results of these too

{“method”:“getMethodTypes”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}
{“method”:“getRemoteControllerInfo”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}
{“method”:“getWolMode”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

@danabw have you enabled remote start on your TV? ive updated the fist post with the instruction

Seems from all the updates like you would benefit from putting this into a proper git repo and have people pull whenever you have new code?

Thanks for the quick response! Busy this AM, but time for a quick test - retried w/your instructions and raw response is:

{“results”:[[“getCurrentTime”,[],[“string”],“1.0”],[“getDeviceMode”,["{“value”:“string”}"],["{“isOn”:“bool”}"],“1.0”],[“getInterfaceInformation”,[],["{“productCategory”:“string”, “productName”:“string”, “modelName”:“string”, “serverName”:“string”, “interfaceVersion”:“string”}"],“1.0”],[“getLEDIndicatorStatus”,[],["{“mode”:“string”, “status”:“string”}"],“1.0”],[“getNetworkSettings”,["{“netif”:“string”}"],["{“netif”:“string”, “hwAddr”:“string”, “ipAddrV4”:“string”, “ipAddrV6”:“string”, “netmask”:“string”, “gateway”:“string”, “dns”:“string*”}"],“1.0”],[“getPowerSavingMode”,[],["{“mode”:“string”}"],“1.0”],[“getPowerStatus”,[],["{“status”:“string”}"],“1.0”],[“getRemoteControllerInfo”,[],["{“bundled”:“bool”, “type”:“string”}","{“name”:“string”, “value”:“string”}"],“1.0”],[“getRemoteDeviceSettings”,["{“target”:“string”}"],["{“target”:“string”, “currentValue”:“string”, “deviceUIInfo”:“string”, “title”:“string”, “titleTextID”:“string”, “type”:“string”, “isAvailable”:“bool”, “candidate”:“RemoteDeviceSettingsCandidate[]”}"],“1.0”],[“getSystemInformation”,[],["{“product”:“string”, “region”:“string”, “language”:“string”, “model”:“string”, “serial”:“string”, “macAddr”:“string”, “name”:“string”, “generation”:“string”, “area”:“string”, “cid”:“string”}"],“1.0”],[“getSystemSupportedFunction”,[],["{“option”:“string”, “value”:“string”}"],“1.0”],[“getWolMode”,[],["{“enabled”:“bool”}"],“1.0”],[“requestReboot”,[],[],“1.0”],[“setDeviceMode”,["{“value”:“string”, “isOn”:“bool”}"],[],“1.0”],[“setLanguage”,["{“language”:“string”}"],[],“1.0”],[“setPowerSavingMode”,["{“mode”:“string”}"],[],“1.0”],[“setPowerStatus”,["{“status”:“bool”}"],[],“1.0”],[“setWolMode”,["{“enabled”:“bool”}"],[],“1.0”],[“getMethodTypes”,[“string”],[“string”,“string*”,“string*”,“string”],“1.0”],[“getVersions”,[],[“string*”],“1.0”]],“id”:4694}

IP address is: 192.168.2.13 - I’m connected via Ethernet. Remote start is enabled (set to On).

Thanks, more later today. Did the above info help at all?

ok on top of the other ones above can you do

{“method”:“getPowerStatus”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

from that little excerpt of text, it looks like it should all work, but if you can do the rest that would be great

Also at @Danabw if you turn the tv off via smart things can you turn it back on right away via smart things or does that not work either?

Is there any way I could execute one of the other commands from Amazon Echo ?

At the moment Alexa will turn on or off the television, but I would love to be able to say ‘Alexa turn on HDMI1’ or ‘Alexa turn off picture’

I can execute the commands via a widget on my phone via SharpTools but it would be great if I could do it through Alexa.
Any ideas how this could be setup ?

I have a Harmony Hub in my room where my 2016 Sony Bravia is. Is there any additional functionality this device type will give me?

As far as i can tell at the moment, Its not possible and it certainly inst possible with this device type as it stands to use the other buttons with any apps which is a limitation in smart things. I believe in order to make it work you have to do much more complicated code than i can do.

however. It may be possible to make it work with a smart app. so im thinking about building a simple smart app to make this work and there may be other smart apps that exist already that could work with it. (ive been looking for some kind of tv controller app)

Alternatively i may be able to add a setting to the device handler that will switch the tv to a particular input when you turn it on.

but either way watch this space and I will hopefully be able to get more functionality out of this somehow.

1 Like

Thanks Steve, your work is very much appreciated.

This:

{“method”:“getPowerStatus”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

Results:

{“error”:[3,“Illegal Argument”],“id”:4694}

This:

{“method”:“getMethodTypes”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

Results:

{“results”:[[“getCurrentTime”,[],[“string”],“1.0”],[“getDeviceMode”,["{“value”:“string”}"],["{“isOn”:“bool”}"],“1.0”],[“getInterfaceInformation”,[],["{“productCategory”:“string”, “productName”:“string”, “modelName”:“string”, “serverName”:“string”, “interfaceVersion”:“string”}"],“1.0”],[“getLEDIndicatorStatus”,[],["{“mode”:“string”, “status”:“string”}"],“1.0”],[“getNetworkSettings”,["{“netif”:“string”}"],["{“netif”:“string”, “hwAddr”:“string”, “ipAddrV4”:“string”, “ipAddrV6”:“string”, “netmask”:“string”, “gateway”:“string”, “dns”:“string*”}"],“1.0”],[“getPowerSavingMode”,[],["{“mode”:“string”}"],“1.0”],[“getPowerStatus”,[],["{“status”:“string”}"],“1.0”],[“getRemoteControllerInfo”,[],["{“bundled”:“bool”, “type”:“string”}","{“name”:“string”, “value”:“string”}"],“1.0”],[“getRemoteDeviceSettings”,["{“target”:“string”}"],["{“target”:“string”, “currentValue”:“string”, “deviceUIInfo”:“string”, “title”:“string”, “titleTextID”:“string”, “type”:“string”, “isAvailable”:“bool”, “candidate”:“RemoteDeviceSettingsCandidate[]”}"],“1.0”],[“getSystemInformation”,[],["{“product”:“string”, “region”:“string”, “language”:“string”, “model”:“string”, “serial”:“string”, “macAddr”:“string”, “name”:“string”, “generation”:“string”, “area”:“string”, “cid”:“string”}"],“1.0”],[“getSystemSupportedFunction”,[],["{“option”:“string”, “value”:“string”}"],“1.0”],[“getWolMode”,[],["{“enabled”:“bool”}"],“1.0”],[“requestReboot”,[],[],“1.0”],[“setDeviceMode”,["{“value”:“string”, “isOn”:“bool”}"],[],“1.0”],[“setLanguage”,["{“language”:“string”}"],[],“1.0”],[“setPowerSavingMode”,["{“mode”:“string”}"],[],“1.0”],[“setPowerStatus”,["{“status”:“bool”}"],[],“1.0”],[“setWolMode”,["{“enabled”:“bool”}"],[],“1.0”],[“getMethodTypes”,[“string”],[“string”,“string*”,“string*”,“string”],“1.0”],[“getVersions”,[],[“string*”],“1.0”]],“id”:4694}

This:

{“method”:“getRemoteControllerInfo”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

Result:

{“error”:[3,“Illegal Argument”],“id”:4694}

This:

{“method”:“getWolMode”,“version”:“1.0”,“params”:[“1.0”],“id”:4694}

Result:

{“error”:[3,“Illegal Argument”],“id”:4694}

I’ve confirmed correct IP in smartthings app settings.

Happy to try anything else - appears that my TV doesn’t want to communicate! :slight_smile:

Trying to turn it back on right away doesn’t work either…won’t turn on.

hmm interesting it doesn’t like the commands although it does support them ill have a look into it

just try this with a different id

{“method”:“getPowerStatus”,“version”:“1.0”,“params”:[“1.0”],“id”:101}

Access denied! <eek!> :slight_smile:

{“error”:[3,“Illegal Argument”],“id”:101}

Sorry - that didn’t work ether. Thanks for the suggestions.

Not technical, (another damn liberal arts BA/business MA loser) :wink: so I don’t know if this is relevant, but found this in some general searching around on communicating w/Sony TVs, so thought I’d share in case it helps you generally. Likely you’ve already seen it or it’s not relevant.

And from that page, this:

And this discussion:

http://forum.micasaverde.com/index.php?topic=36558.0

And this looked like it might be helpful: