logo elektroda
logo elektroda
X
logo elektroda

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

MnM1 10503 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: 14615
    Help: 655
    Rate: 12632
    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: 603
    Help: 34
    Rate: 129
    @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: 603
    Help: 34
    Rate: 129
    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?
  • #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: 603
    Help: 34
    Rate: 129
    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.
  • #129 21272241
    DeDaMrAz
    Level 22  
    Posts: 603
    Help: 34
    Rate: 129
    @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.
  • ADVERTISEMENT
  • #130 21272313
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14615
    Help: 655
    Rate: 12632
    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.
  • ADVERTISEMENT
  • #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: 603
    Help: 34
    Rate: 129
    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: 14615
    Help: 655
    Rate: 12632
    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: 603
    Help: 34
    Rate: 129
    @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: For owners of sealed DC 5–12 V Tuya dreamlight controllers, the safest path is: verify Cloudcutter first, then treat the device as TuyaMCU-based, not direct SM16703. As one developer put it, "The SM driver will not work for this device"; working control came from dpIDs, scene scripts, and Flag 43 queue support. [#20685629]

Why it matters: This thread shows how to free a waterproof Tuya light from the cloud without opening it, while avoiding the biggest failure mode: flashing a device that still lacks the right driver path.

Option What the thread found Practical result
BK7231N + TuyaMCU path Working support arrived first; test device reported BK7231N and later got scenes, color, brightness, and music mode working Best current route for this light
BK7231T + direct SM16703 tests Early SM16703 builds for T were missing or not ported; 202 T even returned 404 for one file Not the safe first choice
Direct SM16703 control Promised more customization, but this device turned out to use TuyaMCU in front of the LEDs Not the right control path for this product
Tuya app / LocalTuya only Full original behavior stays after cloud detachment, but you still rely on TuyaMCU datapoints Useful for testing before flashing

Key insight: The breakthrough was identifying the controller as a TuyaMCU light with dpIDs and 115200 baud, not a simple BK-to-LED direct driver design. Once the project switched from SM16703 experiments to TuyaMCU scripting, core functions started working. [#20685629]

Quick Facts

  • The Tuya IoT dump exposed 11 functional dpIDs on this device, including 20, 21, 24, 25, 26, 27, 28, 42, 51, 52, and 53, which made reverse-mapping possible in OpenBeken. [#20685592]
  • The pixel-count datapoint reported dpID 53 = 300, giving a concrete strip-length parameter for scene logic and timing tests. [#20685592]
  • The working TuyaMCU setup used 115200 baud and required tuyaMcu_defWiFiState 4 to stop the power-up blinking that looked like pairing mode. [#20720438]
  • A tested product variant was the RGB, 30 cm, 9 W, waterproof model from AliExpress, used as the sacrificial device for reverse-engineering. [#20686151]
  • Early queue-related instability showed up after roughly 7–8 color changes in Home Assistant on one tester’s setup, which is why Flag 43 became important. [#20722415]

1. How can I tell whether a Tuya LED controller on firmware 1.1.12 is compatible with Tuya Cloudcutter, and how do I choose between the BK7231N and BK7231T profile?

Use Cloudcutter in detection mode first, not full flashing. 1. Select the Cloudcutter-only option. 2. Try both the T and N profile for that exact firmware. 3. If one profile shows an “A-xx” prefix, use that platform for flashing. The thread’s practical rule was to avoid guessing before detection, because picking the wrong platform can strand a sealed device with no easy recovery path. [#20661998]

2. What is OpenBeken (OBK), and how does it work with TuyaMCU-based LED controllers like BK7231N or BK7231T devices?

OpenBeken is replacement firmware that runs on Beken Wi‑Fi chips and can control a separate TuyaMCU over serial. "TuyaMCU is a serial control MCU that handles device features through dpIDs, while the BK chip provides Wi‑Fi, scripting, and UI logic." In this thread, OBK worked by starting the TuyaMCU driver, setting Wi‑Fi state, mapping dpIDs, and sending scene or color commands instead of talking to LEDs directly. [#20720438]

3. What is an individually addressable LED driver such as SM16703P, and how is it different from simple RGB or CCT LED control?

An individually addressable LED driver such as SM16703P lets one strip show multiple colors on different LEDs at the same time. "SM16703P is an addressable LED driver that controls per-pixel color data, unlike simple RGB or CCT control where the whole strip changes together." The thread used a simple test: if one device can display several colors at once, it is addressable; if it only changes as a whole, it behaves like basic RGB/CCT lighting. [#20685681]

4. Why did the SM16703P test commands fail on some OpenBK builds, and which builds added working support for BK7231N versus BK7231T?

They failed because support landed unevenly across platforms and some builds missed the latest commit. One tester got SM16703P_Init NOT found, then found 1.17.202 T unavailable with a 404, while the maintainer confirmed the contributor had only provided a working version for N at that point. Later, a tester on BK7231N flashed 1.17.206 and could at least load the driver, while T support still needed porting. [#20669569]

5. How do I safely test a sealed waterproof Tuya light with Cloudcutter and OpenBeken without opening the device or risking permanent loss of functionality?

Test cloud detachment first and keep original behavior available as long as possible. 1. Verify Cloudcutter compatibility without flashing. 2. Add the light to Tuya and, if needed, LocalTuya first so you can inspect dpIDs. 3. Do not flash experimental direct LED drivers unless you have a backup or a cheap sacrificial unit. The maintainers explicitly recommended a 2 MB firmware backup before risky tests because support was incomplete early on. [#20662154]

6. Why do the LEDs start blinking blue immediately after power-up on this Tuya light, and how does the tuyaMcu_defWiFiState 4 command stop the pairing-style blinking?

They blink because the TuyaMCU thinks the device is still in Wi‑Fi pairing mode. The fix is to tell the MCU it is already paired and cloud-connected by sending tuyaMcu_defWiFiState 4. In the thread, the maintainer identified the blue blinking as MCU-side status behavior, not LED driver failure, and said the blinking would stop as soon as that command was applied. [#20685629]

7. How can I determine from Tuya Config data and dpIDs whether a light uses direct SM16703 control or a separate TuyaMCU controlling the LEDs?

Look for Tuya serial metadata and stateful dpIDs instead of raw LED pin control. In this case, the Tuya Config partition exposed a baud rate, and the live device reported dpIDs such as 20, 21, 24, 25, 51, 52, and 53, which confirmed a TuyaMCU path. The maintainer concluded that direct SM16703 commands would not work here because the LEDs were not being driven straight from the BK chip. [#20685629]

8. What do the Tuya dpIDs 20, 21, 24, 25, 27, 28, 51, 52, and 53 do on this dreamlight-style TuyaMCU LED controller?

They map the device’s main functions. 20 is power, 21 is mode, 24 is color/brightness data for light mode, 25 is scene data, 27 is phone-microphone music data, 28 is color-wheel control data, 51 is dreamlight scene mode, 52 is dreamlight music data, and 53 is pixel-number or timing-related control. The reverse-engineering notes also tied 21 values to 1 = light, 2 = scenes, and 3 = music. [#20720196]

9. How do I create a working autoexec.bat for this TuyaMCU RGB light in OpenBeken with Light mode, Music mode, and custom scene buttons like Curtain, Rainbow, and Firework?

Start with TuyaMCU, set Wi‑Fi state and baud, then bind HTTP buttons to mode and scene scripts. The working template used startDriver TuyaMCU, tuyaMcu_defWiFiState 4, tuyaMcu_setBaudRate 115200, tuyaMCU_setupLED 24 1, then scene buttons that first sent tuyaMcu_sendState 21 4 2 and next pushed scene payloads on dpID 25. A published example already included Music mode, Light mode, Curtain, Collision, Rainbow, Pile, Firework, and Chase buttons. [#20721021]

10. Why does the warm white and cool white temperature slider turn the LEDs off in OBK or Home Assistant on this device, and what does that imply about native Tuya support?

It turns the LEDs off because this device does not expose a real warm/cool white channel in its native Tuya behavior. After reviewing the original app, the developers concluded there was no CW slider at all there, only a color picker and preset modes. That means OBK or Home Assistant may show a white-temperature control, but on this product it is not backed by a valid Tuya datapoint and should not be treated as supported. [#20777571]

11. How can I fix swapped colors such as red showing as blue and blue showing as yellow on a TuyaMCU light, and when is the remote's RGB order setting involved?

Fix the RGB order in the remote’s hidden configuration, not in OBK first. One tester proved the mismatch was local to the lamp because tuyaMCU_sendColor 24 1 0 0 1 produced blue, 0 1 0 1 produced green, and 0 0 1 1 produced red. Later, the same user corrected the order by revisiting the remote/manual settings and confirmed the colors became correct without a firmware rewrite. [#20721099]

12. What is the difference between LocalTuya and TuyaLocal in Home Assistant, and which one fits a cloud-detached Tuya light after using Cloudcutter?

LocalTuya was the path discussed for a cloud-detached light in this thread. After detaching from the cloud, a contributor said the device would keep full functionality, but you would need LocalTuya to control it because it would no longer connect to the Tuya cloud. The thread mentions confusion with TuyaLocal, but the only concrete recommendation here was LocalTuya plus the device ID and dpIDs discovered during setup. [#20663292]

13. How do I use Home Assistant and MQTT to trigger TuyaMCU animations from OBK, including scene commands that need manual YAML or dashboard buttons?

Use MQTT publish actions from Home Assistant buttons and send the same OBK commands that work in the web UI. The maintainer said animation triggering still needed manual YAML or dashboard-button service actions, and later showed Home Assistant buttons sending MQTT commands. For example, scene buttons can publish a mode change to dpID 21 = 2 and then the required dpID 25 scene payload for Curtain, Rainbow, or Firework. [#20818136]

14. Why would color changes stop working after several tries in Home Assistant, and how does enabling OpenBeken flag 43 'TuyaMCU Use queue' affect reliability?

They can stop because back-to-back TuyaMCU writes collide or arrive in the wrong order. One tester reported color changes failing after about 7 or 8 tries until the lamp was power-cycled, which led to a test build and the new Flag 43: TuyaMCU Use queue. After enabling that queue flag, another tester reported that color changes and dimming worked every time from both the device page and Home Assistant. [#20766386]

15. What can I do if a TuyaMCU light powers back on after a reboot or power cut even with startup settings changed, and how can autoexec or SetStartValue be used as a workaround?

Use autoexec to force an OFF command after boot, because SetStartValue did not solve this TuyaMCU case. The reported workaround was: query state, wait about 1 second, then send tuyaMcu_sendState 20 1 0. The maintainer called it a temporary fix and noted the lamp may flash on briefly before turning off again, but it reliably restored the desired post-reboot OFF state until a firmware-side fix could be worked on. [#21275570]
Generated by the language model.
ADVERTISEMENT