logo elektroda
logo elektroda
X
logo elektroda

OpenBK on CurryCurry Gen5.3 Curtain Switch with CB3S and TuyaMCU (PY32F003)

HansWorst7 108 5
ADVERTISEMENT
  • #1 21616797
    HansWorst7
    Level 2  
    Hello,

    I need help finalizing my device.

    I have a few CurryCurry Gen5.3 Curtain switches running in my home and for me, it was time to move on from Tuya.

    After a bit of research, I noticed the device has a CB3S chip and a TuyaMCU (Puya PY32F003).

    Screenshot of OpenBK web application logs showing detailed TuyaMCU messages about button states and curtain position values.
    Screenshot showing OpenBK web app logs for a curtain controller device using TuyaMCU and CB3S chips.
    Screenshot displaying OpenBK application logs showing TuyaMCU communication with the CurryCurry Gen5.3 device.

    Since we have a TuyaMCU, we need to cut the connections of TX and RX between it and the CB3S. I did that and managed to flash OpenBK.
    The only setting the BK7231 Easy UART Flasher was able to read was a baud rate of 9600.

    After finishing, I resoldered everything again, though I did kind of a sloppy job (I'm terrible at soldering)..

    Screenshot of TuyaMCU log showing dpId values for curtain control buttons.

    Still, I managed to boot the device and got onto the OpenBK UI.

    In the logs of the web application, I managed to read out the physical buttons of the device, which are connected to the TuyaMCU, using startDriver TuyaMCU.
    For the logging, I ran a basic "Curtains down - Curtains stop - Curtains up" sequence. This is the result of the log:

    
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 04 00 01 02 16 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 2
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 65 01 00 01 00 75 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 101 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 63 7C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 99
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 62 7B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 98
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 61 7A 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 97
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 60 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 96
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5F 78 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 95
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5E 77 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 94
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5D 76 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 93
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5C 75 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 92
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5B 74 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 91
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5A 73 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 90
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 59 72 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 89
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 58 71 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 88
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 57 70 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 87
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 56 6F 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 86
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 04 00 01 01 15 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 65 01 00 01 01 76 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 101 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 04 00 01 01 15 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 65 01 00 01 01 76 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 101 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 04 00 01 00 14 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 65 01 00 01 00 75 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 101 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 57 70 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 87
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 58 71 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 88
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 59 72 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 89
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5A 73 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 90
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5B 74 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 91
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5C 75 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 92
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5D 76 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 93
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5E 77 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 94
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 5F 78 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 95
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 60 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 96
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 61 7A 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 97
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 62 7B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 98
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 63 7C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 99
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 64 7D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 100
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 04 00 01 01 15 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 65 01 00 01 01 76 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 101 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    
    


    What I can read from that is:
    Quote:
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 2

    dpId 1 is a type 4 - enum and was set to 2. This is most likely the button press for "curtains down", which is on channel 1 and the value that was written is 2.

    Quote:
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1

    dpId 1 was now set to enum val 1, which should be the "stop" button.

    Quote:
    Info:TuyaMCU:ParseState: id 1 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 0

    dpId 1 was set to val 0 - I would say this means up.

    There are a few other parameters like dpId2 which is most likely the percentage of the position (100 - open, 0 - closed) and another boolean type dpId 101 which I have no idea yet what this is for.

    Anyway, using this information and getting the example from the CurrySmarter Gen6 Curtain switch (https://www.elektroda.com/rtvforum/topic4046987.html#21033819) I tried writing my own autoexec.bat:

    
    PowerSave 1
    
    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    
    # Channel 1: Touch buttons (0=Open, 1=Stop, 2=Close)
    setChannelType 1 textfield
    setChannelLabel 1 "Touch buttons (0=Open 1=Stop 2=Close)"
    setChannelVisible 1 false
    linkTuyaMCUOutputToChannel 1 4 1 
    
    startDriver httpButtons
    
    setButtonEnabled 0 1
    setButtonColor 0 "#2596be"
    setButtonLabel 0 "Up/Open"
    setButtonCommand 0 "setChannel 1 0"  # up
    
    setButtonEnabled 1 1
    setButtonColor 1 "#abdbe3"
    setButtonLabel 1 "Stop/Pause"
    setButtonCommand 1 "setChannel 1 1"  # stop
    
    setButtonEnabled 2 1
    setButtonColor 2 "#2596be"
    setButtonLabel 2 "Down/Close"
    setButtonCommand 2 "setChannel 1 2"  # down
    


    Unfortunately, this does not work, no reaction whatsoever from the web UI. I would need help starting here. Any help would be appreciated.
  • ADVERTISEMENT
  • #2 21616821
    p.kaczmarek2
    Moderator Smart Home
    So, with current config, commands like setChannel 1 0, or setChannel 1 2, give no reaction from device?

    Hmm, are you sure that this enumeration you're using, dpID 1, is writeable? Your approach will not work if this dpID is read only, i.e. it's used only by TuyaMCU to report the state to the cloud, and NOT to control the state from the cloud.

    Maybe you should try writing some of the other dpIDs.

    Apart from that, your setup looks more or less okay... your baud setting and connection to MCU is okay, since you managed to received data. So no error here.

    Interesting issue, I must admit. Would you be able to share your Tuya config partition, as downloaded from Web App?

    @divadiow may also look here
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21616846
    divadiow
    Level 34  
    Code: JSON
    Log in, to see the code
  • #6 21616851
    p.kaczmarek2
    Moderator Smart Home
    Well it says RW...

    A JSON code snippet showing backlight switch settings with read/write access mode.

    Ok maybe, just for a test, you can check if you can control backlight?
    
    
        {
          "abilityId": 7,
          "accessMode": "rw",
          "code": "switch_backlight",
          "name": "背光开关 (Backlight Switch)",
          "desc": "",
          "desc_en": "",
          "typeSpec": {
            "type": "bool"
          }
        },
    
    Helpful post? Buy me a coffee.
ADVERTISEMENT