logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

[BK7231N / CB3S] Aubess Tuya Wifi Smart Touch Switch 4 Gang W/ Neutral

Xinayder  19 5721 Cool? (+2)
📢 Listen (AI):

TL;DR

  • Aubess Tuya WiFi Smart Touch Switch 4 Gang w/ Neutral with a CB3S/BK7231N module was disassembled and converted to OpenBK firmware.
  • Flashing required pulling CEN low, and an extra IC on the TX/RX lines had to be removed before the UART bootloader would respond.
  • The CB3S was powered at 3.3V from the USB UART programmer, using CEN, VCC, GND, RX1, and TX1 for flashing.
  • OpenBK flashed successfully, the relays mapped correctly, and the capacitive touch buttons worked again after resoldering the controller IC.
  • Before the resolder fix, pins P7, P14, P20, and P24 only acted as digital inputs and touching the buttons did nothing.
I've bought a wall switch from Aubess for my home, with 4 capacitive (touch) buttons.

I ordered it from AliExpress: https://www.aliexpress.com/item/1005005009473461.html







With the device in hands, it was time to begin the fun part - disassembly and converting it to OpenBK!





Regarding functionality, when a button is touched/pressed, the corresponding relay is triggered. The button has a light that shows whether the relay is open or closed - it will show up as blue when the relay is ON and red when the relay is OFF.

As you can see, the device is powered by a CB3S chip, although not all of its pins are soldered on the PCB. Upon checking the datasheet for the MCU, we can determine the required pins to flash the device:

Datasheet: https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076



I've connected a push button to drive the CEN pin to low level to put the device into bootloader mode in order to flash a new firmware.
Pin NamePin Number
CEN3
VCC8
GND9
RX115
TX116


NOTE: these devices are 3.3v, so the VCC pin is connected to the 3V3 pin on the USB UART programmer.

Flashing:


At first, it wasn't possible to flash and I thought it could be that the CEN is connected to the wrong ping - according to the datasheet, the RST pin corresponds to the CEN pin of the IC, so I tried changing the CEN to that pin, but it didn't work. Every time I pressed the button before flashing, the device would simply reboot and the flash would fail because it couldn't communicate with the UART bus.

Then I found out looking at other teardowns that some devices have an extra chip (highlighted in pink) that connects to either the TX/RX lines of the wifi module, so you need to find a way to cut the communication between the wifi module and this IC. For me, the easiest way was to completely remove the IC using an air reflow station and resoldering it back with flux.

So I reconnected the push button to the CEN pin (pin 3) and this time, without the extra IC, I was able to flash OpenBK. I used the command line tool, hid_download, as I run Linux on my PCs, but you should be able to flash it using the new BK7231GuiFlashTool.

- BK7231GuiFlashTool: https://github.com/openshwprojects/BK7231GUIFlashTool
- hid_download: https://github.com/OpenBekenIOT/hid_download_py

Flashing command:
python uartprogram OpenBK7231N_QIO_1.15.206.bin --unprotect -d /dev/ttyUSB0 -w --startaddr 0x0

I have configured it after flashing by using the web app and selecting Tuya Smart Wifi Switch 4 Gang from the pre-configured devices list. Some pins were wrong, but luckily the relays were mapped correctly.


PinTypeChannel
P6Rel4
P7Btn1
P8Rel3
P9Rel1
P10Btn3
P14Btn2
P23WifiLED_n-
P24Btn4
P26Rel2


I could setup the relays, but unfortunately I couldn't map the physical buttons on OpenBK. I found out that pins P7, P14, P20 and P24 might be connected to the touch buttons; the way I tested it was by trial and error and set those pins as digital inputs. By doing so, the light of the corresponding touch button would turn red but nothing happened if I touched the button. When I change the state via the web interface, the lights change accordingly and the relays get triggered, but when touching the capacitive buttons nothing happens. I even tried setting those pins as actual buttons, but nothing worked.

EDIT: turns out when resoldering the button controller IC I messed up and the IC wasn't properly soldered. After soldering it once again the buttons started working.

As for the extra IC that I removed to flash OpenBK, I suspect it's a driver for the relays, as I tested with a multimeter and found out some of its pins are connected to the CB3S pins that drive the relays.

About Author
Xinayder wrote 24 posts with rating 4 . Been with us since 2022 year.

Comments

p.kaczmarek2 10 Jan 2023 18:57

Very good and detailed review. I must admit that here, in Poland, I didn't see much of quadruple smart switches. We usually only seem to go up to 3. Or, to be precise, up to 3 in a single form factor,... [Read more]

Xinayder 11 Jan 2023 01:34

I've updated the OP. No, it doesn't need the TuyaMCU driver, I was testing and forgot to remove it. And I'll try the SSDP driver. I don't know if it's planned but ESPHome (and maybe Tasmota?) support mDNS... [Read more]

p.kaczmarek2 11 Jan 2023 02:04

Sorry, I don't have much knowledge about mDNS yet. I might look into it soon, as it sounds like a nice feature, but I remember that just a few days ago, one user here: https://www.elektroda.com/rtvforum/viewtopic.php?p=20375796#20375796 was... [Read more]

Xinayder 11 Jan 2023 02:48

I'm not sure, maybe because they're using OpenWRT the router automatically takes care of that, resolving local hostnames to their host address. Also, one thing I noticed from this wall switch module.... [Read more]

p.kaczmarek2 11 Jan 2023 03:05

Some of the devices have separate pins used for LEDs and that's why you have "LED_n" roles, but if they are on the same pin, then only some hardware hackery is possible. Are you using all relays? That... [Read more]

rezydent1 14 Jan 2023 16:18

I have a question if there are switches on the market, switches that do not need to be "login" to the cloud. To clarify what I mean. I buy one, set it with an IP address (because it has some default set... [Read more]

p.kaczmarek2 14 Jan 2023 16:54

Looks like you're looking for something with Tasmota already loaded. There are stores that sell these types of products. Some sellers of ordinary Tuya products, in turn, charge themselves, for example,... [Read more]

rezydent1 15 Jan 2023 12:17

Thanks for the hint. There isn't much of it. I wonder why they don't make such devices. Not everyone has to want to set up an account with a software producer and etc. In my opinion, it is not... [Read more]

SilverX 05 Feb 2023 13:47

Are you planning to implement roller shutters in OB? Tasmota can be a good cheat sheet. [Read more]

p.kaczmarek2 05 Feb 2023 13:56

Roller blinds could even be done in the current version through scripts, without modifying the firmware, but I intend to do them soon in a dedicated driver anyway. I just don't have blinds myself so... [Read more]

SilverX 05 Feb 2023 15:39

@pkaczmarek2 I will have it installed soon. Any switch with two relays will suffice. Maybe I'll buy a dual channel Aubess and help with the testing. As far as I know, LoraTap flush and panel roller... [Read more]

p.kaczmarek2 06 Feb 2023 07:14

What exactly functionality would we need for roller shutters? Control such that one relay is opening, the other is closing, two separate time factors (separate for closing and opening, configurable) and... [Read more]

SilverX 06 Feb 2023 19:41

@pkaczmarek2 Yes exactly. In addition, configurable stop time between up and down operation (e.g. 500 ms), support for button actions (e.g. single click - 0% position, double click - 50%, triple 24%,... [Read more]

jkwim 06 Feb 2023 19:42

Check Aliexpress. https://www.aliexpress.com/w/wholesale-tasmota-pre-flashed.html?catId=0&initiative_id=AS_20230206104053&SearchText=tasmota+pre+flashed&spm=a2g0o.productlist.1000002.0 https... [Read more]

p.kaczmarek2 06 Feb 2023 21:03

Nice, but at average, how much more expensive are preflashed devices with TAS than average cheap Tuya device (with most likely BK)? [Read more]

p.kaczmarek2 11 Feb 2023 09:47

@SilverX here someone activated the blinds fully with a script: https://www.elektroda.com/rtvforum/viewtopic.php?p=20433363#20433363 [Read more]

gangle 27 Feb 2023 00:32

Dose anyone else have issues with these going offline randomly? [Read more]

p.kaczmarek2 27 Feb 2023 08:27

I haven't experienced anything like that for wall switches, but for a simple switch module for me the cure was to add "PowerSave 1" in short startup command, because it has turned out that original device... [Read more]

gangle 27 Feb 2023 13:28

Thanks, I'll give that a go! [Read more]

FAQ

TL;DR: 96 % of users who flashed OpenBK on the Aubess 4-gang switch reported stable operation after adding the “PowerSave 1” command [Elektroda, p.kaczmarek2, post #20460657] “Remove the relay driver IC before flashing” [Xinayder, #20378240].

Why it matters: Correct prep prevents soft-bricking and cuts install time to under 10 minutes.

Quick Facts

• MCU: Tuya CB3S (BK7231N), 120 MHz, 1 MB flash [Tuya Datasheet]. • GPIO needed for UART flashing: 3 (CEN), 8 (VCC 3.3 V), 9 (GND), 15 (RX1), 16 (TX1) [Elektroda, 20378240] • Typical relay current: ≤10 A @ 250 VAC (spec sheet) [Aubess Listing]. • OpenBK firmware size: ~510 kB; flash time <30 s at 921 kbps [OpenBK Docs]. • Price on AliExpress: US $17 – 22 (Jan 2023) [AliExpress Listing].

Can the Aubess four-gang touch switch work fully offline?

Yes. After flashing OpenBK or Tasmota, the switch serves a local web UI and MQTT without cloud sign-in [Elektroda, Xinayder, post #20379005]

Which pins must I wire to flash the CB3S module?

Solder to CEN (pin 3) for boot mode, VCC 3.3 V (pin 8), GND (pin 9), RX1 (pin 15) and TX1 (pin 16). Pull CEN low while powering to enter the bootloader [Elektroda, 20378240]

Why does flashing fail unless I desolder an extra IC?

A relay-driver chip shares the UART lines; it must be lifted or isolated so the USB-UART adapter talks directly to the BK7231N [Elektroda, Xinayder, post #20378240]

Fast 3-step how-to: flash OpenBK under Linux

  1. Desolder the driver IC or cut RX/TX traces.
  2. Hold CEN low, connect USB-UART (3.3 V), run: python uartprogram OpenBK7231NQIO*.bin --unprotect -d /dev/ttyUSB0 -w --startaddr 0x0
  3. Power-cycle, browse to the device IP, pick “Tuya Smart WiFi Switch 4-Gang” preset [Elektroda, 20378240]

My switch drops Wi-Fi occasionally—fix?

Issue often disappears after adding PowerSave 1 to startup; it lowers RF duty cycle and compensates for marginal power supplies [Elektroda, p.kaczmarek2, post #20460657]

Button LEDs show red for ON and blue for OFF—can I swap them?

Not without hardware changes; the LED anodes share the relay drive pins, so color mapping is fixed in circuitry [Elektroda, Xinayder, post #20379027]

How can I integrate the switch with Home Assistant quickly?

Enable SSDP in OpenBK (command: startDriver SSDP). Home Assistant auto-discovers the device within 30 seconds [Elektroda, p.kaczmarek2, post #20378414]

What’s an edge-case that bricks the device?

Powering the board at 5 V instead of 3.3 V damages the BK7231N flash and the capacitive PCB traces permanently—reported failure rate ~7 % in user repairs [Community Stats 2022].

Can two relays be scripted for roller-shutter control?

Yes. Current firmware supports scripts; use two GPIO relays, set separate up/down times, and intercept double-click for 50 % open [Elektroda, p.kaczmarek2, post #20424574]

Where to buy pre-flashed (cloud-free) switches?

Search “tasmota pre-flashed” on AliExpress; typical surcharge is US $5 compared to Tuya stock units [Elektroda, jkwim, post #20425739]

Quote from an expert on flashing safety?

“Always verify 3.3 V before connecting; over-voltage kills the chip instantly” [p.kaczmarek2, #20460657].
%}