Author Topic: Cant set/get volume through HTTP requests  (Read 1094 times)

Offline mht

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +2/-1
Cant set/get volume through HTTP requests
« on: April 23, 2015, 03:49:59 pm »
Hi,

I am trying to set/get the SONOS Volume through HTTP requests but I cant get it to work.
 
Code: [Select]
http://xxxxx:3480/data_request?id=variableget&DeviceNum=153&serviceId=urn:sonos-com:serviceId:Sonos1&Variable=Volume
I have also tried

Code: [Select]
http://xxxxx:3480/data_request?id=variableget&DeviceNum=153&serviceId=urn:micasaverde-com:serviceId:Sonos1&Variable=Volume
What am I doing wrong?

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1099
  • Karma: +110/-40
Re: Cant set/get volume through HTTP requests
« Reply #1 on: April 23, 2015, 04:05:58 pm »
The correct id for get and set are "lu_variableget" and "lu_variableset"... for set, append "&Value=yyyy" to the url...

You can use the "lu_invoke" command to verify the urns, actions and variables for your devices:

Code: [Select]
http://xx.xx.xx.xx:3480/data_request?id=lu_invoke&DeviceNum=153
« Last Edit: April 23, 2015, 04:10:15 pm by cybrmage »

Offline mht

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +2/-1
Re: Cant set/get volume through HTTP requests
« Reply #2 on: April 23, 2015, 05:00:12 pm »
Thank you!

This seems to work:

To get current the volume
Code: [Select]
http://xxxxx:3480/data_request?id=lu_variableget&DeviceNum=153&serviceId=urn:upnp-org:serviceId:RenderingControl&Variable=Volume
To set the volume
Code: [Select]
http://xxxxx:3480/data_request?id=action&DeviceNum=153&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&InstanceID=&Channel=&DesiredVolume=7

Offline michelhamelin

  • Full Member
  • ***
  • Posts: 150
  • Karma: +2/-0
Re: Cant set/get volume through HTTP requests
« Reply #3 on: May 23, 2017, 12:20:23 am »
And how with lua script?