Sonos Speakers - Group Volume Adjustment via Voice Command


As many Sonos owners are aware, the current integration between Sonos and Alexa does not yet provide a means of adjusting the volume of an entire group of speakers via voice command, instead restricting such adjustments to individual speakers or stereo pairs. (Sonos’ integration with Google is pending sometime this year, and it is as yet unknown if it will also omit that functionality).

This piston fills that gap, allowing the user to choose his or her preferred method (or methods) of initiating a volume adjustment. The simplest option is to use empty ST Routines, which can in turn be called by Alexa or Google Assistant. (Momentary switches could easily be used in lieu of routines). The second option uses Alexa/IFTTT integration to trigger the piston. The choice between these first two is simply a matter of preference in terms of language, either “run {routinename}” or “trigger {IFTTT applet}. Both will adjust the group volume up or down by a preset amount as defined by preference variables in the piston.

The third option, using Google/IFTTT, allows more granular control as Google’s IFTTT integration allows the user to specify the desired volume level in the voice command. So instead of just saying “volume up” or “volume down” you can say “change speaker volume to 40.” Another advantage of using this option is that Google is generally more flexible and natural in terms of its command language.

It is important to remember that when speakers are grouped, volume adjustments to speakers in the group are relative. What this means is that if the volume of the speaker that is controlling the group is 20, and you increase that by 10 to 30, you have increased the volume of that speaker by 50%. All other speakers in the group will also increase, not by an increment of 10, but by 50%. Thus, if one of the speakers in the group is at 60, it will increase to 90. The piston includes an option to limit such increases to avoid any unexpected surprises. (Decreases work similarly but for obvious reasons are generally less problematic).

As a general note, where Sonos speakers have been paired for stereo, only the left speaker of the pair needs to be defined in the device variable.

One final note, in its current iteration the piston assumes there is only one group among all the available speakers. Whether I’ll address that or not depends on how many more speakers I end up adding to my household before my wife seizes my credit card. :smirk:

I’ve included a snapshot of both the piston and the IFTTT applets below.

See also:
Sonos Speakers - Dashboard Tiles
Sonos Speakers - Auto Volume Adjustment

10-Day Weather Forecast Tiles

Love this! Thanks! Now I can say “Alexa turn the music down” and it will turn all my grouped speakers down. Or Up! Perfect!


Hi @bthrock,

I see that you got some nice automation pistons created, I was wondering if maybe you could guide me in the right direction as I’m not 100% sure how to approach what I want to accomplish.

I got the SWIPE controller (fibaro) it is visible as a button controller in smart things, it takes swipe up down left right gestures but also has clockwise and conterclockwise circe gestures, which translates to button being held.

I was thinking if it would be possible to write piston that would translate this to volume up/down command as long as the button is held (I keep spinning the hand).

Something like maybe increase by 5 every second as long as the button is pressed?

Would you be able to help with this?



Not being familiar with the SWIPE controller, I would have to guess based on your description. Perhaps someone more familiar with the device can jump in here.

Also note that since my original post Sonos has added IFTTT integration, so group volume can be adjusted via an IFTTT action. That would lead me to my first question, which is whether it might be possible to use the Fibaro and Sonos IFTTT integration directly, without involving SmartThings at all. I don’t know the answer to that.

If not, then its a little more complicated. I assume that as long you ‘hold’ the button it maintains a particular state? If so, then the initial trigger for your piston would be state change on that switch, with subsequent checks ever second to see of the button is still in that state. Something roughly along the lines of

on event [device : switch]
while switch is on
raise volume 5% (using IFTTT or modifying my original piston)
wait 1 second
end while

Again, I’m just brainstorming and could be way off here. With that in mind, I’d probably work with the above all by itself, substituting ‘log info to console’ for ’ raise volume’ just to ensure you’ve got that element working first. Once you’re satisfied it should be easy enough to modify your piston to use IFTT or the code I created above. I can jump back in at that point if needed.