I’m setting up a WLED powered sunrise alarm. I’ve used API commands &FX=0&CL=hC06000&C2=hFFFFFF&W2=255&A=2&NT=255&NL=30&NF=2 for the nightlight to automate this fairly well, but I’m still having trouble with the initial brightness.
To get the level of light at the end to simulate full sun coming in a window, I’m using two string of 144 SK6812s. The problem is that the minimum brightness for these is around 37%. So going from pitch black to 288 LEDs on at 37% is still a rather big jump, enough to wake me up jarringly rather than gradually.
The solution to this would be to turn on 1 or 2 LEDs at a time, but I can’t figure out how to automate this transition the same way I can with brightness or color. I could probably do it by creating 144 presets and using a playlist, but that’s a lot of manual work if there’s an automated solution.
You could try a Wipe/Sweep effect on a Mirrored segment.
That way you’ll get a few LEDs from each end (or the middle if you add Reverse) building to a full strip.
With timing and then brightness increases, things should get pretty gradual.
For more finesse, you can break your strip into multiple segments and do the same thing on each piece.
Thanks for the suggestion. I was hopeful this would be a solution, but even at the lowest speed it’s way too fast. To mimic an actual sunrise (which I’ve done measurements for) I’d need to go from 0 LEDs to 288 LEDs over the course of 20 minimum.
Is there a way to use the API to do something like:
Have you looked at the transition time between presets in a playlist?
You should be able to get 65 seconds of transition time.
The other possible tool would be to play with NightLight feature that allows for for fade out and fade in (Sunrise mode) of 1-255 minutes. Checkout the JSON API in the KB.
That was going to be my fallback option, but to get anything close to a smooth increase it would seem like I’d have to create a huge number of presets. Is there some, even semi-automated, way of doing that? I guess I could always use the backup/restore and edit that file.
I could if it comes to that, but isn’t the point of WLED to save people from going to that trouble? I guess I didn’t think that turning on every LED in a strip one at a time over a set period was such an usual thing.
Does anyone know where the code for effects is located? Maybe the simplest thing would be for me to just modify the wipe code and submit a pull request.
Looked back at your original post and see that you did try an initial use of the Night Light function.
Have you tried expanding/testing that in a couple of ways:
Create a simple preset using the API to create a solid White at brightness=1 for your entire strip.
That should show you the minimum brightness you can expect from your setup
Try upping that brightness value one step at a time to see what increase values are acceptable
If those are all too much, try creating a segment that uses a spacing greater than 0 to “skip” LED’s
That will give you say 1/5 (at spacing 4) of the LEDs evenly spread.
Set the desired final brightness of the Nightlight mode to less than 255.
That should give you time control of an initial “minimum” brightness level from 0 to min in 1 preset.
Add a second preset that goes from min brightness to your next level using more LEDs
If preset 1 uses 60 spaced LEDs up to a brightness 30, preset 2 could start with brightness 5 and use 180 spaced LEDs. Carry on with the next nightlight to handle this brightness.
You should be able to get up past your 37% brightness in 1 or 2 presets and then carry on to max in a final.
So I ended up resorting to just making a bunch of presets and running them in a playlist. I choose 72, which was reasonably close to 1%, but still divisible in my 288 strip. Thankfully Settings > Security & Updates has the ability to export and import the JSON file, so this wasn’t too painful. However, you have to make sure to run the file through a pretty strict JSON validator and even remove any unnecessary trailing commas.
But now I’ve found another issue. For the second half of the sunrise, I’m using the nightlight function and can’t seem to get it to work with the white channel. I’ve posted here in case anyone has any suggestions.