Belkin Powermate Bluetooth for Volume

Hi - would it be possible to connect a Belkin Powermate via Bluetooth to control the DAC volume? I can run ALSA and change volume on my Mytek Brooklyn so that part is already done.

I found a Roon extension for a USB powermate but that may not be needed since I have roon configured to “use device controls” it’s already integrated the volume and DAC. So, basically just need to integrate the control via bluetooth connection to the RBP3 (I believe it has bluetooth?) and configure it to control volume. @spockfish

1 Like

Bump. Any ideas / thoughts?

I am doing this exact thing, sort of. I have a Python script running on a RPi listening to Bluetooth LE from the Powermate, and then sending volume commands to a Broadlink IR blaster to control my Pro-Ject S2 Digital (which doesn’t have usable USB volume control, hence the IR blaster). One could pretty easily have the same volume commands control the Brooklyn via ALSA. Happy to post my code on Github if it’s useful.

1 Like

Fantastic. Do you feel you could help me have it control the ASLA mixer instead, as well? @Joe_Gratz

It’s technically possible (almost trivial), but the tough part is that doing this via ALSA means it has to be running on the Pi that your DAC is plugged into, and presumably the DAC that your Pi is plugged into is running Ropieee, and thus won’t be (reliably) running my janky third-party Python code, since the point of Ropieee is “no janky unstable hard-to-configure third-party code”.

It’s theoretically possible one could build this into Ropieee, but seems like a very edge case, and would probably require a pairing interface in the web interface.

The “right” answer for getting volume control to ALSA, if you’re sticking with Ropieee (which is a great idea since I gave up compiling my own kernels back in the 90s and Harry is awesome), would be to have a separate Pi that talks to the Powermate and then runs a Roon extension that sends those volume commands, similar to the Roon non-wireless Powermate extension that already exists.

Not really sure how to respond. I guess “give me what you’ve got” and I’ll take it from here.

Here you go.

Ok, I finally had a chance to implement this, and it’s working.

I opted for a wired Powermate, vs. Bluetooth, just so I didn’t have to deal with batteries.

I did use a separate Raspberry Pi 3 (will move to a Pi zero as the 3 is overkill for this), put it on WiFi, and modified a python script I found online that basically captures the events from a Powermate and I just modified it to send amixer commands via SSH to the Ropieee RBP!

Powermate python script I modified :

I basically found the “up and down” rotation section and modified it so that it sent the following command to the Ropieee box:

def rotate(self, rotation):

  blah = rotation
  if blah < 1:
    print('Rotate down{}!'.format(rotation))
    os.system("sshpass -p root ssh root@192.168.50.111 amixer set PCM 1%-")
  else:
    print('Rotate up{}!'.format(rotation))
    os.system("sshpass -p root ssh root@192.168.50.111 amixer set PCM 1%+")
    self._brightness = max(0, min(MAX_BRIGHTNESS, self._brightness + rotation))
    self._pulsing = False
    return LedEvent(brightness=self._brightness)

As you can see, I used sshpass (an app I got from apt-get) as it allows saving of the ssh password. I don’t care about security here, I just want ease of use.

Hope this helps someone if they wish to have a fancy remote control that controls amixer on a Ropieee roon bridge (you must obviously use device volume settings within roon using a compatible DAC).

Obligatory photo:

1 Like

A few changes:

  1. I updated the script that when it calls sshpass, I added the “-o StrictHostKeyChecking=no” command to it, so that it runs as root within crontab
  2. I did #1 because I needed the python script to run in crontab at boot, otherwise it would run the script but sshpass wouldn’t work.
  3. Within roots crontab (sudo crontab -e) I appended at the end “@reboot /bin/powermate.py &” (I moved the script to the /bin folder), the & makes it run in the background. You’ll still see echoed events from it, which you can get rid of using a nohup command, but I don’t care - this is a dedicated pi (I also transitioned to a $5 RBP Pi Zero W)

All works well, but it’s a tad slow sending volume commands due to all of the moving parts here. But what is cool is that I made zero changes to the Ropieee RBP since it auto-updates. Just sending amixer commands via SSH to it. I did set a static IP reservation within my DHCP server in case the IP decides to change. So, this should work indefinitely as long as the SSH remains enabled and the password doesn’t change for root :slight_smile:

And I don’t know why I even did this. There is a roon extension created by Danny that supports the powermate for doing a multitude of things. And it’s MUCH more responsive adjusting volume this way (obviously you need a DAC that supports direct volume control via USB).