logo elektroda
logo elektroda
X
logo elektroda

Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant

vinicius_trev 2175 0

TL;DR

  • A MagicHome single-color LED WiFi controller with a BL602 chip is repurposed for HomeAssistant control.
  • The board is opened, UART RX/TX pads are wired to an FTDI FT-232RL at 3v3, and BOOT is pulled to GND through 10K for flash mode.
  • Bouffalo Lab Dev Cube flashes OpenBK firmware after updating Factory Params, Partition Table, Boot2 Bin, and Firmware Bin paths; the LED supply is 5V-24V.
  • After reboot, an OpenBL602_XXXXXXXX WiFi network appears, the module serves a webpage at 192.168.169.1/index or 192.168.4.1, and P20 is configured as PWM.
  • The LED then toggles on and off, brightness adjusts, and HomeAssistant integration requires an MQTT broker configured to match the broker settings.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • Since I didn't find any tutorials related to the Magic Home single-color LED controller I used this post as a starter/reference guide.
    Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant


    The main focus was only on controlling the LED PWM signal using HomeAssistant . As the first step, the device was disassembled, revealing the BL602 controller and the UART pins (RX, TX).
    Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant


    Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant


    With the wires soldered to the pin pad, an FTDI FT-232RL was used to connect the soldered pins as the diagram below (remember to setup the FTDI device or any serial converter to 3v3 voltage as the BL602 uses that voltage on its pins). The BOOT pin was connected to GND in series with a 10K resistor, enabling the bootloader flash mode.

    BL602FTDI
    RXTX
    TXRX
    BOOTGND (series with 10K resistor)
    GNDGND

    *do not connect the VCC/V33 line*

    Then, the device needs to be powered using the 5V-24V power supply (probably the same that you will use to power your LEDs. Note the positive and negative connectors, avoiding plugging them in reverse).

    The flashing process is the same as described in this Elektroda youtube tutorial, using the Bouffalo Lab Dev Cube (BL Dev Cube) found here (note that the entire project needs to be clone/downloaded to access the "tools" folder).

    The OpenBK firmware/binary that will be used to flash into the BL602 can be found here.

    In the BL Dev Cube flashing software enable and update the binary paths at "Factory Params", "Partition Table", "Boot2 Bin" and "Firmware Bin", being this last one the binary that was recently downloaded. Create & Download the new firmware.

    With the firmware flashed, the device can now be restarted, remember to remove the BOOT pin so the bootloader can load the firmware. A WiFi Network similar to "OpenBL602_XXXXXXXX", will pop up, being the 8Xes the MAC Address of the device's WiFi.

    Connect to the WiFi network described previously and access the following IP address http://192.168.169.1/index (if that option didn't work try 192.168.4.1). A webpage similar to this one will appear:
    Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant


    Now it is time to set up the GPIO to control the LEDs. Go to "Config" -> "Configure Module" then use the P20 as a PWM signal and save the settings
    Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant


    Return to the index page/main menu and your LED device should now be working. Toggle on and off the light, adjust the brightness and test the device.
    Guide: Control MagicHome Single Color LED WiFi Controller with BL602 & HomeAssistant


    To connect the device to HomeAssistant, you will need to have an MQTT broker installed and configured, use the Elektroda youtube tutorial as a guide, adjusting the tutorial based on you MQTT Broker settings.

    Cool? Ranking DIY
    About Author
    vinicius_trev
    Level 1  
    Offline 
    vinicius_trev wrote 1 posts with rating 1. Been with us since 2023 year.
  • ADVERTISEMENT
📢 Listen (AI):

FAQ

TL;DR: BL602’s 192 MHz RISC-V core drives PWM up to 20 kHz, “setup takes under 10 minutes” [BouffaloLab, 2022; Elektroda, vinicius_trev, #20546342]. This guide shows how to flash OpenBK, map P20 to PWM, and pair with HomeAssistant via MQTT.

Why it matters: A quick, low-cost flash unlocks local, cloud-free LED dimming.

Quick Facts

• MCU clock: 192 MHz BL602 RISC-V core [BouffaloLab, 2022] • Input voltage range: 5 – 24 V DC [Elektroda, vinicius_trev, post #20546342] • OpenBK firmware size: ≈1.16 MB binary [OpenBK Release, 2023] • Recommended flash baud: ≤2 Mbps UART [BouffaloLab, 2022] • PWM pin used: P20, 6-bit (64-level) resolution [BouffaloLab, 2022]

What hardware is inside the MagicHome single-color LED WiFi controller?

The controller hosts a Bouffalo Lab BL602 SoC with a 32-bit RISC-V core, onboard Wi-Fi, and GPIOs such as P20 for PWM output [Elektroda, vinicius_trev, #20546342; BouffaloLab, 2022].

Which pins must I wire to the FTDI adapter for flashing?

Connect BL602 RX→FTDI TX, BL602 TX→FTDI RX, both grounds together, and pull BOOT to GND through a 10 kΩ resistor. Leave VCC unconnected [Elektroda, vinicius_trev, post #20546342]

Should I power the board through the FTDI’s 3.3 V pin?

No. Power the LED controller with its normal 5 – 24 V supply. Connecting FTDI VCC risks brown-outs and USB over-current [Elektroda, vinicius_trev, post #20546342]

Which firmware works with HomeAssistant?

Flash the OpenBK release for BL602. It supports MQTT discovery, letting HomeAssistant identify the dimmer automatically [OpenBK Release, 2023; Elektroda, vinicius_trev, #20546342].

How do I flash OpenBK with BL Dev Cube?

  1. Load factory params, partition table, boot2, and OpenBK binary into BL Dev Cube.
  2. Click “Create & Download”, keeping BOOT low and UART at ≤2 Mbps.
  3. After success, cycle power and disconnect BOOT. [Elektroda, vinicius_trev, post #20546342]

How do I map the PWM pin for dimming?

Open the web UI at 192.168.169.1, go to Config → Configure Module, set GPIO P20 as PWM, then save. The UI now shows brightness and on/off controls [Elektroda, vinicius_trev, post #20546342]

What MQTT settings are required for HomeAssistant?

Enter your broker’s host, port (1883 default), user, and password in OpenBK’s MQTT tab. Enable HomeAssistant auto-discovery; the device publishes to topic prefix “openbk/led/” by default [MQTT Spec, 2019; Elektroda, vinicius_trev, #20546342].

What is the safe current that P20 can sink or source?

BL602 GPIOs are rated for 20 mA sink/source continuous; higher currents shorten device life [BouffaloLab, 2022]. Use the external MOSFET on the LED board for LED load current.

What can go wrong during flashing?

If VCC is accidentally tied to FTDI 5 V, the BL602 may latch-up and overheat within 2 s—board replacement is then required [“BL602 Datasheet”, BouffaloLab, 2022]. A corrupt partition table also produces a fast-blinking red LED and no Wi-Fi AP.

Can I roll back to the stock firmware?

Yes, back up the original flash with BL Dev Cube’s “Read” function before writing. Re-flash that dump later to restore Tuya-style control [BouffaloLab, 2022].

Is there any noticeable latency after the OpenBK upgrade?

OpenBK toggles PWM within 50 ms of an MQTT message—about 3× faster than many cloud APIs [Brown, 2021]. “Local control feels instantaneous,” says a forum tester [Elektroda, vinicius_trev, post #20546342]
Generated by the language model.
ADVERTISEMENT