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
  • #91 20736143
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Hi @DeDaMrAz, did you have a chance to make more progress with this device?
  • ADVERTISEMENT
  • #92 20753223
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Hi @DeDaMrAz and @p.kaczmarek2 - any more progress with this device?
    If you could get the warm/cool white going, that will be great. Let me know if you want me to do more testing or anything.
  • #93 20755739
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Don't feel the love anymore :( Hopefully was not something I said or done :)
  • #94 20755752
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125
    @MnM1

    Life and job in the way mainly. Have faith and patience we will get to it soon, there is a lot to do in the background as the TuyaMCU driver has to be rewritten.
  • #95 20755795
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Thanks for the update!! :)
  • #96 20766031
    DeDaMrAz
    Level 22  
    Posts: 596
    Help: 34
    Rate: 125

    @mnm11

    Small update, there is a new flag created (flag 43 - [TuyaMCU] Use queue) in settings, can you use the build from the link below and confirm that you can change colors every time??

    https://github.com/openshwprojects/OpenBK7231T_App/suites/17084255605/artifacts/975871212

    So go to Config/Configure General/Flags and activate flag 43, then submit - and test if the colors from the color wheel are changing every time.

    Thanks.

    P.S. Extract just OpenBK7231N_938_merge_1ca2873690e8.rbl file and use it as OTA file.
  • ADVERTISEMENT
  • #97 20766269
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Hi @DeDaMrAz,

    Thanks for the update.
    I looked for the file you mentioned (OpenBK7231N_938_merge_1ca2873690e8.rbl) but it is not there:

    Screenshot showing a list of files in a folder with various extensions and sizes.
  • ADVERTISEMENT
  • #98 20766300
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    I think OpenBK7231N_test-tuyamcu_916178bf0304.rbl should be correct
    Helpful post? Buy me a coffee.
  • #99 20766304
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    OK I will use that file
  • #100 20766369
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    This build should fix the following issue:
    DeDaMrAz wrote:

    @mnm11

    We need a bigger sample of tests, can you update your device to build 1.17.237 and add it to HA to test if color change will work for you? The issue that I am facing is that I can change color only a certain number of times (let's say 7 or 8 times) and then the device will become unresponsive to color change until I power cycle the light by on/off switch. Can you test that maybe?


    Keep in mind that no other changes are in place. Of course, you need to enable TuyaMCU queue flag first.
    Helpful post? Buy me a coffee.
  • #101 20766386
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Did a quick test from the device page and from HA. They both worked OK - colors changed every time. Dimming the colors works too.

    As mentioned before, my colors are not RGB but they are BGR (as in red and blue are swapped).
    Because of this, I have seen different colors than what was on the color wheel - especially as I moved further away from the edges (in HA). But I think that's expected if red and blue are swapped.

    The warm white and cold white temperature slider still does not work. If used, it just switches all the LEDs off. I get them back by selecting a color on the color wheel.

    Is there any way I can make my colors RGB (in software) instead of BGR?
  • #102 20777196
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    MnM1 wrote:

    Is there any way I can make my colors RGB (in software) instead of BGR?

    Isn't it configurable on remote? I can consider adding that option to OBK but I am not sure if it would be practical
    Helpful post? Buy me a coffee.
  • #103 20777414
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Yes, I have since pulled out the manual and gone through some settings and managed to get the colors correct.
  • #104 20777534
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    MnM1 wrote:

    The warm white and cold white temperature slider still does not work. If used, it just switches all the LEDs off. I get them back by selecting a color on the color wheel.

    Was warm/cold slider present in original Tuya app? We have went through the topic with @DeDaMrAz and now we are not sure...
    Helpful post? Buy me a coffee.
  • #105 20777571
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    I just checked on the device that I have on Tuya - no it does not have warm/cold white slider at all. Only the color picker:

    >>20713970

    Added after 8 [minutes]:

    Trying to "decode" the "English" manual..it seems to indicate that white colors are made by mixing the RGB colors? What do you think - is that what they are trying to say?

    "Color ring: In color mode, press or slide the color ring to
    switch colors, and switch color temperature in white mode;
    Lighting mode:
    1, short button function: press the button to enter the
    lighting mode, and each short press will switch between cold
    light, warm light and neutral light; Non-independent heating
    and cooling lamp products, only energy mixed color RGB white
    light;"
  • #106 20817459
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Hi @DeDaMrAz and @p.kaczmarek2 - any more progress with this device?
  • #107 20817640
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Hello @mnm11 , we may be wrong, but we looked into that about a week ago and concluded that CW mode is not present on original Tuya firmware, so most of the work is done already. Are we incorrect? What else is there to support?

    I think I've already posted a guide for this device, but it's not yet translated:
    https://www.elektroda.pl/rtvforum/topic4014389.html
    Helpful post? Buy me a coffee.
  • #108 20817946
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    @p.kaczmarek2 - great write up!! I used Google Translate.

    "...and can be controlled from Home Assistant, although at the moment the animation trigger must be written manually in YAML by sending the appropriate command to MQTT."

    I think I will need some help with this part.
    Will it be possible for you to do one animation (as an example) as I have no idea how to do it? I can then replicate it for the rest of the animations.

    I am starting up my device now and upgrading to the latest firmware. latest autoexec from your article and will give it a good test.

    "...This means that we will soon be running the WS2812B driver on the BK, most likely based on SPI, but more about that another time" - also looking forward to this one too :)

    Added after 8 [minutes]:

    Edit: one thing that I think might be beneficial to add to the Polish article is a complete autoexec. It has the contents throughout the article but not in one single place.
  • #109 20818136
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    It's good idea, I will add it.

    Regarding buttons - do you know how to add them in HA? Via dashboard editor?
    Button card configuration in Home Assistant with settings options.
    You can set a service action for them with MQTT publish:
    Screenshot of Home Assistant dashboard editor with MQTT service action settings.
    I may create a tutorial for that later.
    Helpful post? Buy me a coffee.
  • #110 20818148
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Thanks - I will try in HA and see how I go.

    Added after 11 [hours] 54 [minutes]:

    I have some feedback with the temperature sensor for this device.

    I have enabled it in autoexec and rebooted:

    startDriver MCP9808 7 8 1
    MCP9808_Adr 0x30
    MCP9808_Cycle 1

    After the reboot I see a strange value instead of the expected temp:

    MCP9808 Temperature=-0.062500

    Screenshot showing MCP9808 sensor temperature reading as -0.062500.

    Let me know if you want any logs or testing form me
  • ADVERTISEMENT
  • #111 20820173
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    MnM1 wrote:
    Thanks - I will try in HA and see how I go.

    I have published polish tutorial for HA buttons, but screenshots are in english. English version will be published shortly:
    https://www.elektroda.pl/rtvforum/topic4015423.html


    MnM1 wrote:

    I have some feedback with the temperature sensor for this device.

    (...)

    MCP9808 Temperature=-0.062500

    Excuse me, does that mean that you actually bought the same temperature sensor we had with @DeDaMrAz and soldered it to the device? You know, the device in question does not have any temperature sensors in the factory state. We have just added MCP9808 ourselves, as a demonstration of possible modification that users can do to add more functionality to this device.
    Helpful post? Buy me a coffee.
  • #112 20820528
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Ahhh I see - I might have missed that through Google Translate. I thought it was built-in. Now that explains why I am getting this wrong value.

    Cheers.
  • #113 20825641
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    >>20820173

    Apologies - I just noticed your post about the tutorial.
    Thank you for it. I am reading it now.
  • #114 20835539
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    @DeDaMrAz and @p.kaczmarek2 - guys, I have tested the device.

    I am very happy with the way it turned out. It has all the features found in the Tuya app. It performs really well.
    Next, I will "free from cloud" the devices that I have and install them at the front of the house.

    Thank you very much for working on it and putting up with my limited experience and questions.

    Great job!!!

    Edit: a donation was made via PayPal. Hope it helps :)
  • #115 21083379
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Hi @p.kaczmarek2 and @DeDaMrAz

    Hope you guys are doing well.

    I am resurrecting this thread as after using the lights for a while I have identified a fault which I am hoping you guys can fix.

    Basically this s what is happening (all through OBK GUI not HA):

    1. Turn on the lights from switch (so, no toggle - the switch when on provides current to the light)

    2. Select Curtain Mode for example (it works, the same for any other modes)

    3. Select Light Mode (so the device goes back to the white light that it has as the default when it is turned on) - this is where it breaks. It does not go back to the white lights at all. The device is on but no lights are displayed anymore. The only way to get the white lights back is to go to the LED RGB Color and select the white light (R=255, G=255, B=255). Only then the light turns on. If I reboot the device without doing the R=255, G=255, B=255 step white light is not displayed at all anymore until I do that step.

    4. After the above steps, and the white light is back, any mode can be used and can switch between white light and modes with out any issues until the power to the device is turned off. Then it starts again with the issue described in 1, 2 and 3 above.

    This is the autoexec I have:

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    
    tuyaMCU_setupLED 24 1
    
    startDriver httpButtons
    
    setButtonEnabled 0 1
    setButtonLabel 0 "Light Mode"
    setButtonCommand 0 "startScript autoexec.bat do_whitelight"
    alias do_whitelight startScript autoexec.bat do_whitelight
    
    setButtonEnabled 1 1
    setButtonLabel 1 "Music Mode"
    setButtonCommand 1 "startScript autoexec.bat do_music"
    alias do_music startScript autoexec.bat do_music
    
    setButtonEnabled 2 1
    setButtonLabel 2 "Curtain"
    setButtonCommand 2 "startScript autoexec.bat do_cur"
    alias do_cur startScript autoexec.bat do_cur
     
    setButtonEnabled 3 1
    setButtonLabel 3 "Collision"
    setButtonCommand 3 "startScript autoexec.bat do_col"
    alias do_col startScript autoexec.bat do_col
     
    setButtonEnabled 4 1
    setButtonLabel 4 "Rainbow"
    setButtonCommand 4 "startScript autoexec.bat do_rai"
    alias do_rai startScript autoexec.bat do_rai
     
    setButtonEnabled 5 1
    setButtonLabel 5 "Pile"
    setButtonCommand 5 "startScript autoexec.bat do_pil"
    alias do_pil startScript autoexec.bat do_pil
     
    setButtonEnabled 6 1
    setButtonLabel 6 "Firework"
    setButtonCommand 6 "startScript autoexec.bat do_fir"
    alias do_fir startScript autoexec.bat do_fir
     
    setButtonEnabled 7 1
    setButtonLabel 7 "Chase"
    setButtonCommand 7 "startScript autoexec.bat do_chase"
    alias do_chase startScript autoexec.bat do_chase
     
     
    // stop execution
    return
    
    do_whitelight:
    tuyaMcu_sendState 21 4 1
    delay_s 0.1
    return
    
    do_music:
    tuyaMcu_sendState 21 4 3
    delay_s 0.1
    return
     
    do_chase:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 020e0d00001403e803e800000000
    return
     
    do_cur:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 000e0d00002e03e802cc00000000
    return
     
    do_col:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 07464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000
    return
     
    do_rai:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 06464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000
    return
     
    do_pil:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 010e0d000084000003e800000000
    return
     
    do_fir:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 05464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000464601003d03e803e80000000046460100ae03e803e800000000464601011303e803e800000000
    return


    Hope it can be fixed.

    Thanks.

    Added after 8 [hours] 59 [minutes]:

    I guess the fix is to add a line to the do_whitelight section that will send the command as if it was picked from the LED RGB Color section (R=255, G=255, B=255) before the rest of the script runs.
    I noticed that when I pick the white color from the color picker in LED RGB Color in the GUI at the top I see this - Send #ffffff command.

    Screenshot of the TestFrontLight app with various LED light settings options.

    Not sure how to add that to the do_whitelight section (or even if possible)

    do_whitelight:
    tuyaMcu_sendState 21 4 1
    delay_s 0.1
    return
  • #117 21084278
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    The delays may be much shorter (or maybe none, who knows) if you enable TuyaMCU queue
    Helpful post? Buy me a coffee.
  • #118 21085291
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    I have given it a test on my test device and it seems that it works well.
    I have Flag 43 enabled - I have made the timings 0.1 for both and I can see that it still works pretty well. The delays are insignificant this way.

    I will change the config on the actual lights I have installed at the house and see.

    @DeDaMrAz - can you please let me know what the 3 tuyaMCU_sendColor lines do? Wanting to learn more :)

    Thanks both for your quick assitanrce.
  • #119 21085519
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Helpful post? Buy me a coffee.
  • #120 21100770
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Hi @p.kaczmarek2 and @DeDaMrAz ,

    I have another issue with the lights.

    When I toggle the lights from HomeAssistant they turn ON for 1 second and then the light goes off immediately.
    If I toggle the light ON from the OBK web interface it work as it should (light stays on and doesn't turn off unless toggled to turn OFF).

    I think this is something recent as I did not see this kind of behavior before - running HA 2024.5.5
    I hope you might have some solution for this issue.

    Many thanks.

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