Macros, Presets and how to use a button

Hello, I would like to used a button to perform some basic functions but I am struggling. I have the button connected and it works perfectly with the defaults. What I would like is:
short press: cycle colors
double press: cycle preset (to cycle from my fav 5 animations)
long press: power toggle

Unfortunately I cant seem to identify how to do this in the new version. I know macros are gone as of 0.11.0+ but presets are far too complex for me!

Any help would be greatly appreciated!

You can use macros in presets. :wink:

Thanks @tonyno, yes I did see that but I couldn’t get it to work. This is almost definitely user error on my part, due to lack of coding background I believe I could have my syntax wrong.

Is there any chance somebody could paste some code from a preset they have that has button functions so I could see what a correct example looks like?

On the Presets · Aircoookie/WLED Wiki · GitHub page it says:
API command
If you know your JSON, you can even create playlists of other presets!

This is exactly what I want to do! I have no idea on how to write it. Does somebody have an example please?

The wiki is your friend…

1 Like

Thanks @tonyno yes I have the playlist code working no problem. What I want is to trigger the playlist with a button press?

For example I have the code below saved as preset 1, but how do I trigger preset 1 with a button press?

{
“playlist”:{“ps”:[2,3,4,6],
“dur”:[30,20,10,50],
“transition”:0,
“repeat”:10,
“end”:21}
}

Time & macros, Macro presets, Button short press Preset, enter 1 there.