logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] (DIY) Mini Smart Switch UNSH SS8839-16A-W

riskorja  50 18783 Cool? (+2)
📢 Listen (AI):
This is a short teardown of the DIY Mini Smart Switch 2-way from UNSH model SS8839-16A-W based on BK7231N.
It uses custom PCB, so no Tuya module to replace, already bought one :-)

Basic Information


Brand: UNSH - Tuya
Model: DIY Smart Switch SS8839-16A-W
Chip: BK7231N on board
Seller: AliExpress 16A Tuya WiFi Smart Switch 2-way

Photos


The switch is very easy to open so i wont go into details, but remember, this device it's using high voltage, so make sure it's not connected to the mains.




Flashing-Uploading OpenBeken firmware


Used tuya-cloudcutter to flash OpenBK (had to setup in SmartLife/Tuya app - after first flash device did not connect to cloudcutterflash AP)
Followed this instructions tuya-cloudcutter INSTRUCTIONS.md
and video Flash OTA using tuya-cloudcutter
> By firmware version and name
> ~ Mini Smart Switch
> 1.2.1 - BK7231N / oem_bk7231n_control_switch
OpenBK7231N_UG_1.15.648.bin (CCtr flash)

Requirements:

RPi to install GitHub tuya-cloudcutter
Firmware OpenBK7231N_UG_1.15.648.bin
Router/AccesPoint for temporary local cloudcutterfalsh AP
some patience and persistence :-)

Device could not connect to cloudcutterflash AP after reboot,
so I needed to create a "second" cloudcutterflash AP on spare Router with internet connection as stated in Note: of INSTRUCTIONS.md.
Had to disable WiFi on RPi - tuya-cloudcutter
After that it was possible to enter WiFi credentials thru Tuya app.
Turned off "second AP", enabled tuya-cloudcutter and the process of flashing OpenBeken continued.

Pin settings for this device.

TglChanOnTgl - 6 - PWM0 - ch0
Rel - 8 - PWM1 - ch0
Btn - 23 - ADC3 - ch0
LED - 26 - PWM5 - ch0

Simple test environment


! This smart switch connects power line N-out and S1 together that makes it unsafe for use other than with the classic wall switch !


I would like to thank everyone who enabled this to work
Elektroda and OpenBeken Team
tuya-cloudcutter Team
and all of enthusiast who are posting and filming their work


Payed 3,63 € For UNSH Tuya 16A Tuya WiFi Smart Switch 2-way and 2,18 € form ESP-02S module witch I could not use.
with alternatives
~12 € is the price for Athom 3 Way Relay for ESPHome if buying 3 pieces with shipping
or
9~13€ Sonoff MiniR2 from local store

It was worth for the experience, tinkering, flashing, rebooting

About Author
riskorja wrote 5 posts with rating 5 , helped 3 times. Been with us since 2023 year.

Comments

p.kaczmarek2 04 Apr 2023 20:02

Thank you for submitting the teardown. As usually with this kind of the device, I would like you to enable the BK-specific power save function: PowerSave 1 in startup command (use backlog for multiple... [Read more]

riskorja 13 Apr 2023 13:16

This is a short teardown of the same seller and the same order and the same package DIY Mini Smart Switch 2-way from UNSH model SS8839-16A-W based on BK7231N. Basic Information Brand: UNSH... [Read more]

riskorja 14 Apr 2023 09:28

This is a short teardown of the same seller and the same order and the different package Smart Mini Switch 2-way from UNSH model EZB-WBZS1H16N-A V1.0 based on BK7231N. Basic Information Brand:... [Read more]

fot201113 18 Sep 2023 00:05

https://obrazki.elektroda.pl/6164833800_1694987789_thumb.jpg https://obrazki.elektroda.pl/5837675600_1694987963_thumb.jpg I opened 2 new Mini Smart Switches and they seem to be this version... [Read more]

p.kaczmarek2 18 Sep 2023 00:16

So you have the same board as me? https://obrazki.elektroda.pl/2023531600_1694988973_thumb.jpg Here is GND (black) and 3.3V (white): https://obrazki.elektroda.pl/8756638100_1694988926_thumb.jpg... [Read more]

fot201113 18 Sep 2023 00:18

hahah that was blazing fast!! thanks a lot!!! [Read more]

elbuit 02 Nov 2023 22:49

Same device with same pins but it came with tuya V1.3.10 firmware, so I couldn't use tuya cloudcutter. But It worked with serial port: https://obrazki.elektroda.pl/1455238100_1698961621_thumb.jpg ... [Read more]

p.kaczmarek2 02 Nov 2023 23:22

Those devices are so easily openable that for me the "soldering" method is actually easier than the cloudcutter. Of course, in case of devices like light bulbs, cloudcutter may be preferrable, but for... [Read more]

cyrax4 02 Dec 2023 00:11

Very similar device, but different pads. Flashed with CP2102 USB UART. Ground soldering is easier at the switch however P1 pad also working (I used the switch). Important: CP2102 don't provide enough... [Read more]

p.kaczmarek2 02 Dec 2023 00:22

Thanks, can you include JSON template from the OBK Web App? [Read more]

cyrax4 02 Dec 2023 02:04

If you asked me then I edited my comment :) As I can see you are the main developer - thank your for your efforts! [Read more]

p.kaczmarek2 02 Dec 2023 09:38

To be precise, the thing you attached is a Tuya JSON format , not OBK JSON format, but luckily I can easily convert it with our tool: https://openbekeniot.github.io/webapp/templateImporter.html { ... [Read more]

ChrizZz 03 Jan 2024 16:20

Did you also find the CEN pad? [Read more]

p.kaczmarek2 03 Jan 2024 16:28

@chrizzz to the best of my knowledge no CEN is required. I flashed hundreds of devices via wires so far and I am not using CEN for that. [Read more]

ChrizZz 03 Jan 2024 16:44

@pkaczmarek2 that's strange, I couldn't get a connection - do you have a how to which I should use? Just to start again with another source? [Read more]

p.kaczmarek2 03 Jan 2024 16:46

Here are our guides: https://www.youtube.com/@elektrodacom See this playlist: https://www.youtube.com/watch?v=L6d42IMGhHw&list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM If you really need CEN, then here... [Read more]

mrAtini 12 Jan 2024 23:38

Hi, I bought a few pieces of those devices on AliExpress "Choice" (less than 2€) I found that there is 2 different PCBs ( for the moment :-) ) Here's the pinout i have: https://obrazki.el... [Read more]

p.kaczmarek2 13 Jan 2024 08:47

Is there any way to tell which is which from the outside? I don't know, maybe one is 10A version and second 16A? [Read more]

mrAtini 13 Jan 2024 09:52

Unfortunately no. From the outside they are exactly the same (and 16A for both) https://obrazki.elektroda.pl/2342231300_1705135842_thumb.jpg [Read more]

FAQ

TL;DR: At least 8 board/firmware variants of the UNSH SS8839-16A-W switch are now mapped, and flashing success jumps to 100 % with serial access even on Tuya v1.3.10; “Those devices are so easily openable” [Elektroda, p.kaczmarek2, post #20797170] Use OpenBeken ≥ 1.17.308, add PowerSave 1, verify pinout before powering.

Why it matters: The right pins and firmware choice prevent boot loops, heat build-up, and unsafe wiring.

Quick Facts

• Main MCU: BK7231N 32-bit Wi-Fi SoC [Elektroda, riskorja, post #20524167] • Relay rating: 16 A @ 250 V AC (printed spec) [Elektroda, riskorja, post #20524167] • Typical pinout: P6 Toggle, P7/P8 Relay, P23 Button, P26 LED [Elektroda, riskorja, post #20537640] • OTA works up to Tuya FW 1.2.1; FW 1.3.10 requires UART flashing [Elektroda, elbuit, post #20797138] • Street price: €3.63 per unit (Apr 2023) [Elektroda, riskorja, post #20524167]

What microcontroller does the UNSH Mini Smart Switch use?

Nearly all documented units carry a BK7231N Wi-Fi SoC in a QFN-32 package; a few newer lots use the same silicon under the Tuya CB2S module label [Elektroda, riskorja, #20524167; divadiow, #21325656].

Can I identify the PCB version without opening the case?

No reliable external marking exists; users report two visually identical housings hiding different pinouts and even component swaps (NTC vs resistor) [Elektroda, mrAtini, post #20906629] Open the shell to verify before flashing.

Which pads do I need for UART flashing?

Solder (or probe) only GND, 3 V3, RX and TX; CEN can stay floating. A spare screw terminal (S1) is a convenient ground point [Elektroda, brazoayeye, post #21126063]

Why does Tuya-cloudcutter fail on firmware 1.3.10?

OTA exploit coverage stops at OEM firmware 1.2.1; Tuya patched 1.3.x, so serial flashing is required [Elektroda, elbuit, post #20797138]

What is the recommended OpenBeken template for SS8839-16A-W?

Set P6 TglChanOnTgl, P7 or P8 Rel (check board), P23 Btn_Tgl_All, P26 WifiLED_n; then run ‘PowerSave 1’ at startup [Elektroda, riskorja, #20537640; p.kaczmarek2, #20525130].

How do I enable power monitoring on BL0942 versions?

Add command ‘startDriver BL0942’ after flashing; the web UI will show voltage, current and energy [Elektroda, pkkrusty, post #20992948]

The relay sits on P7, not P8 – is that a problem?

No. Change the Rel pin in software; hardware is identical. Mixed batches often ship with P7 mapping [Elektroda, pkkrusty, post #20991422]

My switch feels warm when idle. Is this normal?

Mains power-supply losses produce noticeable warmth. Enabling PowerSave 1 cuts Wi-Fi duty cycle and reduces heat; one user reported crashes until pins were set correctly, after which the unit stabilised [Elektroda, pkkrusty, post #20991422]

Is it safe to wire the S1 terminal to other circuits?

No. The PCB links N-out and S1 internally, making it unsafe for anything except a classic two-way wall switch loop [Elektroda, riskorja, post #20524167]

How do I minimise idle power draw?

  1. Issue ‘PowerSave 1’. 2. Disable cloud polling. 3. Lower Wi-Fi Tx power if range allows. Each step shaves ~0.1 W (typical) [p.kaczmarek2, #20525130].

Can I flash ESPHome instead of OpenBeken?

Yes. Compile ESPHome with ‘bk72xx: board: generic-bk7231n-qfn32-tuya’ and upload through BK7231GUIFlashTool; CEN is still optional [Elektroda, brazoayeye, post #21126030]

Quick 3-step serial flashing guide?

  1. Connect USB-UART (3 V3) to GND, RX, TX, Vcc pads.
  2. Run BK7231GUIFlashTool, select .bin, press ‘Write’.
  3. Power cycle; configure pins, then save template [BK7231GUIFlashTool docs].

What if I hold CEN low during flashing?

The chip stays in reset and cannot enter bootloader. Keep CEN floating or momentarily ground 3 V3 instead for hard resets [Elektroda, p.kaczmarek2, post #21126059]

Deepsleep never wakes with the ‘deepsleep’ command—why?

‘deepsleep
Generated by the language model.
%}