Make Effects only when button is pressed

Hello guys, i’ve installed strip led with WLED on my garage door (instead of standard blink light) but i’ve one question: I tried the button (gpio->gnd) and it works like a charms, but what i need is that the led does a pre-selected effect ONLY when the button is pressed (not short, not long etc press), because i’d like to link the button directly to garage door opener dry contact for blinking light. Can someone tell me if this is possible with the current version of WLED? i’m looking through macros and other stuff but nothing seems to be what i need…:frowning:

I guess it’s an enhancements…

I believe what you are looking for is a feature to have the button act like a switch - run config A as long as it is pressed and config B when it is not pressed/released. I believe I could add such a feature quite easily soon :slight_smile:


Yes exactly :wink: as long as the button is pressed , run some configuration, when the button is not pressed anymore stops the current effect …Btw great works really, i made a donation such work deserve it :wink: Thank you!

1 Like

It seems like we would need to eliminate the short, long, and double-presses for this, which I think I’m okay with. Replace what is there with only button-down and button-up logic.

To me , this implies a ButtonA, and ButtonB, ButtonC…

1 Like

Was this ever implemented?
I am also trying to make all the LEDs red when the button is pressed and then go back to whatever it was doing before the button was pressed.

My other thought was to do it with custom code but I was not sure if I would be able to use the same GPIO pin?

All I have been able to do so far is use the button to call a macro but it will not go back when the button is released.

You can do this with two presets using the HTTP API commands to save/load a preset. The first preset (button on) saves the state and switches to a red preset. The second preset (button off) loads the saved state.