Last week, I purchased the LSC Smart Ledstrip RGBIC+CCTIC (3203632.1) from Action.
This LED strip features addressable RGB and addressable CCT LEDs. The strip can be controlled with the Tuya Smart Life app, which allows for effects, colors per segment, etc. However, in Home Assistant, the strip is discovered as a single device, with no options for segments or individual LED control. I want to avoid relying on the cloud and Tuya; instead, I’d like to control this strip using WLED or ESPHome. I started researching the possibilities.
Specs RGBIC + CCTIC controller
The device is based on a BK7231N chip. It has 25 segments of approximately 20 cm, making the total length 5 meters. The controller is powered by a 24V 1A power supply. Each 20 cm segment contains 6 RGB, 6 CW, and 6 WW LEDs. In the software, each segment (20 cm, 6 LEDs) is treated as a single LED. Each segment has two control chips, specifically GZX16703. On the controller’s PCB, the type is labeled as PCB_475P1-v1.0. The PCB also has pins labeled C and W, but these do not connect to the LED strip.
Cloudcutter
I have substantial experience with Tuya Cloudcutter and even wrote a step-by-step guide on my blog. Unfortunately, this device cannot be flashed with Cloudcutter because the firmware is patched by Tuya. The chip is a BK7231N running Tuya firmware version 1.0.2.
Flashen via UART
Through a topic on Elektroda, I found that someone had successfully flashed OpenBeken onto the device. This has to be done via UART due to the patched Tuya firmware.
I connected my UART USB to the following pins:
USB UART | Beken 7231N |
---|---|
3.3V | 3.3V |
TX | 1RX |
RX | 1TX |
GND | GNG |
Using the BK7231 GUI Flash Tool, I connected to the BK7231N. To be safe, I made a backup of the Tuya firmware in case I want to revert.
After flashing the OpenBeken software, I performed an OTA update to ESPHome.
Flashing to ESPHome
I first created a new device in ESPHome Compiler based on the generic-bk7231n-qfn32-tuya
board. I downloaded the ESPHome firmware as a Beken OTA file and renamed it to “OpenBK7231N_esphome.rbl” to avoid an invalid firmware error.
The flashing was successful, and the new device was discovered by Home Assistant.
Adjusting ESPHome YAML
Finding the correct configuration was trial and error. Initially, the LED strip didn’t turn on at all. During my research, I remembered a pin needed to be activated to provide 24V to the strip. After scrolling through the Elektroda topic, I found that P8 was responsible for this.
After adding the GPIO switch to the ESPHome YAML, the LED strip turned on. YAY!
switch:
- platform: gpio
pin: P8
id: onoff
name: Aanuit
Adjusting Colors
This turned out to be tricky. Setting is_wrgb
or is_rgbw
to true
caused the strip to display random colors instead of the selected ones in Home Assistant’s color picker. These features worked in the original Tuya app, so I investigated further.
Through trial and error, I discovered that Tuya designed the strip so that CW and WW LEDs are addressed on odd numbers, while RGB LEDs are addressed on even led numbers. In the YAML configuration, you must omit is_wrgb
or is_rgbw
and let Home Assistant treat it as an RGB strip. While functional, this is not an elegant solution, so I’d like to modify parts of the code.
- platform: beken_spi_led_strip
rgb_order: BRG
id: RGBIC_CCTIC_ledstrip
pin: P16
num_leds: 25
chipset: SM16703
name: "Ledstrip"
on_turn_on:
- switch.turn_on: onoff
on_turn_off:
- switch.turn_off: onoff
Now I Need Help!
Using light partitions, I can test the correct colors and white values for separate segments. RGB LEDs work as expected, but for white values, you must select Red for Cool White and Green for Warm White in the color picker.
- platform: partition
name: "LED 0"
segments:
# This is the first module RGB leds
- id: RGBIC_CCTIC_ledstrip
from: 0
to: 0
- platform: partition
name: "LED 1"
segments:
# This is the first module CW/WW leds.
# Controls in HA are: Red = Cool White, Green = Warm White
- id: RGBIC_CCTIC_ledstrip
from: 1
to: 1
- platform: partition
name: "LED 2"
segments:
# This is the second module RGB leds
- id: RGBIC_CCTIC_ledstrip
from: 2
to: 2
- platform: partition
name: "LED 3"
segments:
# This is the second module CW/WW leds
- id: RGBIC_CCTIC_ledstrip
from: 3
to: 3
TL;DR:
Desired changes/additions to the beken_spi_led_strip
component:
- Support for separate CW/WW IC chips so CW/WW LEDs don’t need to be controlled with red and green.
Desired changes/additions to the light.partition
component:
- Support for arrays of LED numbers, allowing you to create segments like 0, 2, 4, 6, 8, etc., and 1, 3, 5, 7, 9, etc., to set colors or white values properly across multiple segments.
Who can help me with this, or where can I submit an issue/feature request?
Posted a ESPHome feature request:
Support for RGBIC + CCTIC ledstrips like LCS 3203632.1 · Issue #2991 · esphome/feature-requests
Complete Work In Progress code ESPHome
esphome:
name: lsc-rgbic-cctic-ledstrip
friendly_name: test-beken
bk72xx:
board: generic-bk7231n-qfn32-tuya
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "c1HWBG3tbftOhAwajKUroWEcveMUFx6MQQHqDDDUNFs="
ota:
- platform: esphome
password: "6cd21eea0c30fa70b86209a14db920da"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
captive_portal:
web_server:
light:
- platform: beken_spi_led_strip
rgb_order: BRG
id: RGBIC_CCTIC_ledstrip
pin: P16
num_leds: 25
chipset: SM16703
name: "Ledstrip"
on_turn_on:
- switch.turn_on: onoff
on_turn_off:
- switch.turn_off: onoff
- platform: partition
name: "LED 0"
segments:
# This is the first module RGB leds
- id: RGBIC_CCTIC_ledstrip
from: 0
to: 0
- platform: partition
name: "LED 1"
segments:
# This is the first module CW/WW leds. Controls in HA are: Red = Cool White, Green = Warm White
- id: RGBIC_CCTIC_ledstrip
from: 1
to: 1
- platform: partition
name: "LED 2"
segments:
# This is the second module RGB leds
- id: RGBIC_CCTIC_ledstrip
from: 2
to: 2
- platform: partition
name: "LED 3"
segments:
# This is the second module CW/WW leds
- id: RGBIC_CCTIC_ledstrip
from: 3
to: 3
switch:
- platform: gpio
pin: P8
id: onoff
name: Aanuit