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:
- 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)
- Multiple connected HID devices are supported, each of them will work
- Hot plug/unplug of USB devices is supported, after hot plug new device will work immediately without restart
- 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:
- I don’t know if there is a need in such plugin
- 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.
- 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)