Sonos volume up and down flows


i want to convert a Hue dimmer switch into a sonos controller.
but i cant figure out to make a flow that increases the sound when the plus key is pressed, and decreases sound when minus is pressed. the only option i have is to set a specific volume. any solutions ?

Hi Michael,

I did a search that might help you…

It’s in dutch but in short you could use variables to get it done…

You can make a number variable (let’s call it ‘volume’) and let that determine the volume for the Sonos speakers.

I would suggest two flows:
Flow 1:
The + button is pressed
Calculate a number variable
(in this card you can let Homey add 0.05 to the volume. Just calculate the ‘volume’-card as: Volume-card + 0.05. Or any given interval that you like)
Set Sonos to ‘volume’

Flow 2:
(Same as flow 1 except you need the - button and decrease the volume instead of increase).

1 Like

thx that worked. Now the flow look this way

1 Like

What did you type in the value field of the variabel you made?

As long as we cant read the actual volum at the time the calculation happens it will eventually fail. Or else your forced to only use the switch for volum.

Change the volum on sonos or your phone and the calculation will be wrong.

Dunno where u get that from but the Set volume tag is updated whenever u change the volume from whatever place u like.

I just tried that, and mine only changes using the volum button inside homey. Whether that is a bug or not, I don’t know, but it doesn’t change.

Not my trough sonos app or spotify. But as soon as I go back to homey, press sonos, change volum it changes.

And which Sonos app version are u using ? And did u add the Sonoe speakers again after updating the app?

My app version is 5.0.11. I can try and reinstall the sonos app and connect sonos again. Just too see.

I’ve only had this version as I installed my first sonos speaker 4 days ago.

Hmmm. Checked with 5.0.11 and it doesn’t change indeed. Must be a bug. It’s working in 4.0.13.
Sorry for my comment earlyer.

Hopefully it will be fixed. i can send in a bug request. I was wondering why my flow got messed up.

Just trying to figure out exactly what you mean. I just tested it using Sonos directly. When I press on the + volume button on Sonos itself it immediately updates in Homey.

So I’m not sure why the flow will fail?

And you’re using 5.0.11?
Doesn’t update for at least two of us.

Yes, i’m using 5.0.11

Edit: just tested it with the Sonos app on my mobile phone (not via Homey) and with a flow in Homey. Both works for me.

I just restarted my homey and now it updates.

Volume up and down works with one issue:
first press volum goes up normal
Second press volum goes down a little Bit
Third press volum goes up again Normal

And it keeps on like this. Same goes for volume down button just opposite.

I’ll try to post some values tomorrow. I use exactly the same flow as above

That seems strange. You could try to determine what’s wrong by looking to the exact values that Homey reports in the logic cards between each step. They should simply go up by 0.1.

You could try to set a 1 second delay on the Set volume to Volume-up card. Perhaps Homey (sometimes) processes the Set volume to-card before it finishes calculating the volume-up card. This would mean your volume won’t go up at all, and the next time it would go up with 0.2.

1 Like

Tried this flow with a Nod-on Soft Remote.
Pressing the +/- buttons the values in the logic app disappears.
Is this normal or is it a bug in Homey or the Sonos app?
Homey version 3.0.0
Sonos app version 5.0.12

Can you post your flow(s)? Maybe there is something wrong in the calculation that causes the variable to go to 'undefined, meaning the value disappears.