WS2812B change individual lights with ESPHome FastLED Clockless

Hi

I’ve been playing around with ESPHome for a while now and have managed to setup a few custom effects, nothing special.
The one thing I can’t seem to work out is how to change the colours of the LEDs individually, for example have the first 10 red, the next 10 blue and the last 10 green.
I looked at the partition thing but I want my effects to still work as one constant strip.
I’ve also looked at the lambda effect however I didn’t understand a word of it.
Can somebody please explain how to archive this.
TIA Dan

I haven’t tried it myself but looking at the docs and trying to create something similar, my guess for something to try would be:

light:
- platform: fastled_spi
  effects:
    - addressable_lambda:
        name: "My Custom Effect"
        update_interval: 16ms
        lambda: |-
          for (int i = 1; i = 10; i++) {
             it[0] = light::ESPColor(255, 0, 0);
          }
          for (int i = 11; i = 20; i++) {
             it[0] = light::ESPColor(0, 0, 255);
          }
          for (int i = 21; i = 30; i++) {
             it[0] = light::ESPColor(0, 255, 0);
          }
1 Like

Hey. Is there any sleep or delay in the for statement? I can’t find anything :confused: