logo elektroda
logo elektroda
X
logo elektroda

Problem to flash and work with Moes 2 gang wall switch(WIFI+RF433)

omidjozani 5826 29
Best answers

How can I flash a Moes 2-gang wall switch with a WB2S module and make OpenBeken control the external Tuya MCU that drives the relays and LEDs?

This is a TuyaMCU device, so the WiFi module talks to the application MCU over UART using the TuyaMCU protocol, and you must cut the RX/TX traces between the WB2S and the Tuya MCU to flash it because that UART is shared [#20550037] Flashing the WB2S itself is straightforward with RX, TX, GND and 3.3V: start the flasher, power-cycle the board, and make a 2 MB backup first [#20550126] After flashing OpenBeken, create `autoexec.bat` with `startDriver TuyaMCU`, then define the channels and map them to Tuya DPIDs; for this 2-gang switch, dpID 1 is relay/channel 1 and dpID 2 is relay/channel 2 [#20550037][#20550764] The working config is `setChannelType 1 toggle`, `linkTuyaMCUOutputToChannel 1 bool 1`, `setChannelType 2 toggle`, `linkTuyaMCUOutputToChannel 2 bool 2` [#20550764] If you want to identify any other dpIDs, watch the OpenBeken logs while pressing buttons or try them as `val` mappings, but HASS discovery for TuyaMCU is not implemented, so Home Assistant setup must be done manually in YAML [#20550819][#20551590]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • WB2S flashing issue and MCU control questions

    #1 20550017
    omidjozani
    Level 3  
    Posts: 15
    I have bought some Moes 2 gang wall switch(WIFI+RF433) to flash with open beaken but there is a problem. It uses another MCU (66F31965) for all application control and uses WB2S (bk7231T) just to deal with Tuya via RX1 and TX1 of the module. - First of all I could not flash WB2S by bk_writer1.60.exe by any way which I tried. When I connect CEN to GND, it continues counting from zero to 15 seconds and then shows failed. If I disconnect the CEN from the GND, immediately it stops and shows failed. - Assume that I could flash it, how could I program it to deal with MCU(66F3165) to read the input switches and control the output relays and backlight LEDs? Any one can help? Problem to flash and work with Moes 2 gang wall switch(WIFI+RF433) Problem to flash and work with Moes 2 gang wall switch(WIFI+RF433) Problem to flash and work with Moes 2 gang wall switch(WIFI+RF433) Problem to flash and work with Moes 2 gang wall switch(WIFI+RF433)
  • ADVERTISEMENT
  • TuyaMCU flashing and OpenBeken setup steps

    #2 20550037
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    This is a TuyaMCU device.
    WiFi module is controling the MCU via UART, via TuyaMCU protocol.
    You must cut RX/TX traces between WiFI module and TuyaMCU to flash, because the UART port for flashing is used for TuyaMCU as well.
    We have a good TuyaMCU support in OpenBeken. It should be easy to run.
    First you can also consider doing TuyaMCU capture:
    https://www.elektroda.com/rtvforum/topic3970199.html#20528459
    but that's not 100% necessary.
    If you decide to desolder temporarily MCU for flashing, then you can use this guide:
    [youtube]
    https://www.youtube.com/watch?v=Yb3zXtBdSnE
    [/youtube]

    OpenBeken can be easily configured to work with TuyaMCU, but you need to know which dpID variable is which relay/role, etc.
    To configure OpenBeken with TuyaMCU, please consult this topic:
    https://www.elektroda.com/rtvforum/topic3971440.html
    and this:
    https://www.elektroda.com/rtvforum/topic3906443.html

    Basically, after flashing openBeken, in Web App -> LittleFS, create autoexec.bat with "startDriver TuyaMCU", then reboot, then start pressing buttons and watch Web App Logs to see which dpID are used for relays. For example, press button 1, and watch log to see what happens there, which dpID is logged. Then press button 2, etc.
    Then you can continue writing the config to map relays to OBK channels, like in linked examples.

    I will help more if that's needed, we can do that step by step.
    Helpful post? Buy me a coffee.
  • WB2S replacement and flashing timing question

    #3 20550084
    omidjozani
    Level 3  
    Posts: 15
    Thank you for your fast answer.
    I bought 4 of this switch. I de-soldered one of WB2S modules and it can not be flashed by any way. I am not sure whether it's burnt or OK.
    If it has been burnt, can I replace it with 8266? because I think WB2S can not be bought separately in our region.
    As I saw in the videos, flashing WB2S is very hard and not as easy as WB3S which I flashed before on another device.
    I have to connect the CEN to GND in less than a second or reconnect the power before 15 seconds? right?
  • #4 20550126
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    Flashing WB2S is very easy. Only RX, TX, GND and 3.3V are required. Start flashing, disconnect power, reconnect it, and it will flash.

    Do a 2MB backup first.

    You can use bkWriter 1.60 or my tool:
    https://github.com/openshwprojects/BK7231GUIFlashTool

    I flashed tens of WB2S that way. How your setup looks like?
    Helpful post? Buy me a coffee.
  • Need dpIDs for second switch channel

    #5 20550484
    omidjozani
    Level 3  
    Posts: 15
    Thanks again.
    I could flash WB2S easily with your flasher and it works well.
    I followed the links which you have mentioned, I copied the lines for autoexec.bat but it just has 1 channel and my switch is 2 gangs.
    How can I add second channel?
    I logged the info, when I press the switch 1 then the log is : publishing 1 (or 0) to channel 1
    but when I press the switch 2 it will log some info which I can not understand the proper dpID.
    Can you help me?
    this is my log:

    Info:MAIN:Time 463, idle 254160/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 381, socks 2/38
    Info:MAIN:Time 464, idle 270002/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 382, socks 2/38
    Info:MAIN:Time 465, idle 259898/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 383, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 466, idle 265238/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 384, socks 2/38
    Info:MAIN:Time 467, idle 257499/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 385, socks 2/38
    Info:MAIN:Time 468, idle 263455/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 386, socks 2/38
    Info:MAIN:Time 469, idle 257236/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 387, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 470, idle 273008/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 388, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.183 gate=192.168.1.1 mask=255.255.255.0 mac=50:8a:06:7c:50:ff
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-45,ssid=OMD-1,bssid=00:31:92:f3:69:16 ,channel=4,cipher_type:CCMP
    Info:MAIN:Time 471, idle 248798/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 389, socks 2/38
    Info:MAIN:Time 475, idle 270502/s, free 76848, MQTT 1(16), bWifi 1, secondsWithNoPing 393, socks 3/38
    Info:MAIN:Time 476, idle 260919/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 394, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 01 0F
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring

    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 02 01 00 01 00 0F
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 03 00 00 02
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 3 (WiFiState) with 7 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 10 01 00 01 01 1E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:MAIN:Time 477, idle 262260/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 395, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 00 0E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)

    Info:MQTT:Channel has changed! Publishing 0 to channel 1
    Info:MQTT:Publishing val 0 to S1_Lights/1/get retain=0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 478, idle 230933/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 396, socks 2/38
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic S1_Lights/1/get
    Info:MAIN:Time 479, idle 232894/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 397, socks 2/38
    Info:MAIN:Time 480, idle 259232/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 398, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.183 gate=192.168.1.1 mask=255.255.255.0 mac=50:8a:06:7c:50:ff
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-50,ssid=OMD-1,bssid=00:31:92:f3:69:16 ,channel=4,cipher_type:CCMP
    Info:MAIN:Time 481, idle 284582/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 399, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 482, idle 266629/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 400, socks 2/38
    Info:MAIN:Time 484, idle 259691/s, free 76848, MQTT 1(16), bWifi 1, secondsWithNoPing 402, socks 3/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 08 02 00 04 00 00 00 00 1C
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 8, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 02 01 00 01 01 10
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:MAIN:Time 485, idle 257680/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 403, socks 2/38
    Info:MAIN:Time 488, idle 259031/s, free 76832, MQTT 1(16), bWifi 1, secondsWithNoPing 406, socks 3/38
    Info:MAIN:Time 489, idle 267050/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 407, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 490, idle 261998/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 408, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.183 gate=192.168.1.1 mask=255.255.255.0 mac=50:8a:06:7c:50:ff
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-49,ssid=OMD-1,bssid=00:31:92:f3:69:16 ,channel=4,cipher_type:CCMP
    Info:MAIN:Time 492, idle 258646/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 410, socks 2/38
    Info:MAIN:Time 493, idle 259638/s, free 85224, MQTT 1(16), bWifi 1, secondsWithNoPing 411, socks 3/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 494, idle 259269/s, free 85456, MQTT 1(16), bWifi 1, secondsWithNoPing 412, socks 2/38

    and this is my autoexec.bat:

    248561%7D

    startDriver TuyaMCU
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 bool 1

    Regards.
  • Map TuyaMCU dpId 2 to second relay channel

    #6 20550764
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    Please enter codes/logs in code tag so they are readable.

    I can see here second relay:
    
    
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 1-DP_TYPE_BOOL and 1 data bytes
    

    dpID is 2, very obvious index.

    So, let's modify autoexec.bat to this:
    
    startDriver TuyaMCU
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 bool 1
    setChannelType 2 toggle
    linkTuyaMCUOutputToChannel 2 bool 2
    
    Helpful post? Buy me a coffee.
  • Questions about OBK Home Assistant setup and dpID 7/8

    #7 20550801
    omidjozani
    Level 3  
    Posts: 15
    Thank you very much, now everything works well except for home assistant.

    I have to config. OBK to introduce home assistant my device as a 2 gang switch. But I don't know how.

    By the way in addition to dpID 1 and dpID 2, there were two other logs for dpID 7 and dpID 8 which were introducing a value. What about them? Are they related to other parameters like backlight state or timer or ....?

    Also how can I learn the commands which are being used in autoexec.bat like:
    linkTuyaMCUOutputToChannel 1 bool 1
    Where have the commands been explained?
  • Manual dpID reverse-engineering with Tuya app and OBK

    #8 20550819
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    I don't know what are those dpIDs. You can use my analyzer before flashing OBK and reverse-engineer their meaning by testing with Tuya app:
    https://www.elektroda.com/rtvforum/topic3970199.html#20528459

    You can also try setting them from OBK and observe what happens. You can link them as 'val' (value) to any other channel and then use setChannel [idx] [val] and see what happens. I am curious myself, so please try it!

    The docs are here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    Commands are here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md


    For TuyaMCU, config must be done manually in YAML. HASS discovery is not implemented for that kind of device yet.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • How to rename MQTT switch entities and relays

    #9 20550988
    omidjozani
    Level 3  
    Posts: 15
    As I'm not good at yaml can you explain how do I change this to my names?
    Code: YAML
    Log in, to see the code

    where can I find these names in my device? and also what about relay 1 and relay 2 (channel 1 and channel 2)?
  • ADVERTISEMENT
  • MQTT topic mapping for second relay channel

    #10 20551590
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    Hello, your device topic can be found, for example, on MQTT page:
    Problem to flash and work with Moes 2 gang wall switch(WIFI+RF433)
    See?
    
    Command topic: cmnd/obkLEDstripWindow/[Command]
    Publish data topic: obkLEDstripWindow/[Channel]/get
    Receive data topic: obkLEDstripWindow/[Channel]/set
    

    Them, to get your second channel, you can do something like that:
    Code: YAML
    Log in, to see the code

    I haven't checked this YAML in HA yet, but something like that should work.

    Added after 1 [minutes]:

    Remember that "name" and "unique_id" can be whatever you like, just make sure to use correct topics for state_topic and command_topic
    Helpful post? Buy me a coffee.
  • Request for original Tuya firmware backups for version 7 switches

    #11 20620388
    andryvan
    Level 5  
    Posts: 8

    Hello. Sorry for the off-topic question. I need some specific help.
    I purchased 4 of the same switches on Aliexpress as in this thread (3 single-channel, 1 dual-channel). They look exactly the same, only version 7, program version 2.02. With prolonged use, it turned out that they periodically lose the WiFi network and cannot connect to it on their own. The seller does not make contact, as the complaint period has already expired.
    Later, I bought another similar switch from another seller, also version 7, but version of the original program 2.1.6. This switch is stable.
    I learned how to read and write the firmware to the module using the bk7231flasher program, but I still can’t convert the switches to your program, because I don’t understand how they will work further, as I understand, they will no longer work with the Tuya program. Therefore, I decided to flash the modules with a more recent original program for Tuya. But simply copying from one module to another does not help, probably because they get the same MAC address, or maybe there are other reasons. Therefore, I am looking for original firmware for such switches (3 for single-channel and one for two-channel) with a version not lower than 2.1.6. Do you have saved backups that you could share with me? Or maybe you know where you could get such firmware? I will be glad for any help. Thank you in advance.
  • ADVERTISEMENT
  • #12 20621331
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807

    Reflashing 2MB from one device to another will not work. It seems there is some kind of RF/per-device calibration data in one of the memory sections, it's not just limited to MAC. WiFi may not work after such operation.

    Why do you want to use Tuya program? We can help you with OBK setup.

    You can also stay with Tuya and update Tuya firmware via their app.
    Helpful post? Buy me a coffee.
  • Need firmware update source and OBK learning resources

    #13 20621351
    andryvan
    Level 5  
    Posts: 8

    You are right, WiFi does not work if you flash the second switch with a backup copy of the first one. It is difficult for me to deal with these issues, since this is a new area for me, and my age is far from young. I figured out Tuya, but I don't know anything about OBK. Decided to start with a simpler solution to this question, so as not to bother you with every simple (for you) issue.
    Tuya does not offer me updates for these devices. Maybe there is some other solution for updating the firmware?
    If I can't find an easy solution with a firmware update, where can I get information to learn about your system?
  • Suggest opening a device-specific configuration topic

    #14 20621489
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807

    You can browse our per-device instructions from our devices list:
    https://openbekeniot.github.io/webapp/devicesList.html
    or you can watch guides on our YouTube channel:
    https://www.youtube.com/@elektrodacom

    You can also just open a separate topic, put some information on your device (model name, where it was bought, what it does, some photos of the PCB) and we will guide you step by step through the configuration.
    Helpful post? Buy me a coffee.
  • #15 20623557
    omidjozani
    Level 3  
    Posts: 15

    >>20621351
    Although it does not work, but I searched my PC and unfortunately I couldn't find any Tuya backup. Because I reinstalled my windows and many info. have been lost. Anyway sorry about that, I couldn't help.
    By the way, I'm not so young either (about 50), but OBK saved me from Tuya disaster, which I suffered from for many years. With OBK firmware, you can get rid of the cloud and internet.
  • Questions about switching Tuya devices to OBK

    #16 20623912
    andryvan
    Level 5  
    Posts: 8
    Thank you for your attempt to help me. Before giving up Tuya, I would like to have more information. What else, besides switches, will I need to switch to OBK (do I need additional equipment)? What program in the smartphone controls the equipment? In addition to the switches, I also have an IR remote control to control my old air conditioner. There is also an outlet. I can control them through Tuya, but they will also have to be redone (if possible). I don't know the answers to these questions yet. I do not understand English, I use a translator, this also creates difficulties. And I'm already 60 years old... I can't do without help. But my switches are exactly the same as yours, I'm not sure if I need to open a new topic, if I find answers to my questions and start converting my equipment to OBK, then your experience will help me a lot.
  • Clarifying OBK control options and IR support

    #17 20623992
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807

    There are many ways to control OBK devices. First of all, you can control them directly via their web page. Every device hosts an HTTP page that can be accessed with any browser. Then, you can use an external system like Home Assistant. Or you can use some Tasmota apps from Google Play (we have Tasmota compatibility).
    I am not sure about IR remote, we may not have the air conditioner protocol supported yet.
    So you have the same switch as in this topic?
    Helpful post? Buy me a coffee.
  • CB2S board version 7.0 confirmed for switch

    #18 20624011
    andryvan
    Level 5  
    Posts: 8
    Thanks for the clarifications. So no additional hardware is needed?
    Will automation scripts not be available when managing through a browser? I already realized that it is very convenient.
    I looked on Google Play, there are several Tasmota applications, you need to figure out what their differences are.
    Yes, I have exactly the same switch, only the board version is not 6.1, but 7.0. Release date 2022-08-19. The WiFi module says not WB2S, but CB2S. But this, as I understand it, is not important.
  • OpenBeken supports WB2S and CB2S without extra hardware

    #19 20624115
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807

    No additional hardware is needed. The Home Assistant is not required, but it can help; it can do more automation. Home Assistant requires additional hardware, but it's not necessary to have Home Assistant.
    You can do simple automation on only OpenBeken with scripts, with SendGet command (switch can send command to light on given static IP address), etc., with Tasmota Device Groups, etc.
    Both WB2S (BK7231T) and CB2S (BK7231N) are supported.
    Helpful post? Buy me a coffee.
  • #20 20627287
    andryvan
    Level 5  
    Posts: 8

    Hello. I flashed the module with your firmware, configured WiFi. But what to do next? I can solder, but I don't understand anything about programming. I need a 'step-by-step' instruction.
  • #21 20627392
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807

    And do you have the same device as in the first post? The TuyaMCU 2-gang wall switch?

    Well, then go to the Web App, open the LittleFS tab, and create autoexec.bat with the content that is in post 6 of this topic. Save and reboot. It should create 2 buttons on the main panel and allow you to control the relays.
    Helpful post? Buy me a coffee.
  • Suspected Tuya MCU crash on second relay

    #22 20632085
    andryvan
    Level 5  
    Posts: 8
    Hi all! I don't know what to do anymore. Maybe someone will advise something.
    I flashed the switch, made autoexec.bat, one switch works fine. And the second, exactly the same, only turns on via WiFi, but does not want to turn off. And the LED blinks all the time, although the first one does not blink. But the button on the switch itself turns on and off.
    I suspect that Tuya's MCU has crashed. What else can be done? Share your experience.
  • #23 20632144
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807

    Try powering it on and off.

    Try adding the following line to the bottom of autoexec.bat:
    
    tuyaMcu_defWiFiState 4
    

    This will force "paired and connected to cloud" WiFi state spoofing for TuyaMCU and it may stop LED blinking/other issues.
    Helpful post? Buy me a coffee.
  • #24 20632404
    andryvan
    Level 5  
    Posts: 8
    Thanks for the advice. I read about it on this forum and did so right away. But it doesn't help. One switch works and the other doesn't work.
  • #25 20632489
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    Did you save and restart that configuration?
    What does the Web App Log say?

    Paste here a larger portion of log, include the log showing what happens when you switch via WiFi and via physical touch button
    Helpful post? Buy me a coffee.
  • WiFi toggle works only for lamp on, not off

    #26 20634307
    andryvan
    Level 5  
    Posts: 8
    Hello.
    Here is my journal. I turned the lamp on and off first via WiFi (the lamp turned on but did not turn off), then I turned the lamp off, on and off again with the physical button (the lamp turns on and off normally).
    I updated the firmware, but it didn't help.
    Spoiler:

    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 50 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 changes count.
    Error:CMD:no file early.bat err -2
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID *************
    Info:MAIN:Using Pass *************
    Info:MQTT:MQTT_RegisterCallback called for bT / subT /+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd// subT cmnd//+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT / subT /+/get
    Info:MAIN:Started TuyaMCU.
    Info:CMD:CMD_StartScript: started autoexec.bat at the beginning
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Drv TuyaMCU is already loaded.
    Info:GEN:Channel 1 type changed to toggle
    Info:MAIN:Time 1, idle 286376/s, free 77808, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 2, idle 189341/s, free 77808, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 3, idle 191128/s, free 77808, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 4, idle 191149/s, free 77808, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 5, idle 189345/s, free 77808, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:************** key:**************
    Info:MAIN:Time 6, idle 182611/s, free 72424, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 183619/s, free 72424, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 8, idle 269041/s, free 72600, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 9, idle 0/s, free 72600, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 10, idle 0/s, free 72600, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=d8:1f:12:9c:04:43
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 88130/s, free 72496, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 12, idle 191111/s, free 72840, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 192713/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 14, idle 189748/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 15, idle 191719/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 16, idle 194588/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 1 to channel 1
    Info:MAIN:Time 17, idle 188570/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 18, idle 191312/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 0 to channel 1
    Info:MAIN:Time 19, idle 191213/s, free 64448, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:MAIN:Time 20, idle 189029/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.13 gate=192.168.1.1 mask=255.255.255.0 mac=d8:1f:12:9c:04:43
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-46,ssid=**************,bssid=a8:f9:4b:dd:28:a9,channel=4,cipher_type:MIXED
    Info:MAIN:Time 21, idle 188451/s, free 61144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:MAIN:Time 22, idle 189267/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 23, idle 192936/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 24, idle 193310/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 25, idle 191915/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 26, idle 192259/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 27, idle 203294/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 28, idle 190872/s, free 72840, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 29, idle 190391/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 30, idle 195582/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.13 gate=192.168.1.1 mask=255.255.255.0 mac=d8:1f:12:9c:04:43
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-46,ssid=*************,bssid=a8:f9:4b:dd:28:a9,channel=4,cipher_type:MIXED
    Info:MAIN:Time 31, idle 191210/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 32, idle 191500/s, free 72624, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:MAIN:Time 33, idle 192980/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 34, idle 191948/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 35, idle 381473/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 36, idle 192628/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 37, idle 192639/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 38, idle 192938/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 39, idle 188384/s, free 72840, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 40, idle 192565/s, free 64232, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 3/38


    This is the log of the second exactly the same switch, it works fine. I see that the logs are different, but I don't understand why this is happening.
    Spoiler:

    : started autoexec.bat at the beginning
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Drv TuyaMCU is already loaded.
    Info:GEN:Channel 1 type changed to toggle
    Info:MAIN:Time 1, idle 283510/s, free 76416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 2, idle 191078/s, free 76416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 01 00 15 64 63 71 69 37 72 76 31 36 66 74 33 6F 6E 65 62 33 2E 31 2E 35 E2
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 1 (QueryProductInformation) with 28 bytes
    Info:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received dcqi7rv16ft3oneb3.1.5
    Info:MAIN:Time 3, idle 190538/s, free 76416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:MAIN:Time 4, idle 186228/s, free 76416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 00 0E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
    Info:GEN:No change in channel 1 (still set to 0) - ignoring

    Info:MAIN:Time 5, idle 188194/s, free 76416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:************** key:****************
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6, idle 174986/s, free 71008, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 00 0E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
    Info:GEN:No change in channel 1 (still set to 0) - ignoring

    Info:TuyaMCU:TUYAMCU received: 55 AA 00 03 00 00 02
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 3 (WiFiState) with 7 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 10 01 00 01 01 1E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:MAIN:Time 7, idle 180543/s, free 71008, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 8, idle 73471/s, free 71184, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 9, idle 0/s, free 71184, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 10, idle 0/s, free 71184, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=d8:1f:12:9c:02:1f
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 101852/s, free 71456, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 12, idle 199631/s, free 71496, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 1 to channel 1
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 01 0F
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring

    Info:MAIN:Time 13, idle 186720/s, free 71408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 14, idle 167718/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 01 0F
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring

    Info:TuyaMCU:TUYAMCU received: 55 AA 00 03 00 00 02
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 3 (WiFiState) with 7 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 10 01 00 01 01 1E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:MAIN:Time 15, idle 188545/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 00 0E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
    Info:GEN:No change in channel 1 (still set to 0) - ignoring

    Info:MAIN:Time 16, idle 171246/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 17, idle 179047/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 18, idle 193263/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 19, idle 192873/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 01 0F
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)

    Info:GEN:dhcp=0 ip=192.168.1.12 gate=192.168.1.1 mask=255.255.255.0 mac=d8:1f:12:9c:02:1f
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-48,ssid=***************,bssid=a8:f9:4b:dd:28:a9,channel=4,cipher_type:MIXED
    Info:MAIN:Time 21, idle 173099/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 22, idle 194324/s, free 71408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 00 0E
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)

    Thanks for the help.
  • Question about flashing OpenBeken on revised module

    #27 21038970
    omidjozani
    Level 3  
    Posts: 15

    Hi
    Newly I bought one more of that switch, but inside is totally different.
    I bought this Moess switch from Amazon.
    They changed wifi module with ZTE model. And they omitted Tuya MCU, can I flash the same openbeken firmware on this new wifi module?
    If yes what about the flash procedure?

    ZTE chip on a circuit board. Green printed circuit board with several buttons and traces. Close-up of the interior of an electrical switch with various components, including a ZTE module. Top view of a Moes switch circuit board with visible components. Close-up of a circuit board inside a Moes switch with electronic components.
  • #28 21039004
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    Hello! The "Z" marking indicates it's a Zigbee device. ZTE is a Zigbee equivalent of WB2S/CB2S/TYWE2S. This is not a WiFi device.
    ZTU module datasheet using Zigbee.
    Helpful post? Buy me a coffee.
  • #29 21081997
    jaro.44
    Level 10  
    Posts: 38
    Help: 1
    Rate: 3

    Hi I bought a MOES triple switch and would like to hook it up to HA:
    Close-up of MOES circuit board with CB2S component.
    How is the easiest and best way without soldering the module to change the firmware to "friendly" for HA?

    EDIT:
    The switches are going into the cabinet, and under HA I am ordering zigbee.
  • Desoldering the chip enabled BK7231 flashing tool connection

    #30 21095194
    gwidullo
    Level 9  
    Posts: 75
    Rate: 1

    Hello
    First of all, a huge thank you for the software development and clear tutorials and descriptions.
    I purchased some Moes WIFI+ RF433 switches:
    3-Gang (WB2S - BK7231T) and 2-Gang (CB2S - BK7231N).
    Unloading and configuring OpenBK went without any problems, pairing with HA via MQTT also.
    My question is about the RF433 support, because I am thinking about buying Vice switches for them (wall panel with RF433 transmitter).

    Added after 19 [minutes]:

    jaro.44 wrote:

    How is the easiest and best way without soldering the module to change the firmware to HA "friendly"?

    Hey,
    I programmed without desoldering the module, but I had to desolder the chip highlighted in the picture, because I could not connect BK7231 GUI Flash Tool to the module.
    Circuit board with CB2S module and annotations.

Topic summary

✨ The discussion revolves around flashing and configuring the Moes 2 gang wall switch (WIFI+RF433) using OpenBeken firmware. Users encountered issues with the WB2S module, which is controlled via UART by a TuyaMCU protocol. Solutions included cutting RX/TX traces for flashing, using specific tools like bkWriter and BK7231GUIFlashTool, and creating an autoexec.bat file for configuration. Users shared experiences with flashing, programming for dual channels, and integrating with Home Assistant (HA). Some users faced challenges with different versions of the switches and their firmware stability, while others explored the potential of RF433 support. The conversation also touched on the transition from Tuya to OpenBeken for better control and automation without cloud dependency.
AI summary based on the discussion. May contain errors.

FAQ

TL;DR: For 2-gang Moes WIFI+RF433 switches, "TuyaMCU device" is the key diagnosis: flash WB2S with RX, TX, GND and 3.3V, then map dpID 1 and dpID 2 in OpenBeken. This FAQ helps OpenBeken users solve flashing, UART, MQTT and Home Assistant setup issues. [#20550037]

Why it matters: The switch is not a simple GPIO relay device; the WiFi module talks to a separate MCU, so flashing and configuration must respect the shared UART path.

Alternative Chip/module Radio OpenBeken note
WB2S BK7231T WiFi Supported; flash with RX, TX, GND, 3.3V
CB2S BK7231N WiFi Supported; used in similar Moes boards
ZTE Zigbee equivalent Zigbee Not a WiFi WB2S/CB2S module

Key insight: Treat this Moes wall switch as a TuyaMCU product. First isolate the shared UART for flashing, then let OpenBeken’s TuyaMCU driver map dpID values to channels.

Quick Facts

  • WB2S flashing needs only 4 connections: RX, TX, GND and 3.3V; the recommended workflow starts flashing, power-cycles the module, and makes a 2 MB backup first. [#20550126]
  • The working 2-gang OpenBeken mapping uses dpID 1 → channel 1 and dpID 2 → channel 2, both as bool toggles. [#20550764]
  • The original failure mode included CEN held to GND for 15 seconds, after which bk_writer1.60.exe reported failure. [#20550017]
  • Home Assistant discovery was not implemented for this TuyaMCU device type in the thread, so MQTT YAML had to be written manually. [#20550819]
  • Board variants in the thread included version 6.1, version 7.0, release date 2022-08-19, and original program versions 2.02 and 2.1.6. [#20624011]

How do I flash a Moes 2-gang WIFI+RF433 wall switch with a WB2S BK7231T module using OpenBeken?

Flash it through the WB2S UART using RX, TX, GND and 3.3V.
  1. Isolate the UART from the TuyaMCU before flashing.
  2. Start BK7231GUIFlashTool or bkWriter 1.60.
  3. Power-cycle the module, then make a 2 MB backup before writing OpenBeken.
The expert advice was: "Flashing WB2S is very easy." The module does not need CEN held low for the described successful method. [#20550126]

Why does bk_writer 1.60 fail to flash a WB2S module when CEN is connected to GND?

It fails because the flashing UART is still shared with the TuyaMCU in this switch. The user saw a 0-to-15-second countdown, then failure, while CEN stayed grounded. When CEN was disconnected, the failure appeared immediately. The recommended fix was not a longer CEN hold. Isolate RX and TX from the MCU, then flash through RX, TX, GND and 3.3V. [#20550037]

What is a TuyaMCU device, and how does OpenBeken communicate with it over UART?

A TuyaMCU device uses a separate MCU for application control, while the WiFi module exchanges Tuya protocol frames over UART. "TuyaMCU" is a device architecture that keeps relay, button and LED logic in a secondary microcontroller, while the WiFi module sends and receives datapoint commands over RX/TX serial lines. OpenBeken starts the TuyaMCU driver and maps dpID values, such as 1 and 2, to OpenBeken channels. [#20550037]

Why do I need to cut or isolate RX and TX traces between the WiFi module and TuyaMCU before flashing?

You isolate RX and TX because the same UART handles both flashing and TuyaMCU communication. If the TuyaMCU remains connected, it can drive or load the serial lines during programming. The thread states that the WiFi module controls the MCU over UART using the TuyaMCU protocol. Therefore, cutting traces or temporarily desoldering the interfering chip gives the flasher clean access to the WB2S module. [#20550037]

How do I configure autoexec.bat in OpenBeken for a Moes 2-gang TuyaMCU switch with dpID 1 and dpID 2?

Create autoexec.bat in LittleFS and map both Boolean dpIDs to toggle channels.
text
startDriver TuyaMCU
setChannelType 1 toggle
linkTuyaMCUOutputToChannel 1 bool 1
setChannelType 2 toggle
linkTuyaMCUOutputToChannel 2 bool 2
This configuration makes OpenBeken expose 2 channels. Channel 1 follows dpID 1, and channel 2 follows dpID 2. Save the file and reboot the device after editing. [#20550764]

How can I identify which TuyaMCU dpID controls each relay, backlight LED, timer, or other function in a Moes wall switch?

Identify dpIDs by watching OpenBeken logs while pressing buttons or changing settings. Start TuyaMCU, reboot, then press switch 1 and switch 2 separately. The log shows entries such as processing dpId 1 or processing dpId 2. For deeper reverse engineering, capture traffic before flashing and test functions in the Tuya app. You can also link a value dpID to a spare channel and send setChannel [idx] [val]. [#20550819]

What do TuyaMCU dpID 7 and dpID 8 value messages usually mean on Moes WIFI+RF433 switches?

Their meaning was not identified in the thread, but they are value-type TuyaMCU datapoints. The log showed dpID 7 and dpID 8 as DP_TYPE_VALUE with 4 data bytes and raw integer value 0. The expert suggested testing them from OpenBeken as val channels, then observing device behavior. They may represent extra functions, but the thread does not prove backlight or timer mapping. [#20550819]

How do I add a 2-gang OpenBeken TuyaMCU switch to Home Assistant manually with MQTT YAML?

Add two MQTT switch entries, one for channel 1 and one for channel 2. Use your actual OpenBeken device topic instead of WindowsOBK.
yaml
mqtt:
switch:
- unique_id: "moes_relay_1"
name: "Moes Switch 1"
state_topic: "WindowsOBK/1/get"
command_topic: "WindowsOBK/1/set"
qos: 1
payload_on: 1
payload_off: 0
retain: true
- unique_id: "moes_relay_2"
name: "Moes Switch 2"
state_topic: "WindowsOBK/2/get"
command_topic: "WindowsOBK/2/set"
qos: 1
payload_on: 1
payload_off: 0
retain: true
name and unique_id can be chosen freely. [#20551590]

Where can I find the MQTT state_topic and command_topic names for an OpenBeken device?

Find them on the OpenBeken MQTT page in the Web App. The thread example showed three topic patterns: command topic cmnd/obkLEDstripWindow/[Command], publish data topic obkLEDstripWindow/[Channel]/get, and receive data topic obkLEDstripWindow/[Channel]/set. For a 2-gang switch, channel 1 uses /1/get and /1/set; channel 2 uses /2/get and /2/set. [#20551590]

What is LittleFS in OpenBeken, and why is autoexec.bat created there?

LittleFS stores script files that OpenBeken can run at boot, including autoexec.bat. "LittleFS" is a flash-based file system that stores small OpenBeken configuration files, letting users add startup scripts without rebuilding firmware or hard-coding device templates. In this switch, autoexec.bat starts the TuyaMCU driver and maps dpID 1 and dpID 2 after every reboot. [#20627392]

WB2S vs CB2S — what is the difference between BK7231T and BK7231N modules for OpenBeken flashing?

WB2S uses BK7231T, while CB2S uses BK7231N, and both are supported by OpenBeken. The thread included Moes switches with WB2S on 3-gang devices and CB2S on 2-gang devices. Another user had a board version 7.0 switch dated 2022-08-19 with CB2S. The configuration concept stays similar, but the firmware build must match BK7231T or BK7231N. [#20624115]

Why does copying a full 2 MB Tuya firmware backup from one BK7231 switch to another break WiFi?

Copying a full 2 MB backup breaks WiFi because the flash contains device-specific calibration data. The thread states it is not limited to the MAC address. RF or per-device calibration sections can differ between modules. After cloning one switch backup to another, WiFi did not work. Make a backup for safety, but do not use it as a universal Tuya firmware image. [#20621331]

What should I do when a Moes switch flashed with OpenBeken turns on over WiFi but will not turn off, while the physical button still works?

Compare logs from WiFi control and physical button control, then verify TuyaMCU state messages. One reported switch turned on by WiFi but would not turn off, while the touch button worked normally. The expert first advised power-cycling, then requested a larger Web App log showing both control paths. A useful failure sign is missing or different TuyaMCU State frames after the WiFi off command. [#20632489]

How can I stop the LED from blinking on a TuyaMCU switch after flashing OpenBeken, and what does tuyaMcu_defWiFiState 4 do?

Add tuyaMcu_defWiFiState 4 to autoexec.bat, then save and reboot. This command forces the WiFi state reported to the TuyaMCU as paired and connected to cloud. It can stop status LED blinking or other MCU-side issues. The thread also records an edge case: one switch still blinked and malfunctioned even after this line, so logs were needed. [#20632144]

What is the ZTE module in a newer Moes switch, and how is it different from WB2S or CB2S WiFi modules?

The ZTE module is a Zigbee module, not a WiFi WB2S or CB2S replacement. The thread identifies the Z marking as Zigbee and describes ZTE as a Zigbee equivalent of WB2S, CB2S and TYWE2S form factors. Therefore, the same OpenBeken WiFi flashing process for BK7231T or BK7231N does not apply to that newer Moes switch. [#21039004]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT