Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sonos - Set Volume

Featured Replies

Posted

I have a couple rooms with a single keypad button used to set sones to a preselected favorite for the room and play or pause.  I also have a couple rooms where the primary light switch fast on and fast off triggers sonos to play/pause a favorite channel.  This generally works well, except when the last person to use sonos in the room has adjusted the volume very high or low using the app.  Is there a way to send a fixed volume percentage command vs just volume up/down commands?

30 minutes ago, EW1 said:

I have a couple rooms with a single keypad button used to set sones to a preselected favorite for the room and play or pause.  I also have a couple rooms where the primary light switch fast on and fast off triggers sonos to play/pause a favorite channel.  This generally works well, except when the last person to use sonos in the room has adjusted the volume very high or low using the app.  Is there a way to send a fixed volume percentage command vs just volume up/down commands?

Yes..... Just add the set volume you want to your program. 

@EW1 welcome to the Universal Devices forums.

It appears there are two Sonos node servers available (Sonos and ST-Sonos). Which one are you using? 

I think @lilyoyo1 covers the how to achieve this. Hopefully it works with the node server you're using. If not please provide more information related to your system for which node server and what Universal Device system you are using. 

 

 

  • Author

I have an ISY994 and Sonos 2.0.8 running on a rpi.  I haven't actually used the node server yet - my programs are old and done with network resources.  An example is below.  I'm only seeing volume up/down options with the node server I have.  I suppose I could send enough volume down commands that even from 100% it would go to zero, and then send a few volume up commands to get to desired volume, but this doesn't seem very elegant.  Also, I don't think I can wire shark the set volume to desired percentage given the app doesn't seem to have this option either, just up/down.

 

POST /MediaRenderer/AVTransport/Control HTTP/1.1
Host: 192.168.0.252:1400
Connection: Close
Content-Type: text/xml; charset="utf-8"
Content-Length: 267
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play></s:Body></s:Envelope>
 

26 minutes ago, EW1 said:

I have an ISY994 and Sonos 2.0.8 running on a rpi.  I haven't actually used the node server yet - my programs are old and done with network resources.  An example is below.  I'm only seeing volume up/down options with the node server I have.  I suppose I could send enough volume down commands that even from 100% it would go to zero, and then send a few volume up commands to get to desired volume, but this doesn't seem very elegant.  Also, I don't think I can wire shark the set volume to desired percentage given the app doesn't seem to have this option either, just up/down.

 

POST /MediaRenderer/AVTransport/Control HTTP/1.1
Host: 192.168.0.252:1400
Connection: Close
Content-Type: text/xml; charset="utf-8"
Content-Length: 267
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play></s:Body></s:Envelope>
 

I use node servers for my Sonos which allows for volume to be set (both of them do). I don't use your method so I can't help you with that one.

  • Author

Thanks for the help.  Just knowing that it was possible got me on the right track.  Sonos has pretty good documentation of their API and there is a DesiredVolume control.  Pasted below in case any others are using the old school network resources instead of a node server.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel><DesiredVolume>20</DesiredVolume></u:SetVolume></s:Body></s:Envelope>

1 minute ago, EW1 said:

Thanks for the help.  Just knowing that it was possible got me on the right track.  Sonos has pretty good documentation of their API and there is a DesiredVolume control.  Pasted below in case any others are using the old school network resources instead of a node server.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel><DesiredVolume>20</DesiredVolume></u:SetVolume></s:Body></s:Envelope>

You may want to take a look at going the node server route. The 2 way communication really comes in handy

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.