But in both cases the transition is not smooth, and is very noticiable if is like 5s long.
It kind of goes to black (not al the times, but often) and then quickly change to the expected color at the very end, even if this behavior is not consistant, and sometimes seems more smooth than others.
Im using an ESP32-Wroom and sendig this command via home assistant api:
The wiring is pretty simple:
VIN --------- STRIP+
GPIO14 — STRIP DATA
GND --------STRIP GND
But most importantly, the strip is only two leds, so minimal consumption.
And i tried a transition witha. lambda function:
light:
- platform: neopixelbus
type: GRB
variant: WS2812
pin: GPIO14
num_leds: 2
name: "RGBLight"
id: "RGBLight"
effects:
- lambda:
name: "TransitionRB_5S"
update_interval: 20ms
lambda: |-
static float out = 0.0;
static float duration = 5; // Duration in seconds
static float totalSteps = duration / 0.02; // Total steps for 1-second transition
static float increment = 1.0 / totalSteps;
if(initial_run) out = 0.0;
auto call = id(RGBLight).turn_on();
call.set_transition_length(100);
call.set_rgb(out, 0.0, 1.0-out);
call.set_brightness(1.0);
call.set_publish(false);
call.set_save(false);
call.perform();
out += increment;
if (out >= 1.0) {
out = 1.0;
increment = -increment;
} else if (out <= 0.0) {
out = 0.0;
increment = -increment;
}
It goes very smooth over the 5 seconds, so I don’t think it is an electrical problem.
The issue is that i want to be able to control the transition color and duration dynamically, just by sending a mqtt or an api request.
I’m open to any alternative, maybe WLED s a better approach?
The problem with that setup is that neopixel max VCC voltage is Vdata/0.7. So if your Esp32 has data line at 3.3V, Vin should be max 4.7V.
Ideally 5V supply and data trough level shifter. Even 3.3V supply voltage might work better.
Anyway, if it works with lambda, voltage level is probably not your problem.