"Partial Preset" - possible?

let’s say my garage leds #1-1500 are along the walls, but #1500-2000 are over the doors.
Is it somehow possible to make a preset where #1-1500 continue to do whatever they do, and #1500-2000 are set to said “partial preset”

The idea is to provide extra light over the garage door once it’s opening, not affecting the other sides of the garage.

Yes, use JSON API directly in preset.

1 Like

could you please point me to an example?

All the info you need is in the KB JSON API - WLED Project

And you can use your own presets as examples. Click on a preset and take a look at that preset’s content. If you have Notepad++ with the JSON plugin or similar tool, you can expand the JSON to make it more readable. You can make your tweaks to the JSON, compress and save to a new preset by clicking the “New Preset” button and unchecking the “Use current state” checkbox.

1 Like

And if wasn’t clear from our responses, Blaz and I both assumed separate segments for the LEDs over the garage door vs those on the wall. Once you separate them into different segments, you can check/uncheck the “selected” checkbox on each segment to set just that segment’s color/effect.

It does not seem to work for me.
I’ve setup a small 60LED test.

Made a preset where LED 50…60 should shine yellow:

{“on”:true,“bri”:128,“transition”:7,“mainseg”:0,“seg”:[{“id”:0,“start”:50,“stop”:60,“grp”:1,“spc”:0,“of”:0,“on”:true,“frz”:false,“bri”:255,“cct”:127,“col”:[[167,170,2],[0,0,0],[0,0,0]],“fx”:0,“sx”:102,“ix”:110,“pal”:0,“sel”:true,“rev”:false,“mi”:false},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0},{“stop”:0}]}

The “problem” is that whatever led 1-60 is doing, when I load this preset. - then 0…50 is turned off, and 50…60 is as expected.

The goal is to keep LED’s 0…50 remain unaffected, and only change 50-60.

No, it wouldn’t. You’ve only got one segment in your test. You need at least two to do what we are suggesting.

Refer to the segments section of the KB
https://kno.wled.ge/features/segments/

I think what you suggest is that all my presets contain two segments.
and so for each preset - I can select one as you described - that does what you say (that part works)

What does not work for me then, is the sync between the segments - if both segments are set to “breathe” or “sweep” - or any other where a sync is expected - then they will do their own stuff at their own timing. (mostly due to different length?)

That’s why I try to figure out if there is a way of “overriding” a section, while all the other LED’s act as normal. (then I could have one big section - that worked as expected)

That is the best way. I’m not positive it will work. But you may be able to do it by using an API command that resized segment 0 but didn’t set its color, palette or effect (so what ever was set there would continue playing); and adding segment 1 that had your color set for the overhead lights. Then you’d need “return to normal” preset that deleted segment 1 and resized segment 0.

I’m not sure how you have your lights routed. But if you are going around all three sides of your garage door, then another option is to break it into 3 or 4 segments with each side being a segment and the top being either 1 or 2 segments. Then reverse every other segment so it all flows smoothly towards the corners.

Your segment ID is wrong and if you want to only change effects and/or colors on segment do not include segment bounds.
Only include what you want to change not everything API allows.

So you’re saying don’t even bother resizing segment 0, just define a new segment 1?

I normally use boot preset to set up segments and then use presets without “saved bounds” to apply effects to LEDs (assuming your segments do not change - as someone would expect in above or my case).

So yes, if you want to apply effect 35 to segment 2 all you need to do is "seg":[{"id":2,"fx":35}]. Or to apply effect 5 to segment 0 and at the same time apply palette 13 to segment 1: "seg":[{"id":0,"fx":5},{"id":1,"pal":13}]

Yes, that is generally what I do also (segment setup in boot preset).

However, OP is wanting to have segment 0 set up as 0-2000. And then when something triggers it:

  1. Resize segment 0 to 0-1500 without changing whatever effect, colors and palette was currently playing
  2. Make a new segment 1 from 1500-2000 with solid effect and a yellow color

And then, I assume, after some time trigger another preset that removes segment 1 and resizes segment 0 back to 0-2000. I’m just not sure if you can redefine segment 0 and have it continue playing the previous effects. I’m thinking something like this, but I’m not positive it will work and continue playing previous effect.

{“seg”: [{“id”: 0, “start”: 0, “stop”: 1500}, {“id”: 1, “start”: 1500, “stop”: 2000, “fx”: 0, “pal”: 0, “col”: [[167, 170, 2]]}]}

and to stop the door opening effect

{“seg”: [{“id”: 0, “start”: 0, “stop”: 2000}, {“stop”: 0}]}

That is not possible.

However, you can always use simple "seg":{"fx":5} to apply effect 5 to all selected segments.
Note no “id” and not enclosed in square braces.