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.
I have an ESP2866 based device (pre-made, so it should have the right supporting hardware, though I cannot be certain) that was working nicely with WLED for a while with a 72 LED strip. After a number of updates, and due to the older chip obviously, it started performing pretty bad.
I figured I’d give ESPHome a shot instead and use a basic neopixelbus based entity like you did above.
Funny enough I’m experiencing the same exact thing.
The transitions are really jerky, where sometimes the fade kind of “hitches” and often (but not always) it’s like the main LED of the previous color will turn all the way off so that the strip is basically black and then suddenly the other LED that is now relevant will pop on at the final light level.
I also noticed that sometimes the dot on the color picker in HA will snap back to the previous spot and then back again to where I set it during this transition. Makes me wonder if the hardware is just becoming flakey in general…