USB remote control?

I used a g40s remote which has a mini USB dongle RF receiver. I think It worked out of the box for the commands next, previous, pause/play and volume but I couldn’t get the power off to work initially.

I tried a number of methods to get power off to work but none would. So I ended up using this method under the heading ‘Headless or No Desktop Keybindings’ which worked.

I then edited the audio.conf file as follows

#VOLUMIO TRIGGERHAPPY CONFIGURATION FILE LOCATED AT /etc/triggerhappy/triggers.d/audio.conf

#MUTE TOGGLE
KEY_MIN_INTERESTING 1 /usr/local/bin/volumio volume toggle

#VOLUME UP
KEY_VOLUMEUP 1 /usr/local/bin/volumio volume plus

#VOLUME DOWN
KEY_VOLUMEDOWN 1 /usr/local/bin/volumio volume minus

#PLAY PAUSE TOGGLE
KEY_PLAYPAUSE 1 /usr/local/bin/volumio toggle

#NEXT
KEY_NEXTSONG 1 /usr/local/bin/volumio next

#PREVIOUS
KEY_PREVIOUSSONG 1 /usr/local/bin/volumio previous

#STOP Not working
#KEY_BACKSPACE 1 curl localhost:3000/api/v1/commands/?cmd=stop
#KEY_BACKSPACE 1 /usr/local/bin/volumio stop

#CLEAR QUEUE
#KEY_HOMEPAGE 1 curl localhost:3000/api/v1/commands/?cmd=clearQueue
KEY_HOMEPAGE 1 /usr/local/bin/volumio clear

#PLAYLISTS
KEY_1 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=AlphaBlondy’

KEY_2 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=Armin’

KEY_3 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=BruceSpringsteen’

KEY_4 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=ChemicalBrothers’

KEY_5 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=Classics’

KEY_6 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=CosmicGate’

KEY_7 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=FatboySlim’

KEY_8 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=Misc’

KEY_0 1 curl localhost:3000/api/v1/commands/?cmd=‘playplaylist&name=Queen’

I used https://volumio.github.io/docs/API/REST_API.html to get the commands right.

The playplaylist&name is just the playlist name created in volumio. The names can’t have spaces in them or it doesn’t work. I can now press a number on the remote and it plays the corresponding playlist. It deletes the previous songs in the queue before adding the playlist.

2 Likes