We have moved at community.getvera.com

Author Topic: Sony STR-DN1080 API JSON  (Read 671 times)

Offline Bb98

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +1/-0
Sony STR-DN1080 API JSON
« on: December 03, 2018, 10:46:15 pm »
I have finally found documentation regarding Sony's API to control my AVR.  Unfortunately, for me, it uses JSON.  Can someone please provide me with some simple instructions for getting a vera scene to post JSON?

I was able to change the input device using POSTMAN:

http://ip_address:10000/sony/avContent

Then the JSON body

{
 "method":"setPlayContent",
 "id":47,
 "params":[
  {
   "output":"extOutput:zone?zone=1",
   "uri":"extInput:sacd-cd"
  }
 ],
 "version":"1.2"
}

Sony's documentation can be found here: https://developer.sony.com/develop/audio-control-api/#overview-content

Thanks in advance for your help!
Vera Plus 20 switches/dimmers, Garage Door Opener, Thermostat, Pool Control - Pump, Sweeper and Lights | Bose SoundTouch | Amazon Echo Spot and Dot | Sony AVR

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1464
  • Karma: +41/-36
Re: Sony STR-DN1080 API JSON
« Reply #1 on: December 04, 2018, 07:39:45 pm »
Not directly related, but my STR-DN1080's network connections stopped working like 4 years ago, both wi-fi and cable.  Wi-fi was going in and out over about a month and then just would not connect.  The AVR network connection is greyed out like the card fried or disconnected. 

I opened up the unit to see if something became loose but nothing was amiss.  I spent weeks scouring the Internet looking for anyone having a similar issue. Not wanting to take it to a shop, I just gave up. 

You had or heard of someone having a similar experience?
Vera 3, 1.7.1040, CT101, Everspring Motion, GE/Jasco Switch/Dimmer, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, LB60Z-1 bulb, Hue, Alexa, Zooz 4-1

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Sony STR-DN1080 API JSON
« Reply #2 on: December 05, 2018, 06:53:30 am »
Hi,

To use POST requests you would need to write some LUA code and at the moment quite a bit to make use of the LUA standard requests library. You can find an example using a post request here: https://github.com/reneboer/openLuup-CarNet/blob/master/src/L_CarNet1.lua lines 280-342. You probably can trim things down to your specific need.

Note that there is a luup.request documented in the wiki, but that is likely to crash the LUA engine of your Vera in the current  Vera release.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.