logo elektroda
logo elektroda
X
logo elektroda

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

MnM1 6750 136
ADVERTISEMENT
  • #61 20713980
    p.kaczmarek2
    Moderator Smart Home
    It will be very hard to solder in case of this particular device. Direct SM16703 control would require hardware SPI pin, ,MOSI, namely P16, to be connected to the LED strip. The P16 is not easily available on CB2S module. You can only route it yourself by soldering to QFN pin.

    Still, there are some other LED strip products around which comes without MCU and they use P16 in a way I said to control SM16703
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #62 20720196
    DeDaMrAz
    Level 20  
    Here are some of the captured fnID's so far.

    fnID 20 is bool power on/off with values 0 and 1
    fnID 21 is mode of operation 1 (dimmer), 2 (scenes) and 3 (music)
    fnID 24 is brightness control (and possibly some preset colors) as a string - preceded by fnID21 1
    fnID 25 is brightness setting in scene mode as a string - preceded by fnID21 2
    fnID 26 is off timer in seconds
    fnID 27 is a data from the phone microphone if music mode is enabled as a string - preceded by fnID21 3
    fnID 28 are the values form the color wheel selector as a string

    The rest will follow.
  • #63 20720244
    p.kaczmarek2
    Moderator Smart Home
    Flash OBK and we will try to send something.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #64 20720384
    DeDaMrAz
    Level 20  
    User interface of OpenBK7231N with LED controls.

    Progress so far.

    Power toggle works, adding scenes works, color picking works, brightness control for stable color works so far (probably music selector as well)

    TODO - brightness control for scenes, adding more scenes and figuring out if color temperature is possible to set.

    Good progress ;)
  • #65 20720398
    p.kaczmarek2
    Moderator Smart Home
    DeDaMrAz wrote:

    fnID 24 is brightness control (and possibly some preset colors) as a string - preceded by fnID21 1

    It turns out that dpID 24 is the same as in the @nethawk topic here:
    https://www.elektroda.com/rtvforum/find.php?q=tuyaMCU_setupLED
    https://www.elektroda.com/rtvforum/topic3982779.html#20656814
    So this can work:
    
    // red
    tuyaMCU_sendColor 24 1 0 0 1
    // green
    tuyaMCU_sendColor 24 0 1 0 1
    // etc
    
    Helpful post? Buy me a coffee.
  • #66 20720438
    DeDaMrAz
    Level 20  
    This is the working autoexec.bat that will bring you functionality that we were able to figure out so far, more to follow as it is somewhat complicated.

    Be aware color temperature selector is not working at this point so don't use it!!

    Test other features and post here what you have and any findings that you may come across - thank you!

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    
    tuyaMCU_setupLED 24 1
    
    
    
    startDriver httpButtons
    setButtonEnabled 0 1
    setButtonLabel 0 "Chase"
    setButtonCommand 0 "startScript autoexec.bat do_chase"
    
    setButtonEnabled 1 1
    setButtonLabel 1 "Curtain"
    setButtonCommand 1 "startScript autoexec.bat do_curtain"
    
    // stop execution
    return
    
    do_chase:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 020e0d00001403e803e800000000
    return
    
    do_curtain:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 000e0d00002e03e802cc00000000
    return
    
  • #67 20720457
    p.kaczmarek2
    Moderator Smart Home
    A bit more:
    
    
    
    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    
    tuyaMCU_setupLED 24 1
    
    startDriver httpButtons
    setButtonEnabled 0 1
    setButtonLabel 0 "Chase"
    setButtonCommand 0 "startScript autoexec.bat do_chase"
    
    setButtonEnabled 1 1
    setButtonLabel 1 "Curtain"
    setButtonCommand 1 "startScript autoexec.bat do_cur"
    
    setButtonEnabled 2 1
    setButtonLabel 2 "Collision"
    setButtonCommand 2 "startScript autoexec.bat do_col"
    
    setButtonEnabled 3 1
    setButtonLabel 3 "Rainbow"
    setButtonCommand 3 "startScript autoexec.bat do_rai"
    
    setButtonEnabled 4 1
    setButtonLabel 4 "Pile"
    setButtonCommand 4 "startScript autoexec.bat do_pil"
    
    setButtonEnabled 5 1
    setButtonLabel 5 "Firework"
    setButtonCommand 5 "startScript autoexec.bat do_fir"
    
    // stop execution
    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
    
    
    
    Helpful post? Buy me a coffee.
  • #68 20720516
    DeDaMrAz
    Level 20  
    User interface for testing and configuring LED settings with buttons for various lighting effects.

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
     
    tuyaMCU_setupLED 24 1
     
    startDriver httpButtons
    setButtonEnabled 0 1
    setButtonLabel 0 "Music mode"
    setButtonCommand 0 "tuyaMcu_sendState 21 4 3"
     
    setButtonEnabled 1 1
    setButtonLabel 1 "Curtain"
    setButtonCommand 1 "startScript autoexec.bat do_cur"
     
    setButtonEnabled 2 1
    setButtonLabel 2 "Collision"
    setButtonCommand 2 "startScript autoexec.bat do_col"
     
    setButtonEnabled 3 1
    setButtonLabel 3 "Rainbow"
    setButtonCommand 3 "startScript autoexec.bat do_rai"
     
    setButtonEnabled 4 1
    setButtonLabel 4 "Pile"
    setButtonCommand 4 "startScript autoexec.bat do_pil"
     
    setButtonEnabled 5 1
    setButtonLabel 5 "Firework"
    setButtonCommand 5 "startScript autoexec.bat do_fir"
     
    setButtonEnabled 6 1
    setButtonLabel 6 "Chase"
    setButtonCommand 6 "startScript autoexec.bat do_chase"
     
     
    // stop execution
    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


    Added Music mode...

    So far HA integration is not working as intended so we suggest not to use it with HA at this point, we will post more updates as we make progress.
  • #69 20720547
    MnM1
    Level 10  

    Thank you guys - good progress!! Will try the suggested autoexec.bat.
  • ADVERTISEMENT
  • #70 20720640
    p.kaczmarek2
    Moderator Smart Home
    Let us know how it works.

    Currently we still don't know whether those long strings here:
    
    do_col:
    tuyaMcu_sendState 21 4 2
    delay_s 0.1
    tuyaMcu_sendState 25 3 07464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000
    return
    

    are hardcoded identifiers or animation data somehow compiled, still working on it.

    At least we know they also include brightness data.
    Here is the same animation with different level of brightness:
    
    55AA030700201903001C3032306430643030303031343033653830306333303030303030303086
    55AA030700201903001C303230643064303030303134303365383031386630303030303030308F
    55AA030700201903001C303230643064303030303134303365383032356430303030303030308B
    55AA030700201903001C3032306430643030303031343033653830336538303030303030303090
    55AA030700201903001C3032306430643030303031343033653830336538303030303030303090
    
    55 AA	03	07		00 20	19 03 00 1C 30323064306430303030313430336538303063333030303030303030 		86	
    HEADER	VER=03	State		LEN	fnId=25 Str V=020d0d00001403e800c300000000	CHK	
    
    55 AA	03	07		00 20	19 03 00 1C 30323064306430303030313430336538303138663030303030303030 		8F	
    HEADER	VER=03	State		LEN	fnId=25 Str V=020d0d00001403e8018f00000000	CHK	
    
    55 AA	03	07		00 20	19 03 00 1C 30323064306430303030313430336538303235643030303030303030 		8B	
    HEADER	VER=03	State		LEN	fnId=25 Str V=020d0d00001403e8025d00000000	CHK	
    
    55 AA	03	07		00 20	19 03 00 1C 30323064306430303030313430336538303365383030303030303030 		90	
    HEADER	VER=03	State		LEN	fnId=25 Str V=020d0d00001403e803e800000000	CHK	
    
    
    02 0d 0d 00 00 14 03 e8 03 e8 00 00 00 00
    

    See? Only 3 characters change:
    Screenshot of codes and data in HEX format, showing different brightness values.
    I wonder what is the meaning of the other characters here.

    NOTE: those are ASCII strings that forms characters that looks like HEX data....

    3e8 at full bright looks like 1000 in decimal
    Helpful post? Buy me a coffee.
  • #71 20720996
    MnM1
    Level 10  
    I have done some testing and here are my comments so far.

    1.Using the autoexex content that @DeDaMrAz mentioned above I somehow have 2 toggle buttons. I have no idea why (running version 1.17.232)
    Pressing on Toggle 20 doesn't seem to do anything. Toggle Light - turns on/off the light.

    Screenshot of LED lighting control interface with various options.

    2. Brightness works OK with the light and the scenes.

    3. RGB Color - is not right for me. When I select RED in the RGB picker the led are blue on the light. If I select BLUE on the RGB picker the light is orange. GREEN works OK. Yellow gives a very light blue. A bit of mismatch.

    4. As you have mentioned Temperature does not work right now.

    5. The Scenes all work fine.

    6. Music Mode - it seems to respond much better to vibrations rather than music. For example I have the stereo up and nothing happens. But if I tap my finger on the surface where the light is on there is a response. If there is a way in increase the microphone sensitivity maybe that will fix this. But not sure if possible.

    One addition that I think will be good to have maybe will be a button to go back from a Scene to light. At the moment if you press a Scene button the only way to stop it and display light only is through the RGB picker to pick a color. Then the scene stops and the light shows that color. A button to show Cool white or warm white for example might add a bit more functionality.

    Hopefully you guys can mage to add the rest of the functions available through Tuya/remote - Shut Down timer, Sensitivity, Speed:

    Remote control with button descriptions

    And of course HA integration :)

    If you have anything else in mind that could be added/implemented to such a device please add it!! :)

    Many thanks guys for your help with freeing this device for Tuya cloud!![/img]
  • #72 20721021
    DeDaMrAz
    Level 20  
    You can add this to existing autoexec file to enable light only toggle:

    startDriver httpButtons
    setButtonEnabled 7 1
    setButtonLabel 7 "Light mode"
    setButtonCommand 7 "tuyaMcu_sendState 21 4 1" 


    Every 7 represents button placement so adjust that to your needs.

    Also can you post some logs from your device when doing color change?

    Here is the complete autoexec so far:

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    startDriver httpButtons 
    tuyaMCU_setupLED 24 1
     
    
    setButtonEnabled 0 1
    setButtonLabel 0 "Music mode"
    setButtonCommand 0 "tuyaMcu_sendState 21 4 3"
    
    startDriver httpButtons
    setButtonEnabled 1 1
    setButtonLabel 1 "Light mode"
    // default is cold white
    setButtonCommand 1 "tuyaMcu_sendState 21 4 1" 
     
    setButtonEnabled 2 1
    setButtonLabel 2 "Curtain"
    setButtonCommand 2 "startScript autoexec.bat do_cur"
     
    setButtonEnabled 3 1
    setButtonLabel 3 "Collision"
    setButtonCommand 3 "startScript autoexec.bat do_col"
     
    setButtonEnabled 4 1
    setButtonLabel 4 "Rainbow"
    setButtonCommand 4 "startScript autoexec.bat do_rai"
     
    setButtonEnabled 5 1
    setButtonLabel 5 "Pile"
    setButtonCommand 5 "startScript autoexec.bat do_pil"
     
    setButtonEnabled 6 1
    setButtonLabel 6 "Firework"
    setButtonCommand 6 "startScript autoexec.bat do_fir"
     
    setButtonEnabled 7 1
    setButtonLabel 7 "Chase"
    setButtonCommand 7 "startScript autoexec.bat do_chase"
     
     
    // stop execution
    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


    Microphone is encapsulated inside a sealed plastic box, wrapped in a heat shrink tubing :) I am testing with it exposed and it works fine, but there are no information on gain modification...yet ;)
  • #73 20721040
    MnM1
    Level 10  
    This is when I pick red it shows BLUE color

    Info:TuyaMCU:Color is sent as 000003de03c0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 14 01 00 01 01 25 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 20, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 30 30 30 33 64 65 30 33 63 30 22 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes


    This is when I click blue - it shows yellow

    Info:TuyaMCU:Color is sent as 00d503de03c0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 14 01 00 01 01 25 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 20, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 64 35 30 33 64 65 30 33 63 30 5B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 


    This when I click green - it shows green:

    Info:TuyaMCU:Color is sent as 008a03de03c0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 14 01 00 01 01 25 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 20, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 38 61 30 33 64 65 30 33 63 30 5B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 


    This is when I click yellow - it shows light blue:

    Info:TuyaMCU:Color is sent as 003c03de03c0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 14 01 00 01 01 25 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 20, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 33 63 30 33 64 65 30 33 63 30 58 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 


    Hope this helps - let me know if you need more or anything else.

    Light Button works perfect. And thank you for the explanation - now I know how to add more buttons if I need to.

    Edit - at the top when I pick red color it actually shows BLUE.
  • #74 20721049
    DeDaMrAz
    Level 20  
    Glad to be of help.

    Your logs are kind of weird, like they have inverted color bytes...

    mine:
    55 AA 03 07 00 10 18 03 00 0C 30 30 30 30 30 33 64 34 30 32 33 61 F1 - red
    55 AA 03 07 00 10 18 03 00 0C 30 30 39 34 30 33 64 34 30 32 33 61 FE - green
    55 AA 03 07 00 10 18 03 00 0C 30 30 66 36 30 33 64 34 30 32 33 61 2D - blue
    yours:
    55 AA 03 07 00 10 18 03 00 0C 30 30 30 30 30 33 64 65 30 33 63 30 22 - red
    55 AA 03 07 00 10 18 03 00 0C 30 30 38 61 30 33 64 65 30 33 63 30 5B - green
    55 AA 03 07 00 10 18 03 00 0C 30 30 64 35 30 33 64 65 30 33 63 30 5B - blue

    Underline are color selection values (obviously we didn't pick exact same colors but close enough to compare) but the bold bytes are messed up somehow.

    Maybe a weird timing issue? Do you have any flags set?
  • #75 20721071
    MnM1
    Level 10  

    Interesting .... not sure why ..let me do the test again and see:

    Pick RED = Shows Blue
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 30 30 30 33 64 65 30 33 61 63 53

    Pick BLUE = shows PINK (before it was yellow)
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 66 31 30 33 64 65 30 33 61 63 8A

    Pick Yellow = Shows Light Blue
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 33 61 30 33 64 65 30 33 61 63 87

    Pick GREEN = Shows GREEN
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 37 39 30 33 64 65 30 33 61 63 63

    Not sure why - I did fiddle around with the remote a while back while I was trying to pair it with Tuya. I believe the remote has some capability to do "stuff" - like reassign button functions, maybe colors, etc not sure exactly - maybe there is something stored somewhere (related to IR?) in for whatever changed back then.

    Maybe there is a way to wipe all this? Already tried to reset the device back to factory settings and it didn't change anything.

    Only flag 10 was set for it. I disabled it. Rebooting now.
    After reboot, it's the same as before.
  • #76 20721091
    DeDaMrAz
    Level 20  
    Ok, got it figured out :facepalm: last bytes are actually brightness values :D learning as we go so I apologize if I was misleading you.

    can you try these commands :

    tuyaMCU_sendColor 24 1 0 0 1 (you should get RED)
    tuyaMCU_sendColor 24 0 1 0 1 (you should get GREEN)
    tuyaMCU_sendColor 24 0 0 1 1 (you should get BLUE)

    You can try then in Logs tab, on the bottom you have a command line input. Also grab the log for these commands pls.
  • #77 20721099
    MnM1
    Level 10  
    All good :) no apologies required :)

    Here are the results:

    BLUE Color is displayed:
    Debug:CMD:cmd [tuyaMCU_sendColor 24 1 0 0 1]
    Info:TuyaMCU:Color is sent as 000003e803e8
    Info:CMD:[WebApp Cmd 'tuyaMCU_sendColor 24 1 0 0 1' Result] OK
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 30 30 30 33 65 38 30 33 65 38 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes


    GREEN Color is displayed:
    Info:TuyaMCU:Color is sent as 007803e803e8
    Info:CMD:[WebApp Cmd 'tuyaMCU_sendColor 24 0 1 0 1' Result] OK
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 37 38 30 33 65 38 30 33 65 38 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes


    RED Color is displayed:
    Debug:CMD:cmd [tuyaMCU_sendColor 24 0 0 1 1]
    Info:TuyaMCU:Color is sent as 00f003e803e8
    Info:CMD:[WebApp Cmd 'tuyaMCU_sendColor 24 0 0 1 1' Result] OK
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 18 03 00 0C 30 30 66 30 30 33 65 38 30 33 65 38 36 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 24, dataType 3-DP_TYPE_STRING and 12 data bytes
  • ADVERTISEMENT
  • #78 20721103
    p.kaczmarek2
    Moderator Smart Home
    MnM1 wrote:

    1.Using the autoexex content that @DeDaMrAz mentioned above I somehow have 2 toggle buttons. I have no idea why (running version 1.17.232)
    Pressing on Toggle 20 doesn't seem to do anything. Toggle Light - turns on/off the light.

    No. It is not the fault of this autoexec.bat. It's just that you have previously set channel 20 type to "Toggle" and it's still kept in the settings.

    Go to Web App, then find channel 20 on channel types list and change the type back to default one.
    Helpful post? Buy me a coffee.
  • #79 20721109
    MnM1
    Level 10  

    Nothing there (already checked that before):

    Screenshot of device pin settings with dropdown fields for each pin.:
  • #80 20721117
    p.kaczmarek2
    Moderator Smart Home
    Those are pin settings. They are used to set the types of physical IO pins of the device.

    You are looking for channel types. They should be next to the right. Channel types are used to set the types of the channels, which are like virtual variables containers. They are non-physical.


    BTW: So you have swapped colors while they are OK on @DeDaMrAz device?
    Helpful post? Buy me a coffee.
  • #81 20721121
    MnM1
    Level 10  

    Silly me - learning :) found it in the next column as you have said. Second button is gone now.

    In regards to the RGB - I have never swapped anything intentionally. It might have been by mistake while trying the IR remote.
    That remote has some strange settings - it looks like it can change remote button functions, LED colors (I think) and more. Not sure because the English in the manual they sent me is not that great:

    On/Off
    1, short button function: short button, cycle on/off;
    2, long button function: long button 5S, cycle code/code;
    Note: When the code alignment is successful, the blue light
    of the lamp flashes 3 times quickly, and the yellow light
    flashes 5 times slowly after the code clearance is successful.
    Play/Pause:
    1. Short button function: When the light belt is turned on,
    the color ring monochrome or magic static color short button
    enters the automatic play mode. In dynamic mode, press the
    button to pause;
    2, long button function: in the light belt off state, long press
    the play/pause button for 5S, enter the light belt line
    sequence and number setting mode (light belt white light plus
    red, green and blue three segments) :
    mode +/-: Adjust the color of the three lights at the bottom
    of the sequence to red, green and blue, press the On/Off key
    to save the Settings and exit the setting.
    Speed +/-: Adjust the number of points after adjusting to
    the required number of points, press the On/Off key to save
    and exit the setting;
    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;
    Timed shutdown:
    1. Short button function: Press the button to set the timed
    shutdown time, and the white light flashes
    1/2/3/4/5 corresponds to timing 1/2/4/4/5h, and the shutdown
    is terminated at timing.
    Mode +/- : Short press mode +/- to switch the magic color mode,
    a total of 256 kinds, for setting mode
    Whole line sequence;
    Music mode:
    1, short button function: tap to enter the music mode, short
    press again to switch the music mode
    Formula; In Music mode, short press color ring, Lighting, and
    mode +/- to exit to other modes;
    2. Long press the music button: the controller will force into
    the wifi pairing state, and the pairing state light belt will
    flash red slowly;
    Brightness +/- : Short press the button to adjust the
    brightness, a total of 16 gears;
    Speed +/- : Short press the key to switch the speed of the magic
    mode, a total of 10 gears, to use in the setting mode
    To set the number of lights;
    Sensitivity +/- : Press the button to add or subtract the music
    mode sensitivity;
    Indicator light: In normal working mode, the remote control
    indicator light will be effectively lit up with the touch of
    the key, and it will be lit up after a while.


    Also if anything was changed by mistake I could not find a way to revert back to factory config. I have tried the app option (Return device to factory setting (this will erase everything, even your WIFI config)) but the settings for RGB are the same as I posted above.
  • #82 20721193
    p.kaczmarek2
    Moderator Smart Home
    It doesn't seem like it has option to swap colors. Maybe you have slightly different model?

    @DeDaMrAz can you confirm whether colors on your piece are correctly displayed?
    Helpful post? Buy me a coffee.
  • #83 20721207
    MnM1
    Level 10  

    I think if you long press the Play/Pause button on the remote, it takes you into some kind of submenu where it all gets confusing. I would suggest not to do that as settings might change on a device.
    For example, this morning I managed to somehow change the function of the Music function of the device - when pressing the Music Mode in the app, it was changing colors instead of going into the Music Mode. Somehow I managed to put it back to what it was originally. Don't ask me how as I have no idea - I tried too many things.

    I remember that after I flashed the device to OBK and got TuyaMCU loaded (that's a few months/weeks ago), I did get into that submenu and tried a few things to get out of it. I think that is when the RGB settings on the device changed. That's what I believe happened - what actually happened might be something else entirely :)
  • #84 20721516
    DeDaMrAz
    Level 20  
    p.kaczmarek2 wrote:
    It doesn't seem like it has the option to swap colors. Maybe you have a slightly different model?

    @DeDaMrAz can you confirm whether the colors on your piece are correctly displayed?


    On my OBK home page, all color changes are working - confirmed.

    Interesting that the sendColor command is working OK for @mnm11


    Added after 2 [hours] 3 [minutes]:

    I think we are close to figuring out what is wrong with HA integration and will post here once we have it figured and solved ;)

    Will not stop until we got it fully functional.

    To be continued.
  • #85 20722415
    DeDaMrAz
    Level 20  

    @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?

    We also have some progress in the mic sensitivity area, fnID's 52 and 53 are probably responsible for setting that in a range of 0000010100 (lowest) to 00000101F4 (highest), but we will have to play around a bit more to be sure if that is the case.

    NOTE: WW to CW color temp is still not working in HA or in OBK home page - yet to figure it out.
  • #86 20722531
    MnM1
    Level 10  
    I have tried and for me it changes the color just fine.
    I am using the RGB wheel to do this. But it never stops changing color.

    When I press any of the colors in the top row (the favorites colors) the light just goes off. This is what I have in there:

    Four circles in different shades of orange and white on a black background.

    If press colors on the second row it brings it back but it doesn't display the correct colors - it mostly goes to white color. This is what I have in the second row:

    Four round color swatches in pastel shades: blue, purple, pink, and orange.

    I have managed to change the RGB order to something better than what was before. This is the process (maybe you should not do it as it might mess up your colors too) all done from the remote:
    1. Power off
    2. Press and hold Play until the device is showing colors
    3. Press < or > to change the colors that are displayed
    4. Press On/OFF to save
    I selected half of the device to show red and the other half green. This is the closest I can get to RGB.

    Looking at that PDF they have sent me I noticed this:

    "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;"

    Not really sure what to make of it, but it sounds like there are 3 white colors (in the first part of that paragraph) but then it sounds like mixing the RGB colors will create the white light (in the second part of the paragraph)?

    When I press the light button all I get is cool white regardless of how many times I press it.

    Let me know if you want me to test anything else - but this will be tomorrow as now is 2:14Am here and I need to get some sleep.
  • #87 20722544
    DeDaMrAz
    Level 20  
    MnM1 wrote:
    When I press any of the colors in the top row (the favorites colors) the light just goes off. This is what I have in there:


    That is the color temp predefined selector and we are aware of it not working, still or should I say yet :)

    Thank you for your report, we will continue to play with this device and post updates here as we figure them out.

    BTW you can play with music mode by utilizing these commands:

    backlog tuyaMcu_sendState 21 4 3; tuyaMcu_sendState 51 3 0000010100; tuyaMcu_sendState 52 3 0000010100; tuyaMcu_sendState 53 2 300;

    by changing last two values in 51 and 52 (ie 00000101F4 instead of 0000010100) and both of them you can get a different response to music similar to different scenes. Still not sure what 53 is doing but default value is 300 and you can play and change that value as well and let as know if you observe any meaningfull change.

    Stay tuned and if you like what we do please consider supporting us by spreading the word or in any other way, thanks.

    EDIT: figured explanation for those commands will be nice so:
    tuyaMcu_sendState 21 4 3 - command fnID(number) [data_type] [value for that data type]
    tuyaMcu_sendState - this is a command for sending various values that TuyaMCU recognizes
    21 - is the fnID that is decoded based on the behavior of the original FW and let's call it designator for certain values that again TuyaMCU understands
    4 - in this case is a Enum type of data (3 would be sting data type and is RAW data like that 0000010100 from above, 2 is a Val(ue) in some predefined range ie 0-100 and 1 is a Bool with values 0 or 1)
    3 - in this case is that Enum value that is representing mode of operation (1 being light mode, 2 being scene mode and 3 being music mode)

    So to summarize tuyaMcu_sendState 21 4 3 translates to - command is tuyaMCU_sendState to a fnID21 as data type 4 (which is Enum, so 1, 2 or 3 in this case) and 3 is discovered mode to be music in this case.

    Similar here tuyaMcu_sendState 51 3 0000010100 - command is tuyaMCU_sentState to fnID51 as data type 3 (raw) and then raw bytes 000001010.

    And finally you can send multiple commands at once with backlog feature in the following format - backlog [whatever supported function]; [another supported function]; [another]; etc but you have to have ; separating them.

    Hope it helps a bit.
  • #88 20723512
    MnM1
    Level 10  

    @DeDaMrAz - Thank you for making progress with this and on the commands guide :)

    I have tested the commands you suggested and I see what you mean. It is a nice addition to the music scene.

    In regards to tuyaMcu_sendState 53 2 300, I got some more info. You have to use the remote to see the effects of this.

    tuyaMcu_sendState 53 2 0 = If you use the RGB wheel on the remote, you will see that as you rotate your finger on it, the color change is pretty instant on the light.
    tuyaMcu_sendState 53 2 8000 = If you use the RGB wheel on the remote, you will see that as you rotate your finger on it, the color change on the light is heavily delayed.

    I have used these extremes (0 and 8000) as with smaller values, I could not see what the effect of the values were.

    Not sure what to make of this - is it a delayed change of color or is it more like Flag18 (smooth transition) in OBK?
  • #89 20723663
    p.kaczmarek2
    Moderator Smart Home
    I've added tuya color preview to analyzer so we can test this device more easily:
    Screenshot of TuyaMCU Explorer Analyzer for OpenBeken showing data packets.
    See more at:
    https://github.com/openshwprojects/TuyaMCUAnalyzer
    Helpful post? Buy me a coffee.

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.
Summary generated by the language model.
ADVERTISEMENT