Lights flickering during changing brightness, then dimmed correctly. PCA9685, I2C

Hello! My setup was unchanged during year, but after last 3-4 updates of ESPHome I got very strange behavior - during switching light on/off or just by dimming light to some specific brightness, during brightness change lights starting to flickering (fast blinking) and after reaching selected brightness - issue is gone and brightness is constant.

The installation is a central dimmer to which several lamps (24V strips in the ceiling) in the apartment are connected. Setup has its own powerful power supply, assembly of output transistors and module PCA9685 for PWM and PCF8574 for switches inputs, both are connected to ESP32 via I2C. There were problems with this module once at the beginning and they were solved by lowering the I2C speed. Now I have already played with different settings and the effect has remained.

I have already checked the free output in the transistor assembly (without load) using an oscilloscope - the PWM signal changes beautifully when light changing the brightness, but at some point there are dips to 0V for a split second, as if the module receives incorrect data (have tried to just disconnect I2C - all setted frequencys are remaining). The power supply and the PWM module are OK - when 1 lamp “blinks”, the rest work as they should. So by now, it looks like some kind of bug after the update, but I have not yet found how to check it and sure - how to fix…

Part of configuration:

esp32:
  board: esp32dev
  framework:
    type: arduino

i2c:
  sda: 21
  scl: 22
  scan: true
  frequency: 100kHz

pca9685:
  - id: pwm_i2c_hub1
    frequency: 160

pcf8574:
  - id: io_i2c_hub1
    address: 0x20
    pcf8575: true

output:
  - platform: gpio
    id: relay_1
    pin:
      pcf8574: io_i2c_hub1
      number: 0
      mode: OUTPUT
      inverted: true
  - platform: pca9685
    pca9685_id: pwm_i2c_hub1
    channel: 0
    id: pwm_1

light:
  # PWM lights
  - platform: monochromatic
    output: pwm_1
    name: "Dimmable light 1"
    id: pwm_light_1
    gamma_correct: 1.5
  # Binary lights
  - platform: binary
    output: relay_1
    id: binary_light_1
    name: "Binary light 1"
1 Like

Downgrade that device with old esphome version to get confirmation.

1 Like

Hi!

Due at some time I unchecked checkbox of creating backups for esphome, I was able to restore esphome to 2025.5.0 from full backups and issue was still present. Then I have found very old esphome backup 2024.11.3 and after restoring - described issue gone.

I will check how I can downgrade to specific version to find out from with version blinking issue started to appear…

1 Like