Save/Restore Current State

Here’s another… Would anyone else be interested in being able to Save/Restore the current state? Just a basic, push/pop type of thing. Either as functions, or API-calls for use in macros?

I’m sure I’m misunderstanding you here… this sounds exactly like what Presets do. How do you want this to work?

I’m trying to do this without using up a slot (or using the only slot, for now, if using segments).

My particular application would be to run macro x when the input is active, then restore what was going on before when it goes inactive. I already have the code setup to handle the input.

I suppose I could use &PS=16 and &PL=16 for now.

Actually there is a neat little undocumented feature that could be helpful for you. If you do PS=16&NP the preset will be saved to ram only and not yet persistently to flash memory. This prevents flash wearout if you use the command often :slight_smile:

2 Likes

Nice. then I could do a PL=16?

Update
I found I had to add the NP stuff to 091. :rofl:
I have this for macro 1: &PS=16&NP&TT=0&FX=0&R=255&G=0&B=0
and this for macro 2: &PL=16

Something is stepping on something else as slot 16 ends up being saved as red. I even moved the code to handle the saving up to the top in wled_set.

It’s in the wiki now. Hopefully semi-correctly placed.

1 Like

Working now!

What did you change from 19 hrs ago?

Since I’m still on 091, I had to pull the NP code in.

Hi,

I just updated to 0.11 and changed my son’s old sunrise effect (using Nightlight and Color-fade) to the new way of using the Effect “Sunrise” with this Preset settings:

{ “bri”: 128,
“udpn”: { “nn”: true },
“seg”: { “fx”: 104, “sx”: 10, “ix”: 255, “pal”: 35 }}

The “udpn”: { “nn”: true } has the effect that other syncronized WLED instances are not being notified - very usefull :slight_smile:

My only problem with thiis is, that the WLED state BEFORE the sunrise is gone after using this preset.

I would like to save the state, load this preset und one hour later restore the prevvious state.

I tried to call a macro with “PS=99” and then “PL=99” later, but this did not work (as in the then saved “Preset 99” the currect state wasn’t incuded :frowning: - instead “PS=99” was in there)

…any suggestions how to solve this ?

Is there a way to tell WLED via a JSON Object to save the current state ?

@Aircoookie what has been the reason why the "save to memory feature (&NP) was removed in Build 2011152 ? This would be perfect for me as the “save current state”-solution would be triggered once a day and would lead to 365 saves to the flash per year.