Ikea Bilresa with Scroll Wheel to change Samsung TV/Sonos volume

Hello,

Pretty fresh user to the Smartthings ecosystem. I’m looking to use my new Bilresa with Scroll wheel to change the volume on my Samsung TV or Sonos system.

Don’t much care how, but would want to know about any kind of tradeoffs (have to do so with 5% increments, etc.)

I’ve already downloaded mocelot’s driver ( [Edge] Unlock IKEA BILRESA scroll wheel and dual button )to unlock the scroll wheel itself, so I’d imagine I’d need another driver on the Samsung TV or sonos side to increment volume?

Thanks in advance!

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.

Definitely impressed by the community, I saw your first reply and attempted some business after that, your edit is masterful though. I didn’t realize that I wanted to utilize the rotate function here.

I’ve set up a few of these now and am loving the response time, it’s just as quick as is if I was using the stock remote for the TV (which I ended up using as my target device because I rarely use my sonos devices otherwise)

Thanks much for the help!!

Anytime, glad you had it working! Yeah, the edits were more than needed :sweat_smile:

Since now it’s kind of a generic tutorial it will serve for other buttons. For example, for the BILRESA dual button to control volume, the custom driver can auto-repeat the Held and the Held can be mapped to volumeUp/Down with a rule.