Setting push button

Hello guys. I want to use a push button to turn wled on and off. I make it work. I create 2 presets; 1 preset T=1 and another preset T=0 but I can just have one short press to make one funtion and a long press to do the other. How can I make that with a single press turn it on and off? The 2 api commands in the same preset? Thanks a bunch in advance… :blush:

There is a “toggle on-off” function in the API that covers this.
Take a look at: Push button for each segment - #4 by blazoncek
Also the API section of the docs: JSON API - WLED Project

I read those already but I am not that clear to understand it. And I am using push button…

Button 0 does that by default.

You mean the on board button? When I press that one it full reset the esp32 erasing all the settings. If I change the button 1 by 0 how I set both presets to respond to a single press?

That’s not right. I’m guessing you had a bad flash. What is the size of the file system in Info?

I have some presets already saved

Yep, bad flash. Your file system should have more than 61k. :wink:

Use the web installer.

:sob::sob::sob: and the worst part is that the wled is a acting good now. It wont erase the Led settings like was doing it before… How many kb must have?

What about now?

That’s better!

Great… Now how I set it to make it ON and OFF with a single pulse the same button in the same input? :blush:

As mentioned, that is the default for the built-in button.

Ok. I am not at home yet. So. I can just change the gpi23 where I have it now for gpi0 in button 0? No changes in macros? I still need the on and off presets? :blush: