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 ?
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:
When
The + button is pressed
Then
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)
Then
Set Sonos to ‘volume’
Flow 2:
(Same as flow 1 except you need the - button and decrease the volume instead of increase).
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.
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.
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.
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.