How to set min brightness for CWWW platform?

Hi!
I’m converting my Xiomi Philips Zhirui Downlight to use ESPHome. It uses WROOM-02 chip and I 2x PWM channels to control the colors (cold and warm white). The light is working fine, I can set the brightness and color temperature in HA without any problem. The only thing that I need is to setup the minimum brightness. Is that possible?
For instance, in HA entity item, the minium brightness to turn the light ‘on’ should be 45% of the slider. I mean, anything below 45%, the light is off…so 45% on HA slider should be 0% actually.
I have tryied to apply “min_power” to PWM outputs (individually), but this didn’t worked, since it affect the temperature directly. If I set min_power to 0.45 for channel “A”, when I switch the colors, the channel A color stay ‘on’ at minimum level (which shouldn’t). So I guess I can’t use min_power for individual channels.

Any tip?

This is my current working code:

substitutions:
  hostname: 'xiaomilight'
esphome:
  name: $hostname
  platform: ESP8266
  board: esp_wroom_02
  board_flash_mode: dout
  #includes: 
  #  - xiaomi_light.h

web_server:
  port: 80
wifi:
  #domain: '.lan'
  networks:
  - ssid: 'Skynet'
    password: 'XXXXXX'
  manual_ip:
    static_ip: 192.168.22.62
    gateway: 192.168.22.1
    subnet: 255.255.255.0    

logger:
  level: DEBUG
  esp8266_store_log_strings_in_flash: False

api:

ota:

output:
  - platform: esp8266_pwm
    pin: GPIO12
    frequency: 5000 Hz
    id: out_cw
    
  - platform: esp8266_pwm
    pin: GPIO15
    frequency: 5000 Hz
    id: out_b

light:
  - platform: cwww
    name: "Livingroom Lights"
    cold_white: out_cw
    warm_white: out_b
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K
    constant_brightness: true

Solved!
Just changed frequency to lower number (in my case, 300 H) and specially gamma_correct to 1.08

Hi. Can you describe how you flashed this light? I read a lot on the internet but can’t make it work.
I Connected 3,3V and GND
TX>RX
RX>TX
IO0 To GND during startup.
Even tried IO15 to GND.

I try to flash from esphome with UART > USB adapter.

Sorry for digging an old topic, but it was relevant to me, perhaps for someone else. :slight_smile:

It’s not listed anywhere as i searched, but connect the IO0 wire not to the back of the ESP chip like the other ones, but the other side where it connects to the PCB and is also marked IO0.

That way worked like always.

Could someone explain me how did you manage to open the downlight ? I’ve tried but the plastic around start to broke. Help !