Delay a command / stop music with a click of a button (Trigger Happy)

Hi all,

Im looking for a sollution the activate the sleep timer, or to delay toggle.
I tried using this py script from SANGERA2

But for some reason it only shuts down my player instead of stopping the music.

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

Is there a quick for this ? Can i add a delay in the command above ? How ? :melting_face:

Related topics :

Why not just using time.sleep(5) and avoid doing this via the socket.io?

1 Like

so something like this ?

#ACTIVATE SLEEP
KEY_ENTER 1 /usr/local/bin/volumio time.sleep( 5 )

was referring to your python script.
If you want to do it form bash you need something like:
/bin/bash -c "sleep 30; command to execute"

2 Likes

:melting_face: Still have no idea how i should do this. :grinning:
I tried adjusting my trigger happy config file to

#ACTIVATE SLEEP
KEY_ENTER 1 /bin/bash -c "sleep 30; command to execute"

But this doenst work

it should as I am using it also here:

YES, Thank you !
Took me a while to understand what you ment with ‘command to execute’ :grinning:

#TOGGLE PLAY/PAUSE AFTER 1 HOUR
KEY_ENTER 1 /bin/bash -c “sleep 3600; /usr/local/bin/volumio toggle”