Save current State, play preset and then resume

Hi guys,
I’m fairly new to WLED and I love it, but I’m a little confused:
I want to create a little device with a battery. I figured out how i want to tell my ESP that the battery is getting low. I want to pull a pin of the ESP high periodically. When the pin gets pulled high I want to save the current settings, flash the leds red once and then resume to the saved state. I’d prefer if i could save the current state to ram somehow so the flash won’t war out to quickly.
I’ve read already that this would be possibly with macros in the presets, but I’ve trouble figuring out how it’s done.
Can someone please explain to me how I can achive this?
Thanks in advance for helping me!

Okay, by looking at the code I believe I’ve figured out that a preset with the id 255 will be saved to ram, but I can’t figure out how macros in presets work and how they interact with each other :joy:
how can I set a specific pin in the presets for button activation?

Macros is the old name for Presets. Anything that was done in a macro can go into a preset.

Button pin assignment is in LED Preferences.

Well, it doesn’t explain how to achieve what I wanted to do with buttons or HIGH/LOW levels, but I figured out I could just use a serial connection and send the commands by the microcontroller which I wanted to use in my device anyway. This approach works perfectly fine! :relieved: