The volumeUp and volumeDown commands of the Sonos or the TV don’t appear in the app when creating routines so you need to create a rule in the advanced website.
There is an old post discussing it, mind the CLI or the API Browser mentioned are no longer needed and you can do everything from the advanced website. You’ll have to adapt the rule in this example to the events of the BILRESA, swipe_left and swipe_right instead of pushed. Also, you may have to change the component names for the button: main for the first group, group2 for the second and group3 for the third.
Rule using button events (custom driver)
I may just copy the rule here to simplify things, you would need another one with swipe_left and volumeDown:
[
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"COPY-BILRESA-DEVICE-ID-HERE"
],
"component": "main",
"capability": "button",
"attribute": "button"
}
},
"right": {
"string": "swipe_right"
}
},
"then": [
{
"command": {
"devices": [
"COPY-TV-OR-SONOS-DEVICE-ID-HERE"
],
"commands": [
{
"component": "main",
"capability": "audioVolume",
"command": "volumeUp"
}
]
}
}
]
}
}
]
The previous rule will only work with the custom driver since it has the swipe_left and swipe_right button events and you can adapt it to other buttons changing the component and event names.
For the scroll in particular you can use the next rule instead since it works with stock and custom drivers. The behaviour is slightly different though.
Rule using knob events (stock driver compatible)
Stock drivers don’t have button events for the scroll but they expose the scroll using the knob capability so it is possible to create rules to link the scroll to the volume in a similar way to dimming, except you can’t copy the step size and use the individual up and down instead. The logic would be if knob value greaterThan 0 then volumeUp, if knob value lessThan 0 then volumeDown.
[
{
"if": {
"greaterThan": {
"left": {
"device": {
"devices": [
"BILRESA-SCROLL-DEVICE-ID"
],
"component": "main",
"capability": "knob",
"attribute": "rotateAmount",
"trigger": "Always"
}
},
"right": {
"integer": 0
},
"changesOnly": false
},
"then": [
{
"command": {
"devices": [
"COPY-TV-OR-SONOS-DEVICE-ID-HERE"
],
"commands": [
{
"component": "main",
"capability": "audioVolume",
"command": "volumeUp"
}
]
}
}
]
}
}
]
In any case, the volumeUp and volumeDown commands have hardcoded increments/decrements so you can’t control how much it changes each time.