Sony API - Simple http post format

1.1k Views Asked by At

I want to control my Sony STR-DN1080 through my home automation controller which is a vera product. Using vera scenes I can send http post commands. SQL and a little c# are my coding tools so I am not familiar with curl, json etc.

For my purpose, I just need to understand how to format the Sony API commands into a simple HTTP post. For example, this command turns my direcTV off. "http://ip_address:8080/remote/processKey?key=poweroff"

I want to: Turn the Sony system on and off

Set the input device to TV or Sat/CD

Set the volume to a specific value

Bonus: Turn Zone 2 on/off

Your help in getting me going is greatly appreciated. With one or two examples I think I can work out the rest.

1

There are 1 best solutions below

1
On BEST ANSWER

The Audio Control API is not a REST API like the directTv in your example, it is using JSON messages to communicate. Have a look at https://www.youtube.com/watch?v=2vsmav9B6vE&t=49s for how to use postman to get started.

To power on you might have to send WoL to the STR1080 if you have a EU model other wise use https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_setpowerstatus_v1_1

To set the input source use https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_setplaycontent_v1_2 Using "output":"extOutput:zone?zone=1" for Main Zone "output":"extOutput:zone?zone=2" for Zone 2. "uri":"extInput:sacd-cd" for Sat/CD and "uri":"extInput:tv" for TV see https://developer.sony.com/develop/audio-control-api/api-references/device-uri for more info.

To set the volume https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_setaudiovolume_v1_1 using "output":"extOutput:zone?zone=2" for Zone 2 and "output":"extOutput:zone?zone=1" for Main Zone

To turn on/off of Zone 2 https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_setactiveterminal_v1_0 using "uri":"extOutput:zone?zone=2"