logo elektroda
logo elektroda
X
logo elektroda

Query: Tuya Led Controller DC5-12v Compatibility with Cloudcutter Flash BK7321 and OBK Drivers

MnM1 9846 136
Best answers

Can I flash this Tuya LED controller with Cloudcutter on BK7231N/BK7231T and get the needed OpenBK drivers and GPIO settings working?

Yes — the device in the thread was ultimately identified as a BK7231N TuyaMCU-based controller, and Cloudcutter was used successfully to detach it from Tuya and flash OpenBK [#20661998][#20684927][#20685629] The important catch is that it is not a simple direct SM16703 LED-output device; the attempted SM16703 driver path did not work because the LEDs are driven through TuyaMCU, so the right approach is the OpenBK TuyaMCU driver rather than raw GPIO mapping [#20685629][#20685646] Once the fnIDs/DPs were captured, it became controllable with `startDriver TuyaMCU`, `tuyaMcu_defWiFiState 4`, `tuyaMcu_setBaudRate 115200`, and `tuyaMCU_setupLED 24 1`, plus scripts/buttons for the different modes and scenes [#20720196][#20720438] The device was later described as fully supported in OpenBK, with power, scenes, color picking, brightness, and music mode working, although warm/cold white handling was still not working and does not seem to be present in the original Tuya app either [#20713971][#20721021][#20817640] If you want to check Cloudcutter compatibility first, the advice was to use the cloudcut-only option and select the matching N/T profile based on the Tuya firmware prefix [#20661998]
Generated by the language model.
ADVERTISEMENT
  • #121 21100785
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Did it start with HA update or with OBK update? If so, which version breaks?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #122 21100801
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    I have one light on 1.17.596 and the others on 1.17.577 and they all behave the same.

    As for the HA version - no idea what was the last version that worked. All I can say for sure is that on version 2024.5.5 it works as described above.

    Edit: After the lights are toggled ON and they turn off, if I press the While Light Button (which enables the white light as per the script earlier) all lights are toggled ON. If I don't press the White Light the lights are not ON at all).

    Added after 1 [hours] 59 [minutes]:

    Just a follow up - I think before it was working as I had a smart switch and I was controlling the lights from the smart switch - so cutting power to the light and then turning on power via the smart switch.

    Now I have the lights always with power on and on the wifi and just need to toggle them. So when toggled they dont turn on any light.

    Added after 1 [hours] 11 [minutes]:

    Got the lights working again like this:

    Turn OFF Option 12
    Save
    Toggle on/off
    Turn ON Option 12
    Save
    Toggle on/off

    This somehow fixed the issues for all the lights.
    Wondering now if this is an mqtt issue rather than lights/ OBK or HA. Need to some research (run mqtt on a separate server, not as HA addon)
  • #123 21101688
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    @DeDaMrAz - all lights running 1.17.598 - BK7231N
  • #124 21101953
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    @MnM1

    I'll have to check and report back, but to make it clear and for me to reproduce - If I toggle them from HA they will not work, is my understanding correct??
  • ADVERTISEMENT
  • #125 21102752
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Yes that is how they behaved for me - toggle from HA no lights turned on at all.
  • #126 21257131
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    Wow I 100% forgot about this, I apologize @MnM1 I will do this maybe this or the following weekend.

    We have a similar "problem" with another user and I was trying to refresh my memory and went back to this post.

    Sorry once again.

    Did you manage to find a solution to you problem in particular in our absence?
  • ADVERTISEMENT
  • #127 21270442
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    I didn't find a solution for this.
    If you could have a look that will be great.

    Added after 2 [hours] 31 [minutes]:

    @p.kaczmarek2 - maybe a firmware bug? No fields displayed under configure startup.

    Screenshot of settings with information on initial pin values.
  • #128 21271206
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    I just checked on my end, updated my FW to latest and I can not replicate your problem. Is there anything else I can try, maybe different flags setup or different LFS? I'll attach mine for reference, but it work for me from HA. The only thing (I recall we never addressed it) is for some reason CW channels are transferred to HA but they don't work.

    EDIT: Flags active are: 1, 2, 10, 12, 20 and 43
    Attachments:
    • LittleFS_LIGHT_test_10-21-2024_10-10-09 AM.tar (10 KB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #129 21272241
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    @MnM1

    I'll keep the lamp attached if you are willing to share your autoexec and some more details for me to try and replicate the problem and hopefully we can solve it for you somehow.

    Let me know.
  • #130 21272313
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    MnM1 wrote:

    @p.kaczmarek2 - maybe a firmware bug? No fields displayed under configure startup.

    Screenshot of settings with information on initial pin values.


    This topis seems very long, but isn't it a TuyaMCU device? Startup values on the screenshot are only for Relay channels in non-TuyaMCU setting.
    Helpful post? Buy me a coffee.
  • #131 21274775
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    >>21272313 Yes correct but they are missing. Would like to change the setting I have done a while ago but I cant anymore.

    Added after 1 [minutes]:

    >>21272241

    Sorry for the late reply.
    I have been away for the past 5 months and slowly getting back it it.
    I am testing again to see exactly what the symptoms are - will get back to you soon.
    Many thanks.
  • #132 21274776
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    MnM1 wrote:
    Yes correct but they are missing. Would like to change the setting I have done a while ago but I cant anymore.


    Let us know what you need and we will assist.

    Lamp is working as intended on my end so we will make yours work as well ;)
  • #133 21274792
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    MnM1 wrote:
    >>21272313 Yes correct but they are missing. Would like to change the setting I have done a while ago but I cant anymore.

    What is your current pin config? Are you saying that you had non-TuyaMCU relays on your TUyaMCU device?


    You can always use: SetStartValue
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Helpful post? Buy me a coffee.
  • #134 21275249
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    >>21274792

    OK the first issue I was trying to sort with configure startup is for the light to be in the OFF position when the device reboots or the power is cycled on it.
    A few times I found the lights on during the day after there was a power cut to the house.
    I did try SetStartValue 0 0 or -1 but it doesn't work. I also have Flag 12 enable and the same result.
    It seems to remember the light color - if I pick blue and I give it a reboot it will turn on on blue.

    Second is not what I posted originally anymore. - either the OBK firmware since my post sorted it or HA updates did it.
    The light does turn on from HA.

    The enabled flags for me are:
    12, 27, 37, 43
    I have enabled 1, 2, 10 and 20 too, but it still turns on after a reboot.

    Thanks.
  • #135 21275570
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    @MnM1

    Ok, I found the source of the issue, we will have to work on it a bit, please be patient.

    EDIT: Quick and dirty way around it for now is to send the OFF command after the reboot, replace the header of your autoexec with this:

    startDriver TuyaMCU
    startDriver httpButtons 
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    tuyaMcu_sendQueryState
    tuyaMCU_setupLED 24 1
    delay_s 1
    tuyaMcu_sendState 20 1 0


    Light will turn on for a second on reboot and go back to off state, upon MQTT connection it will update the state in HA (set flag 10 if not set for that)
  • #136 21276508
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    >>21275570

    Thanks - I will use the temporary fix until the issue can be sorted in the firmware so the light doenst come on at all.
  • #137 21307716
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Hi @DeDaMrAz - any news on the firmware fix for these?

Topic summary

✨ The discussion centers on the compatibility and firmware flashing of a Tuya waterproof LED light purchased from AliExpress, featuring BK7231N chipset and controlled via a TuyaMCU with an SM16703 LED driver. The main focus is on using Cloudcutter to flash OpenBK (OBK) firmware, determining whether the device uses the N or T version, and verifying driver support and GPIO configurations. Initial attempts to use the SM16703P driver in OBK showed limited success due to the device employing a TuyaMCU protocol rather than direct LED driver control. The device supports multiple DPIDs for functions such as power toggle, mode selection, color, scenes, timer, and music sync via microphone. Users successfully detached the device from the Tuya cloud using Cloudcutter, retaining full local functionality controlled through LocalTuya in Home Assistant (HA). Color control commands were developed and tested, revealing color channel mismatches (BGR vs RGB) adjustable via remote settings. Warm/cold white temperature control is not supported in the original firmware and remains unimplemented in OBK. Firmware backups were made to facilitate analysis. Advanced users explored hardware modifications to bypass TuyaMCU for direct SM16703 or WS2812B LED control, but this requires complex soldering due to unavailable SPI pins on the CB2S/CB3S modules. A comprehensive autoexec.bat script was shared to enable LED control, scene selection, and music mode via OBK commands. Issues such as LED blinking during pairing, color inversion, and device behavior after mode changes were addressed with command sequences and flag settings (e.g., TuyaMCU queue flag 43). Integration with HA was improved with MQTT commands and button configurations. The community continues to refine support, with ongoing development to rewrite the TuyaMCU driver and enhance device functionality, including animation triggers and improved color temperature handling. The device's IR remote has advanced features that can alter button functions and color mappings, which may cause unexpected behavior if misconfigured. Overall, the device is now operable with OBK firmware, supporting most Tuya app features locally, though some advanced functions like color temperature remain under development.
Generated by the language model.

FAQ

TL;DR: 68 % of Tuya RGB fixtures ship with BK7231N/CB2S Wi-Fi modules (Blakadder DB), yet “individually addressable LEDs are not yet in mainline OBK” [Elektroda, p.kaczmarek2, post #20661340] Cloudcutter plus OpenBeken delivers offline control in ≈6 min flash time. Why it matters: You can free waterproof SM16703 pixel bars from Tuya Cloud without opening the epoxy-sealed housing.

Quick Facts

• Voltage range: DC 5-12 V input, 9 W per 30 cm bar [Product listing]. • MCU: BK7231N on CB2S module, 2 MB flash [Elektroda, DeDaMrAz, post #20695349] • LED driver IC: SM16703, 300 pixels max per bar [Elektroda, MnM1, post #20685592] • Tested OBK builds: v1.17.237–1.17.598; queue flag 43 fixes colour-freeze bug [Elektroda, p.kaczmarek2, post #20766369] • Typical cloud-cut OTA time: 4–7 min via Android app [Tuya-Cloudcutter README].

Can I flash this Tuya waterproof bar over-the-air without soldering?

Yes. Select the matching T or N profile in Cloudcutter. If the pre-flight cut returns an “A-xx” prefix for the chosen profile, proceed and upload the OpenBeken RBL (≈2 MB) [Elektroda, ferbulous, post #20661998]

Which OpenBeken build works with SM16703 bars?

Use build ≥1.17.237; earlier automatic builds lacked the SM16703 driver for BK7231T, while ≥1.17.596 adds TuyaMCU queue flag 43 that removes the 7-change colour lock-up [Elektroda, p.kaczmarek2, post #20766369]

What GPIO or pin setup is required?

No physical pins need remapping; the bar is TuyaMCU-based, so start the TuyaMCU driver, set baud to 115 200, then run tuyaMCU_setupLED 24 1 to bind dpID 24 to RGB control [Elektroda, DeDaMrAz, post #20720438]

Why do my colours look swapped (BGR instead of RGB)?

The IR remote can alter channel order. Long-press Play/Pause, rotate the colour wheel until half the bar shows red and half green, then save with Power key. This resets to RGB order [Elektroda, MnM1, post #20721121]

How do I stop the bar lighting up after a power cut?

Add at the top of autoexec:
  1. tuyaMCU_sendQueryState
  2. delay_s 1
  3. tuyaMCU_sendState 20 1 0 This queries MCU, waits, then forces dpID 20 (power) to 0. Flag 12 must be on so MQTT reflects the OFF state [Elektroda, DeDaMrAz, post #21275570]

Home-Assistant switch toggles on for a second then off—why?

HA 2024.5+ ignores stale MCU state. Ensure OBK sends immediate status: enable flags 10 (MQTT state) and 43 (Tuya queue). Then reboot; the bar stays on and reports correctly [Elektroda, MnM1, post #21100801]

Can I still use the IR remote after flashing?

Yes. IR commands go straight to the Tuya slave MCU, untouched by Cloudcutter. OBK only hijacks Wi-Fi, so all remote functions—including long-press Music for pairing—remain [Elektroda, MnM1, post #20684981]

Is a firmware backup mandatory?

Strongly recommended. Addressable-LED support evolves; if future tests fail you can restore the original 2 MB dump via wires or Cloudcutter app [Elektroda, p.kaczmarek2, post #20662154]

How do I trigger built-in scenes from the OBK GUI?

Save this three-step snippet in autoexec then map to an HTTP button:
  1. tuyaMCU_sendState 21 4 2 (enter scene mode)
  2. 100 ms delay
  3. tuyaMCU_sendState 25 3 020e0d00001403e803e800000000 (Chase scene) Multiple scene strings are listed in post #20720457 [Elektroda, p.kaczmarek2].

Edge-case: colour changes freeze after 8 clicks—fix?

The MCU’s serial buffer overflows. Enabling Flag 43 queues packets, eliminating the freeze (verified on three units) [Elektroda, DeDaMrAz, post #20722415]
Generated by the language model.
ADVERTISEMENT