Triggerhappy playlist code

Hi could someone tell me what the code is for playing a playlist using the triggerhappy config file ?
Just this one feature im missing.
I would think you have to use the curl feature ? No programming skills so im lost.

Thanks in advance.

Have a look here maybe of some use.
You can send those command from the address bar of a browser or using curl from a command prompt / script etc

Hi,

I did but couldn’t find anything related.
If I just got an example I can adjust it to my playlist.

In Moode player,

mpc load “playlist”

is used.

Will this work in Volumio ?

1 Like

Ever so sorry…my link didnt show. REST api is what you should be looking at.
You can load playlist via the web browser address bar or or using curl from a command prompt / script etc

LINK

1 Like

Thanks !

1 Like

Just a note. As this got me when I first started using it.

If you are sending those commands via the web browser address bar then they will work as is.
But… if you are sending via command prompt or SSH and the command contains an & symbol you will need to wrap that particular command in quotation marks otherwise it will not work.
ie.

  • Play a Playlist
volumio.local/api/v1/commands/?cmd=playplaylist&name=Rock

.
.
Via command prompt should be

  • Play a Playlist
volumio.local/api/v1/commands/?cmd="playplaylist&name=Rock"
1 Like

Sadly, i cant get this working.
Keyboard is attached to my player.
I tried different combos, these dont work :thinking:

KEY_B 2 /usr/bin/curl localhost:3000/api/v1/commands/?cmd=“playplaylist&name=2023”
KEY_B 2 curl localhost:3000/api/v1/commands/?cmd=“playplaylist&name=2023”
KEY_B 2 /usr/bin/curl -i --header “Content-Type: application/json” localhost:3000/api/v1/commands/?cmd=“playplaylist&name=2023”

help :melting_face:

Triggerhappy (never used it) from a quick google is a keyboard hotkey program…right?

But first things first.
Get the commands working in the command window first.

Are you running Volumio on the same machine as you are sending the commands ?
These work for me if I SSH into the machine, which is the same as being on the same machine

curl localhost:3000/api/v1/commands/?cmd=“playplaylist&name=stuff”

curl 127.0.0.1:3000/api/v1/commands/?cmd=“playplaylist&name=stuff”

or even the Volumio machines own ip address will work.

curl 192.168.0.19:3000/api/v1/commands/?cmd=“playplaylist&name=stuff”

.

.

But if you are trying to do this from a remote machine ie my windows PC command prompt…then

only this works

curl 192.168.0.19/api/v1/commands/?cmd=“playplaylist&name=stuff”

The ip shown needs to be the ip of the machine you are trying to reach.

When you get it working from the command prompt then you should configure the triggerhappy program.
But remember… if you are sending from a browser address bar then you dont need the quotation marks or curl. Does the tiggerhappy program send in the same mannor ?
Might be worth trying command without special characters also to see whether its those causing the issue.

Good luck

1 Like

Yes Triggerhappy is a hotkey program. Great add to my players :slight_smile:

Thanks for the tips, the curl command works form a different laptop on my network.
Now i need to get it working from the player itself as my mini keyboard is attached to the player.

Ok so the curl command only works in Windows cmd.
In Linux terninal i get the same error as on ssh to the player.

{“Error”:“command not recognized”}

Ok if i type this command ;

curl localhost:3000/api/v1/commands/?cmd=playplaylist&name=2

i got this reply but nothing happens with my player ;

$ {“time”:1706729781883,“response”:“playplaylist Success”}
[2]+ Done curl localhost:3000/api/v1/commands/?cmd=playplaylist

Thats some progress, i guess :slight_smile: