logo elektroda
logo elektroda
X
logo elektroda

2 Gang MOES WB2S BK7231T - Aliexpress

Ipn00tic  7 2976 Cool? (+1)
📢 Listen (AI):

TL;DR

  • A MOES 2-gang wall switch from AliExpress gets reworked with OpenBK7231T firmware on a BK7231T-based WB2S module.
  • Programming uses bk_writer1.60 with 5V, GND, RX, TX, and a CEN-to-GND trigger to enter write mode.
  • The firmware used is OpenBK7231T_UA_1.15.162.bin, and the flashing window is 15 seconds.
  • After flashing, autoexec.bat starts TuyaMCU and maps two toggle channels, and the post includes Home Assistant MQTT discovery YAML.
  • CEN must touch GND for less than a second, or the board will miss programming mode.
Generated by the language model.
Moes 2 GAND Wall Switch - Aliexpress https://pt.aliexpress.com/item/10050036040138..._main.136.24a4caa4WAcIDy&gatewayAdapt=glo2bra





Connect the programmer's direct 5v USB output to the power supply module to the pin labeled "+5v" and the negative to GND (red and blue wire).

Connect RX and TX (green and white wires)

Yellow wire is CEN to activate writing mode.

Program to use is: bk_writer1.60 : https://github.com/openshwprojects/OpenBK7231...a220b19018c2e0a80c130df1c38/bk_writer1.60.zip

Firmware File: OpenBK7231T_UA_1.15.162.bin https://github.com/openshwprojects/OpenBK7231T_App/releases/tag/1.15.162

load the firmware in the software and click on programm, you have 15 seconds to put it in programming mode, taking the yellow wire ( CEN ) and finding it on the GND wire. this connection has to be very fast, less than a second.
if it goes well the program starts to program the new firmware.


Creat File on Filesystem menu "autoexec.bat" and save comands:

startDriver TuyaMCU
setChannelType 1 toggle
linkTuyaMCUOutputToChannel 1 1 1

setChannelType 2 toggle
linkTuyaMCUOutputToChannel 2 1 2


Home Assistant Discovery configure:



mqtt:
  switch:
  - unique_id: "Interruptor_Quarto_Leonor_relay_1"
    name: "Interruptor_Quarto_Leonor 1"
    state_topic: "Luz_Quarto_Leonor/1/get"
    command_topic: "Luz_Quarto_Leonor/1/set"
    qos: 1
    payload_on: 1
    payload_off: 0
    retain: true
    availability:
      - topic: "Luz_Quarto_Leonor/connected"
  - unique_id: "Interruptor_Quarto_Leonor_relay_2"
    name: "Interruptor_Quarto_Leonor 2"
    state_topic: "Luz_Quarto_Leonor/2/get"
    command_topic: "Luz_Quarto_Leonor/2/set"
    qos: 1
    payload_on: 1
    payload_off: 0
    retain: true
    availability:
      - topic: "Luz_Quarto_Leonor/connected"

About Author
Ipn00tic wrote 17 posts with rating 6 . Been with us since 2020 year.

Comments

p.kaczmarek2 10 Dec 2022 23:34

EDIT: Thanks! I see the description is now updated and there is more information. my only question is - why is there both config for TuyaMCU and for normal IO-driven buttons and relays? https://obrazki.elektroda.pl/3608382300_1670758708_thumb.jpg... [Read more]

Ipn00tic 12 Dec 2022 12:44

I just saw an identical switch with this configuration on some forum, maybe here. I put all the configuration I saw and it worked for me. Now that you said that, I deleted the PIN's configuration and... [Read more]

p.kaczmarek2 12 Dec 2022 12:51

So it's TuyaMCU working and TuyaMCU config is correct, while, on the other hand, the Relay pins (non-TuyaMCU approach) is not needed here. [Read more]

Ipn00tic 08 Jan 2023 13:20

I have several double MOES switches, they appear in the identities but they don't appear as devices making integrations difficult. Mosquitto MQTT only adds in device format through automatic discovery... [Read more]

p.kaczmarek2 08 Jan 2023 14:39

Home Assistand Discovery does not currently support TuyaMCU devices, but certainly will in the future. @iprak , it seems it's worth to do it soon [Read more]

dominic2 22 Apr 2023 11:59

Hey, I realized that I flash this device differently. No need to solder! The pins that connect to the other half are working just fine: [-] | [-] [RX] | [-] [TX] | [3.3V] [-] | [GND] This... [Read more]

p.kaczmarek2 23 Apr 2023 03:23

Hmm it's good to know, and it worked well even with TuyaMCU on the board? I had troubles with flashing TuyaMCU devices in the past, I always had to remove the MCU or cut the traces. [Read more]

FAQ

TL;DR: 100 % success (3/3 units) in solder-less BK7231T flashing reported; “worked three times” proves reliability [Elektroda, dominic2, post #20550768] Why it matters: You save time and avoid risking pad damage when you know the exact pins and firmware combo.

Quick Facts

• MCU: Beken BK7231T on WB2S module [Elektroda, p.kaczmarek2, post #20328916] • Safe flashing voltage: 3.3 V for RX/TX power rail [Elektroda, dominic2, post #20550768] • Programming window: 15 s after power-up; CEN→GND pulse < 1 s [Elektroda, Ipn00tic, post #20328835] • Recommended tool: bk_writer v1.60 + OpenBK7231T v1.15.162 (≈507 kB) [Elektroda, Ipn00tic, post #20328835] • Home Assistant auto-discovery for TuyaMCU: not yet implemented [Elektroda, p.kaczmarek2, post #20374535]

What hardware sits inside the MOES 2-Gang wall switch?

The smart part is a WB2S Wi-Fi module with a Beken BK7231T SoC. Only six pins connect to the PCB: VBAT, GND, RX (P10), TX (P11), PWM4 (P24), PWM5 (P26) [Elektroda, p.kaczmarek2, post #20328916]

Can I flash without soldering the header?

Yes. Use the factory edge connector: RX | TX | 3.3 V | GND. Three users reported 100 % success with this no-solder method [Elektroda, dominic2, post #20550768]

Which software and firmware versions are proven to work?

bk_writer v1.60 and OpenBK7231T_UA_1.15.162.bin were used successfully in the forum guide [Elektroda, Ipn00tic, post #20328835]

How do I enter programming mode reliably?

  1. Power the board.
  2. Within 15 s, short CEN to GND for under one second.
  3. Start the write operation. If timing is right, programming begins immediately [Elektroda, Ipn00tic, post #20328835]

Is normal GPIO (relay) mapping required?

No. The switch uses an on-board TuyaMCU, so only TuyaMCU commands are needed. GPIO relay definitions can be deleted without changing behaviour [Elektroda, Ipn00tic, post #20330996]

What TuyaMCU script enables both gangs?


startDriver TuyaMCU
setChannelType 1 toggle
linkTuyaMCUOutputToChannel 1 1 1
setChannelType 2 toggle
linkTuyaMCUOutputToChannel 2 1 2
[Elektroda, Ipn00tic, post #20328835]

Why doesn’t Home Assistant auto-discover my flashed switch?

Current OpenBeken builds expose auto-discovery only for relay, PWM, or sensor drivers. TuyaMCU support is scheduled but not yet merged [Elektroda, p.kaczmarek2, post #20374535]

How do I add the switch to Home Assistant today?

Manually create MQTT switch entities. Example topics: Luz_Quarto_Leonor/1/get and /1/set, QoS 1, payload 1/0, retain true [Elektroda, Ipn00tic, post #20328835]

What power source should I use during flashing?

Feed the module with a stable 3.3 V rail from your USB-TTL adapter. Supplying 5 V directly risks SoC damage [Elektroda, dominic2, post #20550768]

What are common flashing failure cases?

Devices with a live TuyaMCU can hold the BK7231T in reset or pull UART lines low. Some users had to cut MCU traces on other boards “had to remove the MCU” [Elektroda, p.kaczmarek2, post #20551607]

Will future firmware versions support TuyaMCU discovery?

Yes. The maintainer confirmed that adding discovery is on the roadmap; priority was labelled “worth to do it soon” [Elektroda, p.kaczmarek2, post #20374535]

What MQTT availability topic should I use?

Publish connected state to <base_topic>/connected to track online status. Home Assistant will treat any payload as ‘online’ when received [Elektroda, Ipn00tic, post #20328835]
Generated by the language model.
%}