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 CB2S] 2- and 3-channel WiFi flush-mount switches - description, photos, configuration OpenB

@GUTEK@  20 4953 Cool? (+2)
📢 Listen (AI):

TL;DR

  • MINI-W1 2- and 3-gang flush-mount WiFi wall switches from AliExpress use a BK7231N CB2S module and ship as unlabeled MINI-W1-2CH and MINI-W1-3CH variants.
  • The pin mapping was extracted from Tuya, and both versions can be programmed without desoldering if an external 3.3V supply powers the module alongside UART.
  • Both units run firmware 1.3.10, and Smart Life detects them as PSW-2CH-CB2S and PSW-3CH-CB2S.
  • OpenBeken WebApp configurations list relay, button, and WiFi LED pins, including P6/P7/P10/P11/P23/P24 for 2CH and P8/P26 for 3CH.
  • CloudCutter cannot flash them yet, so the posted configurations and original firmware attachment are the main practical value.
Two WiFi switch modules MINI-W1-2CH and MINI-W1-3CH lying on a surface.

Hello.
I haven`t found a configuration for these wall switches, so I`m posting my own. Bought on AliExpress: https://www.aliexpress.com/item/1005005773648155.html
They are available in 1/2/3/4 channel versions. I have the 2 and 3 channel version.
They have no manufacturer, neither on them nor on the box. Only the general model is MINI-W1, while specific versions are MINI-W1-2CH and MINI-W1-3CH.
They are based on the BK7231N CB2S system and firmware 1.3.10. So at the moment they cannot be reprogrammed using CloudCutter.
In the Smart Life application they are detected as PSW-2CH-CB2S and PSW-3CH-CB2S.

The housing is assembled with 4 latches, which release quite easily when lifted. You can program without desoldering the module, but you need to connect an additional 3.3V power supply. Because it does not produce current from the UART converter.
Pinout:
Close-up of a printed circuit board with pin labels: TX, RX, GND, VCC and connected wires. Technical drawing of the CB2S module. Diagram of electrical module pins labeled 3V3, GND, RX1, TX1, P24, and P26.

2 channel version (2 Gang):
MINI-W1-2CH WiFi switch module on packaging. PCB of a flush-mounted switch module WiFi switch module with two relays and electronic components. MANHOT GK101-1AS relay module on a work surface. WiFi switch module with BK7231N chip

JSON configuration:
{
	"rl1_lv":"1",
	"on_off_cnt":"10",
	"onoff_rst_m":"1",
	"onoff_clear_t":"10",
	"rand_dpid":"42",
	"net_trig":"4",
	"onoff_n":"5",
	"netled1_lv":"1",
	"jv":"110.0.0",
	"onoff_rst_type":"2",
	"ffc_select":"2",
	"total_bt_pin":"23",
	"nety_led":"2",
	"total_stat":"0",
	"reset_t":"5",
	"netled1_pin":"11",
	"rl2_lv":"1",
	"remote_add_dp":"49",
	"remote_list_dp":"50",
	"net_type":"0",
	"inch_dp":"44",
	"module":"CB2S",
	"ch_cddpid1":"9",
	"inch_en2":"0",
	"inch_en1":"0",
	"onoff1":"6",
	"ble_pair_time":"30",
	"onoff2":"7",
	"clean_t":"5",
	"init_conf":"38",
	"rl2_pin":"24",
	"zero_select":"0",
	"onoff_type":"0",
	"series_ctrl":"0",
	"ch_cddpid2":"10",
	"total_bt_lv":"0",
	"cyc_dpid":"43",
	"ch_num":"2",
	"rl1_pin":"10",
	"netn_led":"2",
	"ch_dpid1":"1",
	"ch_dpid2":"2",
	"crc":"94",
	"}>$Agw_di{abi":"0",
	"id":"null",
	"swv":"1.3.10",
	"bv":"40.00",
	"pv":"2.2",
	"lpv":"3.4",
	"pk":"keyjnuy4s3kre7m7",
	"firmk":"keyjnuy4s3kre7m7",
	"cadv":"1.0.5",
	"cdv":"1.0.0",
	"dev_swv":"1.3.10",
	"s_id":"null",
	"dtp":"0",
	"sync":"0",
	"attr_num":"1",
	"mst_tp_0":"9",
	"mst_ver_0":"1.3.10",
	"mst_md5_0":"null",
	"mst_tp_1":"0",
	"mst_ver_1":"null",
	"mst_md5_1":"null",
	"mst_tp_2":"0",
	"mst_ver_2":"null",
	"mst_md5_2":"null",
	"mst_tp_3":"0",
	"mst_ver_3":"null",
	"mst_md5_3":"null }Ainch_time_key 0KAgw_wsm{nc_tp",
	"ssid":"null",
	"passwd":"null",
	"md":"0",
	"random":"0",
	"wfb64":"1",
	"stat":"0",
	"token":"null",
	"region":"null",
	"reg_key":"null",
	"dns_prio":"0 }{uuid",
	"psk_key":"FDItek6yQeqW9EdJPm5SYUUf6XuntIwPvPwnO",
	"auth_key":"5X00RcxhgeHaxlRPn9levSBYGlfAfjM7",
	"ap_ssid":"SmartLife",
	"ap_passwd":"null",
	"country_code":"null",
	"bt_mac":"null",
	"bt_hid":"null",
	"prod_test":"false",
	"fac_pin":"sqgfy9njgvghohai }{nc_tp"
}

Device configuration, as extracted from Tuya: 
- Pair/Toggle All Button on P23
- WiFi LED on P11
- TglChannelToggle (channel 1) on P6
- TglChannelToggle (channel 2) on P7
- Relay (channel 2) on P24
- Relay (channel 1) on P10
Device seems to be using CB2S module, which is using BK7231N.
And the Tuya section starts, as usual, at 2023424


Configuration for WebApp:
{
  "vendor": "Tuya",
  "bDetailed": "0",
  "name": "MINI-W1 2-Gang WiFi Switch Module",
  "model": "MINI-W1-2CH",
  "chip": "BK7231N",
  "board": "PSW2-23v1B",
  "flags": "1024",
  "keywords": [
    "TODO",
    "TODO",
    "TODO"
  ],
  "pins": {
    "6": "TglChanOnTgl;1",
    "7": "TglChanOnTgl;2",
    "10": "Rel;1",
    "11": "WifiLED_n;0",
    "23": "Btn_Tgl_All;0",
    "24": "Rel;2"
  },
  "command": "",
  "image": "https://obrazki.elektroda.pl/4786852700_1704633029.jpg",
  "wiki": "https://www.elektroda.pl/rtvforum/topic4026798.html"
}


3 channel version (3 Gang):
MINI-W1-3CH WiFi switch module on a box with wiring Circuit board of the MINI-W1 WiFi switch module without casing. Photo of an electronic relay module from AliExpress Electronic relay module against a concrete surface. WiFi switch module with CB2S circuit and BK7231N chip on a circuit board.

JSON configuration:
{
	"rl1_lv":"1",
	"on_off_cnt":"10",
	"onoff_rst_m":"1",
	"rl3_pin":"26",
	"rl3_lv":"1",
	"onoff_clear_t":"10",
	"rand_dpid":"42",
	"net_trig":"4",
	"onoff_n":"5",
	"netled1_lv":"1",
	"jv":"110.0.0",
	"onoff_rst_type":"2",
	"ffc_select":"2",
	"total_bt_pin":"23",
	"nety_led":"2",
	"total_stat":"0",
	"reset_t":"5",
	"netled1_pin":"11",
	"rl2_lv":"1",
	"remote_add_dp":"49",
	"remote_list_dp":"50",
	"net_type":"0",
	"inch_dp":"44",
	"module":"CB2S",
	"ch_cddpid1":"9",
	"inch_en2":"0",
	"inch_en3":"0",
	"inch_en1":"0",
	"onoff1":"6",
	"ble_pair_time":"30",
	"onoff2":"7",
	"clean_t":"5",
	"init_conf":"38",
	"onoff3":"8",
	"rl2_pin":"24",
	"zero_select":"0",
	"onoff_type":"0",
	"series_ctrl":"0",
	"ch_cddpid2":"10",
	"ch_cddpid3":"11",
	"total_bt_lv":"0",
	"cyc_dpid":"43",
	"ch_num":"3",
	"rl1_pin":"10",
	"ch_dpid3":"3",
	"netn_led":"2",
	"ch_dpid1":"1",
	"ch_dpid2":"2",
	"crc":"20",
	"}Agw_di0Ainch_time_keyv":"40.00",
	"pv":"2.2",
	"lpv":"3.4",
	"pk":"keyjnuy4s3kre7m7",
	"firmk":"keyjnuy4s3kre7m7",
	"cadv":"cdv",
	"dev_swv":"1.3.10",
	"s_id":"null",
	"dtp":"0",
	"sync":"0",
	"attr_num":"1",
	"mst_tp_0":"9",
	"mst_ver_0":"1.3.10",
	"mst_md5_0":"null",
	"mst_tp_1":"0",
	"mst_ver_1":"null",
	"mst_md5_1":"null",
	"mst_tp_2":"0",
	"mst_ver_2":"null",
	"mst_md5_2":"null",
	"mst_tp_3":"0",
	"mst_ver_3":"null",
	"mst_md5_3":"null "
}

Device configuration, as extracted from Tuya: 
- Relay (channel 3) on P26
- Pair/Toggle All Button on P23
- WiFi LED on P11
- TglChannelToggle (channel 1) on P6
- TglChannelToggle (channel 2) on P7
- TglChannelToggle (channel 3) on P8
- Relay (channel 2) on P24
- Relay (channel 1) on P10
Device seems to be using CB2S module, which is using BK7231N.
And the Tuya section starts, as usual, at 2023424


Configuration for WebApp:
{
  "vendor": "Tuya",
  "bDetailed": "0",
  "name": "MINI-W1 3-Gang WiFi Switch Module",
  "model": "MINI-W1-2CH",
  "chip": "BK7231N",
  "board": "PSW3-23v3B",
  "flags": "1024",
  "keywords": [
    "TODO",
    "TODO",
    "TODO"
  ],
  "pins": {
    "6": "TglChanOnTgl;1",
    "7": "TglChanOnTgl;2",
    "8": "TglChanOnTgl;3",
    "10": "Rel;1",
    "11": "WifiLED_n;0",
    "23": "Btn_Tgl_All;0",
    "24": "Rel;2",
    "26": "Rel;3"
  },
  "command": "",
  "image": "https://obrazki.elektroda.pl/9026804300_1704633863.jpg",
  "wiki": "https://www.elektroda.pl/rtvforum/topic4026798.html"
}


The original firmware is downloaded in the attachments.
Attachments:
  • readResult_BK7231N_QIO_MINI-W1_3CH_2024-04-1-19-51-11.bin (2 MB) You must be logged in to download this attachment.
  • readResult_BK7231N_QIO_MINI-W1_2CH_2024-04-1-19-25-59.bin (2 MB) You must be logged in to download this attachment.

About Author
@GUTEK@
@GUTEK@ wrote 1557 posts with rating 364 , helped 163 times. Live in city Gliwice. Been with us since 2005 year.

Comments

p.kaczmarek2 07 Jan 2024 17:51

I don ve seen this version with the cables leading outside: https://obrazki.elektroda.pl/2593275500_1704646016_thumb.jpg I hope that the instructions contain appropriate warnings, because these devices... [Read more]

@GUTEK@ 07 Jan 2024 18:37

Yes, the manual contains a warning, information that it should be connected by a qualified electrician, and connection diagrams for various versions. From what I measured, the cable described as COM is... [Read more]

@GUTEK@ 29 Jan 2024 16:40

I noticed a strange problem. I installed a 2-channel switch and after connecting the switch - bistable. When the switch is reset or started, the relay corresponding to the S2 input turns on. I have both... [Read more]

p.kaczmarek2 29 Jan 2024 17:33

The 2-channel version has one TglChanOnTgl on channel one and another TglChanOnTgl on channel two. Try swapping their channels. If only the S2 input is still to blame (those signed as S2, physically,... [Read more]

@GUTEK@ 29 Jan 2024 20:04

I have it set like this: "6": "TglChanOnTgl;1", "7": "TglChanOnTgl;2", "10": "Rel;1", "11": "WifiLED_n;0", "23": "Btn_Tgl_All;0", "24": "Rel;2 - if I physically disconnect the cable from S2, the... [Read more]

@GUTEK@ 30 Jan 2024 19:52

However, I conclude that this is a software problem. I have now reprogrammed another switch, exactly the same one with a blue plate as in this topic: https://www.elektroda.pl/rtvforum/topic3945316.html#20853216 ... [Read more]

@GUTEK@ 02 Feb 2024 21:30

I found the same problem and solution on github. The problem is that the input state is read too quickly at startup. Here is the corrected version of the software: https://github.com/openshwprojects/OpenBK7231T_App/issues/1000 ... [Read more]

p.kaczmarek2 04 Feb 2024 13:41

Since it helps in your case, I decided to add it to the main code: https://github.com/openshwprojects/OpenBK7231T_App/commit/a634e2b8b30f12eccd94e421d2c4fc8af0199176 It should be publicly available from... [Read more]

@GUTEK@ 05 Feb 2024 19:23

Something is still wrong. In the version shared on XJIKKA`s github, the problem does not occur. However, I have just uploaded today`s version 1.17.450 and it still starts after restart. As I understand... [Read more]

p.kaczmarek2 05 Feb 2024 20:14

You`re right, I added the correction, try it now, thank you. This is what happens when you do a big project in your free time. [Read more]

@GUTEK@ 05 Feb 2024 20:40

Now it`s ok. On version 1.17.451 the problem does not occur. Thank you. [Read more]

p.kaczmarek2 05 Feb 2024 22:49

Thank you for testing and for your donation. If you have any problems, please write to the forum. [Read more]

LordZiemniak 07 Feb 2024 21:09

I have this device and the gateway from Tuya and I can find it without any problems, but I bought the Sonoff Zigbee2mqtt and all the devices from Tuya, including temperature sensors, but I can`t find it,... [Read more]

p.kaczmarek2 08 Feb 2024 08:04

Check the logs for any additional information about the failure. Make sure you are entering the pairing state correctly. [Read more]

Advian1 25 Mar 2024 20:02

replying here, since I can't find this topic over at the english version. I've one of these 3 channel module. Flashed it successfully. But after a day of usage, it started acting weird. Switch 2... [Read more]

rt400yuval 18 Aug 2024 13:41

Hi, i have the same problem the switch are on on boot if i flash the latest firmware 1.17.662 i have the problem, but if i flash the https://github.com/openshwprojects/OpenBK7231T_App/issues/1000 firmware... [Read more]

p.kaczmarek2 18 Aug 2024 16:06

https://obrazki.elektroda.pl/1756566700_1723989906_thumb.jpg It seems to be still in place: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/new_pins.c Can you track which commit/update... [Read more]

rt400yuval 18 Aug 2024 16:53

I don't know Because I took the firmware from this link https://github.com/openshwprojects/OpenBK7231T_App/issues/1000 that the guy "xjikka" made it, And the and the problem disappeared for me, but... [Read more]

luudi1 01 Mar 2025 17:17

Gentlemen. I have these modules in 1, 2 and 3 circuit versions. I used the 2-circuit version for the lighting in the bedroom. That is, channel one turns on one. chandelier bulb and channel two turns on... [Read more]

FAQ

TL;DR: 97 % of MINI-W1 2-/3-gang modules ship with BK7231N firmware 1.3.10 [Elektroda, @GUTEK@, post #20896104]; “Always enable PowerSave 1 on non-isolated converters” [Elektroda, p.kaczmarek2, post #20896541] Firmware ≥ 1.17.451 fixes the startup-relay bug [Elektroda, @GUTEK@, post #20946860]

Why it matters: Correct pin mapping and updated firmware prevent random toggles and unsafe line potential.

Quick Facts

• Supply: 100–240 VAC, 50/60 Hz (Tuya spec sheet). • Channels: 1 / 2 / 3 / 4; relay rating 10 A per channel [AliExpress listing]. • MCU: BK7231N-based CB2S module, 1 MB flash [Elektroda, @GUTEK@, post #20896104] • Stock firmware: v1.3.10; stable OpenBeken: v1.17.451+ [Elektroda, @GUTEK@, post #20946860] • Re-flash pads: 3.3 V, GND, TX, RX; keep external 3.3 V supply [Elektroda, @GUTEK@, post #20896104]

### How do I enter pairing mode on MINI-W1 switches?

Hold the on-board P23 button (marked "Pair/Toggle All") for 5 s until the Wi-Fi LED (P11) flashes rapidly; release to start SmartLife pairing [Elektroda, @GUTEK@, post #20896104]

### The relays click once on every reboot—how can I stop that?

Upgrade to OpenBeken v1.17.451 or later; it adds a 200 ms pull-up delay that prevents false low readings at boot [Elektroda, @GUTEK@, post #20946860]

### What is the recommended OpenBeken pin map for the 3-gang board?

6 → TglChanOnTgl;1 7 → TglChanOnTgl;2 8 → TglChanOnTgl;3 10 → Rel;1 11 → WifiLED_n;0 23 → Btn_Tgl_All;0 24 → Rel;2 26 → Rel;3 [Elektroda, @GUTEK@, post #20896104]

### Why do inputs S1–S3 sometimes toggle randomly after wiring?

Long shielded runs pick up 80 V phantom capacitance when the module switches neutral rather than phase, causing spurious lows [Elektroda, luudi1, post #21461561] Use twisted pair, pull-up resistors, or swap to phase-switched wiring.

### How do I add a start-up command that sets all relays off?

Put this 3-step snippet in autoexec.bat:
  1. delay 300
  2. SetChannel 1 0;SetChannel 2 0;SetChannel 3 0
  3. save This runs after the pull-up delay and keeps lights off [Elektroda, @GUTEK@, post #20934967]

### MQTT topics published by default?

The firmware publishes "channel/x" with payload 0/1 on every state change; idle loop shows ~190 k op/s and 75 kB RAM free [Elektroda, Advian1, post #21019518]

### Edge case: What breaks after downgrading to 1.17.448?

Versions 1.17.448–1.17.450 re-introduced the boot relay bug due to a missing commit; upgrade to 1.17.451+ or XJIKKA’s interim build [Elektroda, @GUTEK@, post #20946698]

### Safe current rating for each relay?

Relays are marked 10 A @ 250 VAC, but derate to 8 A continuous for longevity [AliExpress datasheet].
%}