- Platform information: RaspBerry PI 4
- openHAB version: 4.1.1
- Script type ECMA Script Edition 11
I have created 2 rules
- Sonos_Volume_Down
- Sonos_Volum_Up
![Schermafbeelding 2024-02-22 om 13.08.05|690x255]strong text(upload://hWeAidp6VG4W2uzOFgdjvCR8Tav.png)
Volume down
Sonos_Volume_Down works fine, every time I press the “volume down” button, the volume level is decreased by 1.
Volume up
When the volume is at level 1, pressing the “volume up” button changes the volume to 11 instead of 2.
When the volume is at level 5, pressing the “volume up” button changes the volume to 51 instead of 6.
It looks like the updated volume is a string rather then a numerical value.
1+ 1 = “11” , 5+1 = “51”
I updated the Sonos_Volume_Up script as shown below
Instead of adding 1, I subtracted -1.
Now, on every press of the “volume up” button, the volume level is increased by 1.