JSON: Start Preset by Quick Load label

Howdy - just switching over a lot of my custom LED projects from home-built drivers to WLED and overall, loving the WLED software and support.

One thing I have run into when running multiple WLED ESP32s is that preset #s are not easy to keep consistent across units. For example, I have some “time of day” presets like ‘early morning’, ‘daytime’, ‘evening’ and ‘overnight’ as well as others like ‘entertaining’, ‘alarm_mode’, etc.

These are triggered from a central server (vs time of day in WLED) that enumerates and communicates with them all (and will eventually by MQTT based, but…). Each WLED instance has it’s own setup for each common ‘mode’ or ‘schema’, but they are all related by purpose.

Individually, this is an easy thing to do. But when setting up multiple WLED instances (I have 12 now and will be likely hitting about 24 in the next month or so) and wanting them all to be able to say “switch to entertaining lights”, the problem is that it’s difficult to get all preset numbers to be the same (as the unit may do other things).

I’m making an effort to “be careful” as I setup each WLED instance, but it would be nice if there was an alternate way to start the preset with an identifier that can be freely edited but not get in the way of labeling/identifying the preset.

The Quick Load label struck me as a useful way. It can easily be edited, is divorced from the preset # and the label/description and already is used to setup quick load buttons which is at least arguably in the same semantic “ball park” :wink:

So, before I dug into the code, wanted to run this by the world and see if

  1. Do folks think this is a good/bad/silly idea?
  2. Would it be better to add a identifier/key to the JSON state object (like ‘psq’ or similar) for GET and POST (at least POST)?
  3. Or extend the “syntax” of the preset ‘ps’ key to have some prefix character (like $ or % or something) that says “what follows is a quick label, not ID #”).
  4. I feel this would be logically extended to starting Playlists too.

I can also see adding the ability to query the list of presets (returning number, labels, quick buttons, etc). But that is likely a separate issue.

I know that space is limited and my guess is that this wouldn’t take up a lot of code space.

But it would allow you to say “turn on Evening Lights” to all WLEDs without having to know how each WLED instance presets are ordered.

I’d be curious on folks thoughts.

Gerry

You can backup presets and then restore them on each new device. If you have different segments set up on each device, uncheck “save segment bounds” when creating a preset.

If you are using 0.13 then there is a backup button in Security & updates settings page otherwise navigate to http://wled.local/edit, right click on presets.json and select Download. On new device select Upload.

With this approach you’ll be able to keep all of your presets identical across all ESPs.

That would be helpful for some similar WLED installs that could share similar presets. But the installs are all different and what the preset does varies by each different unit as well.

So I have some that run driveway lights, some that run under kitchen counter lights, some that run lights in my eves, some that run lights in my workshop, etc.

What each preset does varies quite a bit from install to install, but they all have the “concept” of “entertaining lights” or “early morning lights” (the specifics of each preset being tailored to that install).

So what I’m looking to do is presets where the definitions of each preset is potentially unique/different and because of just managing and history, the preset ID vary too.

Using the Quick Load would let me pick and chose the appropriate preset on each install (potentially even allowing me to change which preset should respond to “entertaining” lights situation) to trigger.