Ceiling Light: B.K. Licht and Home Assistant - 2025 Upgrade

November 23, 2025 12:47

Huh? What?

…so, this post is a follow-up to the original Ceiling Light: B.K. Licht and Home Assistant blog post from 2023.

So, over the years of use, I noticed a minor issue with the original wiring: Whenever the light is turned off, the transistors controlling the individual color channels are unable to fully turn off the outputs. This leads to a small current flowing through the LEDs, which in turn causes them to glow faintly red, even when turned off.

Upgrade Plan - 2025 Edition

I have sworn to myself to not touch this project until I move to a new apartment, as the light was mounted perfectly against the ceiling - making any change a hassle (especially as wall power is involved)…

But, with time comes change and my precondition was being fulfilled near the end of year 2025. Additionally, I recently stumbled across an interesting-looking 2-Channel 220V ESP32 Relay Board on AliExpress:

relay-pcb

This board not only merged the previously dedicated power-supply onto the ESP-module (while exposing the dangerous live connections - yay), but also has two relays, one of which I could utilize to physically cut the power to the light, when turned off.

As always, the board arrived much later than originally planned and was, of course, missing any kind of documentation. Especially due to its direct connection to wall power, I was not eager to probe it while powered. Luckily, some random comment on the product page mentioned the GPIO mapping:

relay-pcb-comment

Execution!

Starting off, here is the documentation of the project state after two years of use. You can see it got a bit dusty, but is holding surprisingly well together, considering the amount of hot glue used on a device that may experience some heat during operation:

discovery-initial discovery-opened-controller discovery-esp-module

…only now I recalled, that the project also included a BME280 sensor and had an additional indicator LED, which I also had to transplant to the new board. Consider the above photos more like a discovery of the existing state.

I then proceeded to a minor test-fit, as I was not even sure if the new board would fit in the existing space. As the following picture shows, while it does fit tightly, I had to invest additional time insulating the whole top case to avoid anything becoming live. Of course, I also connected ground, but still wanted to avoid any accidental shorts and even the slightest possibility of getting a new hairstyle by touching the case:

discovery-placement

Continuing, here is the new wiring on which I (re-)connected the existing components - at least this was the first iteration:

new-incorrect-wiring new-incorrect-wiring

Of course, before putting it all back together, I performed a quick test, which revealed that nothing was actually working. The lights flickered randomly and not even the connection to the BME280 was working properly. The quick testing phase transformed into a whole evening of cursing and debugging - additionally slowed down by my measures to avoid myself becoming a live part of the circuit: Preparing the next test, clearing the workspace, stepping back, powering the device, waiting for it to boot, triggering compilation via ESP-Home, waiting for quite a while, starting the hacked-in self-test sequence… This took ages.

correct-wiring

In the end, I discovered that the board’s labeling is misleading, as the inner text always corresponds to the inner column of pins. Even better, normally the GND-pin is using a square pad to stand out, but on this board they just used the different shape of the pad to indicate the top-left of the ESP32-module and actually connected the 3.3V rail to it. 🤦‍♂️

In the process of debugging, I of course also ripped off one of the controller pins from the original module, so I had to quickly reverse-engineer its short trace to its transistor base and move the channel wiring accordingly. Nothing is nicer than to kneel on a cold stone floor at night, while debugging for hours, only to then hot-fix a destroyed pin from a densely packed PCB:

ripped-pin-fix

Result

Finally, I corrected the initial issues with the new board’s pinout, connected the external components again (environment sensor and indicator LED) and insulated the inner part of the case. Here is the assembly before I enclosed everything with an additional layer of insulation tape and - of course - a huge amount of hot glue to keep everything in place:

final-assembly

Here is also a snippet of the new configuration for ESPHome, in case you may want to also use this board:

sensor:
  - platform: bme280_i2c
    iir_filter: 16x
    temperature:
      name: "Temperature"
      id: bme280_temperature
      oversampling: 16x
    pressure:
      name: "Pressure"
      id: bme280_pressure
    humidity:
      name: "Humidity (relative)"
      id: bme280_humidity
    address: 0x76 # Somehow this sensor is not the typical 0x77

i2c:
  sda: GPIO15
  scl: GPIO2
    
output: # using advanced pin configuration for explicit pulldown configuration
  - platform: ledc
    pin:
      number: GPIO27
      mode:
        output: true
        pulldown: true
    id: gpio_27
    power_supply: power_controller
  - platform: ledc
    pin:
      number: GPIO33
      mode:
        output: true
        pulldown: true
    id: gpio_33
    power_supply: power_controller
  - platform: ledc
    pin:
      number: GPIO26
      mode:
        output: true
        pulldown: true
    id: gpio_26
    power_supply: power_controller
  - platform: ledc
    pin:
      number: GPIO14
      mode:
        output: true
        pulldown: true
    id: gpio_14
    power_supply: power_controller
  - platform: ledc
    pin:
      number: GPIO13
      mode:
        output: true
        pulldown: true
    id: gpio_13
    power_supply: power_controller

power_supply:
  - id: power_controller
    pin: GPIO16

light:
  - platform: status_led
    name: Status LED Green
    internal: true
    restore_mode: ALWAYS_OFF
    pin:
      number: GPIO32
  - platform: status_led
    name: Status LED Red
    internal: true
    restore_mode: ALWAYS_OFF
    pin:
      number: GPIO23
  - platform: rgbww
    id: leds
    name: "LEDs"
    red: gpio_27
    green: gpio_13
    blue: gpio_14
    cold_white: gpio_33
    warm_white: gpio_26
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K
    restore_mode: RESTORE_DEFAULT_OFF
    # Following settings are required to protect the power supply
    color_interlock: true
    constant_brightness: true

The most relevant change is the addition of the power_supply section, which now starts and (with a delay) stops the power to the original light controller. The result is now even better than the original circuit by the manufacturer, as the light now fully turns off without any faint glow.

I hope I never touch this project again, as I seriously fear what I would need to do in case I rip off another pin (again)…

Have a happy start into year 2026!