Universal Bluetooth and USB remotes support

After I added to my Volumio box a support of bluetooth airmouse (Added support of bluetooth remote G20BTS PRO to my Volumio on RPI4 - #4 by Wheaten) I developed much more sophisticated script. See:

Main features:

  1. It is universal, must work for all such devices without any code changes. IR based remotes can work via Flirc USB dongle (https://flirc.tv)
  2. Multiple connected HID devices are supported, each of them will work
  3. Hot plug/unplug of USB devices is supported, after hot plug new device will work immediately without restart
  4. User can prepare file of favorites, they are assigned to keys from 0 to 9 - they are present on lot of remote controls. To each such key a playlist element can be assigned. When appropriate key is pressed, playing will start immediately. When this file is edited, it will be reloaded automatically without need to restart

It can be easily converted to Volumio plugin, but I did not do so because of few reasons:

  1. I don’t know if there is a need in such plugin
  2. I am not Web developer (and have no intention to become), so I can’t make GUI for it, for example to assign current playing item to remote key.
  3. I developed it for my own DIY project - this player will have volume knob and bluetooth remote. And I wanted to be able to turn on my favorite radio stations and playlist by pressing single button on my remote

After I started to use it, I even purged unneeded triggerhappy service, that came with Volumio, but did not work for me (sudo apt purge triggerhappy)

3 Likes

Thank you very much for sharing - maybe this could be integrated into the fabulous IR remote plugin to make it an universal remote plugin … just a wish

Unfortunately i am also not a coder to do so

Did triggerhappy interfere anyhow or did you only kick it to see if it‘s working without it ?

Best Regards
Josef

My code interoperates with triggerhappy. I purged it only because triggerhappy is not needed in my setup. Furthermore, if your remote works with triggerhappy (mine does not), it will work with my code too, and maybe each key press will be processed twice (both by triggerhappy and my script)

Hello. Installed according to the read.me on github. Doesn’t work. Looks like it doesn’t start watchdog. Doesn’t respond to bluetooth remote. How to fix?

sudo pip3 install watchdog

Thanx. Done but still do not work. Start? and hang? and no reaction on bluetooth remote. What next?
Screenshot 2025-04-25 at 07.57.38

Please read installation instruction in Github. I wrote both about watchdog and the fact, that this script is intended to run as service only and not as standalone program

Installation

This service requires some additional packages to be installed Enter your volumio box with ssh and do following:

sudo apt install python3-pip

sudo apt install python3-evdev

sudo apt install python3-pyudev

pip3 install janus

pip3 install watchdog

Copy file remote_buddy.py to /home/volumio and give execution permission: chmod +x remote_buddy.py

Under sudo create file /lib/systemd/system/remote_buddy.service

sudo systemctl enable remote_buddy

sudo systemctl start remote_buddy

Thank you. I followed the instructions in the readme:

sudo apt install python3-pip
sudo apt install python3-evdev
sudo apt install python3-pyudev
sudo pip3 install janus
sudo pip3 install watchdog

(copy remote_buddy) by Samba

cd remote_buddy
sudo cp remote_buddy.py /home/volumio/
chmod +x remote_buddy.py (and get info and set 755 in Transmit)

sudo cp remote_buddy.service /lib/systemd/system/remote_buddy.service

sudo systemctl enable remote_buddy
sudo systemctl start remote_buddy

sudo python3 remote_buddy.py

Not working

Did you pair your bluetooth remote with RPi?

1 Like

Thanx for your help. Can’t pair. It’s BLE remote and Raspberry Pi OS do not find it as a bluetooth. Can you know the way to connect BLE to Pi/Volumio?
Screenshot from macOS:
Screenshot 2025-04-26 at 11.09.52

Try this:

  1. bluetoothctl list
    This checks if bluetooh controller is enabled
  2. Switch your remote to pairing mode
  3. bluetoothctl scan on
    If you see your remote, copy it’s MAC address
  4. bluetoothctl connect XX:XX:XX:XX:XX:XX

Maybe you’ll need to do bluetoothctl power on

bluetoothctl power on
bluetoothctl discoverable on
bluetoothctl scan on

Buster (Volumio) or Bookworm (PiOS) do not find Bluetooth Low Energy as bluetooth device. Maybe find other way (HID over Gatt) but haven’t tried it yet.

It can’t find the damn remote. No way. Not via bluetoothctl, not via gatttool, not via BlueZ. The nearby MacBook connects and works without any problems. I give up.