According to the Volumio command line client documentation
volumio stop
stops the Volumio service, not playback. So I wouldn’t use that command for a hotkey/remote/etc.
I don’t know if Volumio does have a command to stop playback at all - only pause.
I started to play around with the command line client. Indeed playback commands don’t seem to work at all. Things like ‘status’ and ‘volume’ work as expected, but using ‘volumio play’ or ‘volumio next’ simply does nothing.
Using ‘/volumio/app/plugins/system_controller/volumio_command_line_client/commands/playback.js play’ directly shows the same behavior, so I guess there’s a bug in that file. I’m not able to see it, though
I would like to implement a super simple way to have some basic volumio (2) control with a keyboard or similar (joystick?) thing (without soldering/using GPIO pins which are used by the DAC).
My current idea:
use a USB numpad
maybe use “triggerhappy” as discussed here?
use REST API?
Assuming “KEY_1” the correct triggerhappy key for the key “1” I assume then putting something like:
in the config file (as explained above) would make volumio play the playlist named “1stPlaylist”.
Am I right in assuming this works? (Unfortunately I just notice the command “playplaylist” doesn’t seem to be recognized…)
Any idea how this could work? Or a simpler idea?
Hard- and software wise?
(I would like my 3-year old daughter + my wife to be able to press a simple key to play something predefined without starting a bigger programming/engineering project…)
If I understood well, I cannot use mpc commands to play playlists?
Thanks, wow! This way I was able to use the wireless remote control with USB dongle offered by HiFiBerry. Very good deal, lightweight and good quality clickable buttons.
I programmed these keys:
So the following keys excluded, because they were not recognised or there was no use for them:
KEY_UP
KEY_DOWN
The on/off key does not work
The home key does not work
The pointer key does not work
Here’s an updated config file for triggerhappy with extended functionality that works with the hifiberry USB remote and the current build of Volumio (2.861). Here are the contents of /etc/triggerhappy/triggers.d/audio.conf
#VOLUMIO REMOTE TRIGGERHAPPY CONFIGURATION FILE
#MUTE TOGGLE
KEY_HOME 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_ENTER 1 /usr/local/bin/volumio toggle
#FAST FORWARD 10 SECONDS
KEY_UP 1 /usr/local/bin/volumio seek plus
#REWIND 10 SECONDS
KEY_DOWN 1 /usr/local/bin/volumio seek minus
#NEXT SONG
KEY_RIGHT 1 /usr/local/bin/volumio next
#PREVIOUS SONG
KEY_LEFT 1 /usr/local/bin/volumio previous
#TOGGLE RANDOM
KEY_COMPOSE 1 /usr/local/bin/volumio random
#TOGGLE REPEAT
KEY_ESC 1 /usr/local/bin/volumio repeat
#CLEAR CURRENT QUEUE
KEY_POWER 1 /usr/local/bin/volumio clear
After editing, you must restart the service with
sudo /etc/init.d/triggerhappy reload
Functions of each key are listed in the comments above the command.
IMPORTANT NOTE: This remote has a mouse control button in the upper right of the control. This button toggles mouse mode and totally messes up the mapping, making the remote almost useless. Don’t push it, don’t map it, and the keys above will work just fine.
And it works so far with the default Playback options. But I would like to assign some keys to my Music Library Network Shares Folders. Like pressing button 1: starts the playback of the first folder, pressing button 2 : starts playback of the the second folder, etc… (This remote has may keys). How can I specify this in the triggerhappy config file? Thanks!
Edit: So the be more clear: If I want start the playback from my NAS (SMB) Share like the folder called (i.e.) “Remixes” what should I type in the config line?
I have already solved both the Playlist and the Radio playback with this method on Volumio v.2.917. But will this triggerhappy “workaround” also work with the new v.3.x, just like it was with v.2.917? Anyone here had tried it so far? (I will only update to v.3.x if I can make it work again flawlessly, as the remote controller is essential for me).
I have configured Volumio (3.179 on RPi4) for the OSMC remote control.
here is my /etc/triggerhappy/tiggers.d/audio.conf
#VOLUMIO TRIGGERHAPPY CONFIGURATION FILE
#MUTE TOGGLE
KEY_ENTER 1 /usr/local/bin/volumio volume toggle
#VOLUME UP
KEY_EQUAL 1 /usr/local/bin/volumio volume plus
KEY_EQUAL 2 /usr/local/bin/volumio volume plus
#VOLUME DOWN
KEY_MINUS 1 /usr/local/bin/volumio volume minus
KEY_MINUS 2 /usr/local/bin/volumio volume minus
#PLAY PAUSE TOGGLE
KEY_PLAYPAUSE 1 /usr/local/bin/volumio toggle
#STOP
KEY_STOP 1 /usr/local/bin/volumio stop
#CLEAR
KEY_ESC 1 /usr/local/bin/volumio clear
#NEXT
KEY_RIGHT 1 /usr/local/bin/volumio next
#PREVIOUS
KEY_LEFT 1 /usr/local/bin/volumio previous
#SEEK FORWARD
KEY_UP 1 /usr/local/bin/volumio seek plus
#SEEK BACKWARD
KEY_DOWN 1 /usr/local/bin/volumio seek minus
#REPEAT
KEY_C 1 /usr/local/bin/volumio repeat
#RANDOM
KEY_I 1 /usr/local/bin/volumio random
A couple of points I learned that are not in this thread:
to restart the service in V3 you need to run:
sudo systemctl restart triggerhappy
Not all events are on event0 so if you want to see all the button codes you need to run
sudo thd --dump /dev/input/event*
The volume control uses the step defied in the regular settings menu. If you use my config you should set the stepsize to 1 so that a single click on the volume up or down changes the volume by one increment, but pressing and holding gives a smooth increase or decrease for as long as it is held.
Just an FYI
I have a cheap Bluetooth remote control model G20BTS Mouse Remote Control.
I was able to pair it to my RPI4 and then used triggerhappy to control the volume.
Its Great!