first i have to thank aircookie and involved developers for the phantastic work.
My first wled project is up and running without any problem.
Now my idea.
I’ve build a while ago a sunrise alarm clock with the fastled-sunrise.ino by jasoncoon
It would be a great idea to implement it in wled.
But i have no idea where to integrate the different parts of the code.
My programming skills are not the best, but i am on the way.
Maybe sombody can give me some brain input, where to start.
Please try the “sun rise” feature of the NightLight for this.
Sun Rise is like Nightlight but with additional color-transition from the primary to the secondary color.
paste this string to one of the macro slots:
@Def3nder
the code looks good but it does not run. color transition stops at a light orange, the w2-channel do nothing. I tested it on a wemos D1 mini with a ws2812b GRBW Strip
@Def3nder you missunderstood . I’ll tried with a 4 ColourStrip R G B W ! But the G and R Channel are changed.
The W Channel do nothing and the RGB Channels stay static when they reached “orange” .
the RGBW analog strips are usually coded RGWB - so you need to connect the right PINs to the strip.
One question: is the strip displaying “normal colours” with separate white channel when using without the sunrise effect ?
@Def3nder without the effect every selected colour and warmwhite are displayed correct.and ofcourse the strip is a digital one with (V+, GND) and the Data in connected to pin D4 on a wemos D1 mini.
@Def3nder I tested and double checked every parameter of the macro.
The result: The &W2=255 do nothing. I also tried &W=xx with the same effect. Nothing.
Hy @Def3nder , it’s possible to use 3 segments and put a segment like sun in the middle? If you have an 100 LEDs the sun will be like 20-30 LEDs in the middle. Thanks
hmm - I now remember that I had similar issues with “W=…” parameter.
The way I solved this is that I coded the color itself “CL=…” and “C2=…” as 4-byte value with the order W,R,G,B.
My son has a transition from dark red to yellow within 10 minutes and this is the macro (it’s a normal RGB strip without white channel):
FX=0&CL=h00FF0000&C2=h00FFB14A&A=5&NL=10&NT=255&NF=2
- The corresponding color is 255,0,0 (W=0) with brightness 5 (A=5)
- the target color is 255, 177, 74 (W2=0) with target brightness 255 (NT=255)
- transition time 10 minutes (NL=10) - be aware: this is remebered
and does override the value in the LED-settings -> Timed Light -> default duration.
I use another macro the turn-off the light an hour later and reset this value:
T=0&NT=0&NL=20
My daughter does not like the red-to-yellow transition and she has an analog RGBWW strip - this is the macro:
FX=0&CL=hFF000000&C2=hFF000000&A=5&NL=10&NT=255&NF=2
- The corresponding color is 0,0,0 (W=255) with brightness 5 (A=5)
- the target color is 0,0,0 (W2=255) with target brightness 255 (NT=255)
I first tried this with 3-byte values for “CL=…” and “C2=…” and “W=…” + “W2=…” but that did not work.
With the above you include the “W=…” value as first byte of the “CL=…”
Hi @Mariu86, hhmmm - that could be possible - however, you need to select this segment first to control this with the macros and the NightLight Effect does influence the whole strip … don’t know for sure right now.
@Aircoookie: what do you think: when dealing with multiple segments how does this work together with nightlight ?
@Def3nder
I found no usable colour calculator for RGBW to 4 bit HEX.
Any idea how i can setup my CL= dark red with 0% W and C2=light orange with 50% W ?
yes, just calculate the RGB values as hex (100% red = FF0000) and then add the white value up-front.
So 100% red without white = 00FF0000. For the API you need to add h in front, so this becomes CL=h00FF0000 (and remember to use capital letters and a non-capital h).
This is the color only - the brightness is separated from this in the A=... value.
A light yellow could be FCBA00, adding 50% white is 128 = 80 hex, so it becomes C2=h80FCBA00.
So the macro line with effect “solid” and a transition of 10 minutes would be:
@Def3nder: The result after the first macro --> nice orange but no white! first macro
the second is the same second macro
The white channel slider stays at 0%
that is my configuration.
LED 4-ch. and auto-white is off.
Thats the point,where i am out, because your macros are right and easy to understand.
Sometimes computers going strange ways!