Current_color in addressable lambda effect has no effect on color brightness

Hi there,

I am currently working on a clock based on some SK6812 individual adressable LED’s and a Wemos d1 Mini that runs ESPHome connected to Home Assistant. My goal is to have an addressable lambda effect that automatically starts on the boot up and handles which LED’s should be turned on depending on the time. So far everything is working fine and the right LED’s are turned on at the right time.

Now I also want to control the color of the turned on LED’s using the color picker in Home Assistant. I realized that I could use the current_color function in Order to set individual LED’s to the color selected in Home Assistant. That is also working. But with a twist. The SK6812 have an individual channel for white leds. And I also want to be able to only have the white ones turned on. Technically that is possible and Home Assistant offers three seperate sliders to control overall brightness, color brightness and white brightness. When not in an effect these sliders work as excpected. But as soon as the Clock effect is running the color brightness slider does not seem to have any effect when using the current_color function. So It is not possible to turn off all color channels and only have the white channel on.

I tried to search in the Documentation of ESP Home on how to get the individual values for colors and brightness to use them in the lambda function but with no success.

So to my question does anybody has an idea on how to make use of all color input values from Home Assistant (rgb values, overall brighntess, color brightness and white brightness)? A small example would be highly appreciated!

Thanks in advance!

Tk4arts

And here are some code snippets in order to illustrate my Problem.

This is the most relevant part of my .yaml file. There are two functions in an external file but they are just evaluating which LEDs should be turned on and that part is working. I hope you do understand my problem with the current_color function.

light:
  - platform: partition
    name: "${device_name} Master"
    id: ${device_name}_master
    segments:
      - id: ${device_name}
        from: 40
        to: 43
    on_turn_on:
      - light.control:
          id: ${device_name}_master
          effect: ${qlock_effect}
    effects:
      - addressable_lambda:
          name: "${qlock_effect}"
          update_interval: 32ms
          lambda: |-
            auto time = id(ds1307_time).now();
            if (!time.is_valid()) {
              return;
            }
            if ((int) (time.minute / 5) == 0) {
              it.all() = current_color;
            }
            else {
              it.all() = Color(0,0,0,0);
            }


  - platform: neopixelbus
    id: ${device_name}
    type: GRBW
    variant: SK6812
    method: ESP8266_DMA
    pin: GPIO3 #RX
    num_leds: 114
    name: ${device_name}
    on_turn_on:
      - light.control:
          id: ${device_name}
          effect: ${qlock_effect}
    effects:
      - addressable_lambda:
          name: "${qlock_effect}"
          update_interval: 32ms
          lambda: |-
            static bool ledMatrix[110];
            static bool ledDots[4];
            static bool ledAll[114];
            static int lastMinute;
            
            if (initial_run) {
              it.all() = Color(0,0,0,0);
            }

            auto time = id(ds1307_time).now();
            if (!time.is_valid()) {
              return;
            }

            // set all leds to off if minute changed
            if (lastMinute != time.minute) {
              for (int i = 0; i < sizeof(ledDots); i++) {
                ledDots[i] = false;
              }
              for (int i = 0; i < sizeof(ledMatrix); i++) {
                ledMatrix[i] = false;
              }
              lastMinute = time.minute;
            }

            // set the minuteDots correctly (based on current Time)
            minuteDots(time.minute, ledDots);
            wordMatrix(time.hour, time.minute, ledMatrix);

            for (int i = 0; i < sizeof(ledAll); i++) {
              if (i < sizeof(ledDots)) {
                ledAll[i] = ledDots[i];
              } else {
                ledAll[i] = ledMatrix[i-4];
              }
            }

            // update leds
            for (int i = 0; i < sizeof(ledAll); i++) {
              if (i < id(master_start) || i > id(master_end)) {
                if (ledAll[i]) {
                  it[i] = current_color;
                } else {
                  it[i] = Color(0,0,0,0);
                }
              }
            }  

Hi have you solved?
I am doing exactly the same (clock) and facing the same kind of problem.
Trying to set brightness of some pixel at a different value