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] (DIY) Mini Smart Switch UNSH SS8839-16A-W

riskorja  51 19350 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: 15 Q&A, “PowerSave 1” and serial flashing solve the main UNSH SS8839-16A-W BK7231N problems for OpenBeken users: OTA works on Tuya 1.2.1, but firmware 1.3.10 usually needs UART pads, and pinouts vary between P8, P7, P15, and T34 boards. [#20797138]

Why it matters: The same AliExpress 16A Mini Smart Switch listing can ship different PCBs, so copying one template without checking the board can break relay, LED, button, or metering behavior.

Alternative Works when Typical pins or tool Thread result
tuya-cloudcutter OTA Tuya 1.2.1, BK7231N, oem_bk7231n_control_switch Mini Smart Switch profile OpenBeken 1.15.648 or 1.15.673 flashed without soldering
Serial UART flashing Tuya 1.3.10 or OTA failure RX, TX, GND, 3.3V; CEN usually optional Worked after cloudcutter failed
ESPHome custom firmware BK7231N target build generic-bk7231n-qfn32-tuya Uploaded without CEN

Key insight: Identify the exact PCB before configuring OpenBeken. Devices sold as the same 16A Mini Smart Switch used at least relay pins P8, P7, and P15, plus BL0942 power-monitor variants.

Quick Facts

  • The original UNSH SS8839-16A-W teardown used BK7231N on a custom PCB, not a replaceable Tuya module, and cost €3.63 from AliExpress. [#20524167]
  • Two SS8839-16A-W boards from the same seller used different relay pins: one used P8, while another used P7. [#20537640]
  • EZB-WBZS1H16N-A V1.0 used another layout: LED_n on P6, button on P8, wall toggle on P14, and relay on P15. [#20538893]
  • Tuya firmware 1.3.10 blocked tuya-cloudcutter for one user, but serial flashing through the board pads worked. [#20797138]
  • Power-monitor versions can use BL0942; OpenBeken showed measurements after running startDriver BL0942. [#20992948]

How do I flash OpenBeken on the UNSH SS8839-16A-W Mini Smart Switch with a BK7231N chip using tuya-cloudcutter?

Use tuya-cloudcutter with the Mini Smart Switch BK7231N profile for Tuya firmware 1.2.1.
  1. Pair the switch in SmartLife or Tuya first.
  2. Select 1.2.1 - BK7231N / oem_bk7231n_control_switch and flash OpenBK7231N_UG_1.15.648.bin or later.
  3. If the device misses cloudcutterflash, create a second AP with internet, enter Wi-Fi credentials, then resume cloudcutter.
The first reported flash needed patience and a temporary router AP. [#20524167]

What GPIO pin template should I use for the UNSH SS8839-16A-W when the relay is on P8 versus P7?

Use P8 for the first SS8839-16A-W board, and P7 for the later same-order board. P8 variant: P6 TglChanOnTgl, P8 Rel, P23 Btn, P26 LED, all on channel 0. P7 variant: P6 TglChanOnTgl, P7 Rel, P23 Btn, P26 LED, all on channel 0. The thread confirms both came from the same seller, order, and package. [#20537640]

Why do some AliExpress Mini Smart Switches with the same UNSH 16A listing have different PCB layouts and different OpenBeken pinouts?

The listing shipped multiple internal PCB revisions under the same 16A Mini Smart Switch product. The thread shows SS8839-16A-W boards with relay on P8 or P7, plus EZB-WBZS1H16N-A V1.0 boards with relay on P15. Later buyers also found two visually identical 16A devices with different PCBs. From outside, one contributor reported no reliable difference between two 16A versions. [#20906629]

What is tuya-cloudcutter and how does it perform OTA flashing on BK7231N Tuya devices?

tuya-cloudcutter is an OTA flashing tool that replaces compatible Tuya firmware without opening the device. "tuya-cloudcutter is a flashing workflow that targets vulnerable Tuya cloud pairing behavior, lets users select a firmware profile, and uploads OpenBeken over Wi-Fi instead of UART, when the stock firmware still supports that route." In this thread it used the BK7231N oem_bk7231n_control_switch profile and Mini Smart Switch selection. [#20524167]

What is OpenBeken and how is it used with BK7231N or T34-based Tuya smart switches?

OpenBeken is replacement firmware used to run BK7231N and T34 Tuya switches locally. "OpenBeken is open firmware for Beken-based IoT devices that maps GPIO roles, starts device drivers, and replaces Tuya cloud firmware with a configurable local web application." The thread shows OpenBK7231N builds from 1.15.648 to 1.17.308, including BK7231N and T34 Mini Smart Switch variants. [#20842297]

How do I locate RX, TX, GND, and 3.3V flashing pads on BK7231N Mini Smart Switch boards?

Open the case, identify the matching board photos, and use the marked UART pads. One board used black for GND, white for 3.3V, and separate pads for RX and TX. Another tip used S1 as GND, reducing small solder points to three: RX, TX, and 3.3V. Always disconnect mains first, because the device uses high voltage. [#20737346]

Serial flashing vs tuya-cloudcutter: which method is better for easily opened Tuya Mini Smart Switches?

Serial flashing is often easier for these switches because the case opens easily. An OpenBeken developer wrote: “for simple cases I really prefer just wires.” Cloudcutter remains useful for harder-to-open devices such as bulbs. For this Mini Smart Switch, several users flashed successfully with CP2102 or UART pads after opening the enclosure. [#20797170]

Why does Tuya firmware 1.3.10 prevent using tuya-cloudcutter, and what serial flashing method works instead?

Tuya 1.3.10 blocked cloudcutter in the reported device, so UART flashing worked instead. One user had the same pins but stock Tuya V1.3.10 firmware and could not use tuya-cloudcutter. They flashed over the serial port using the exposed pads. Later examples with 1.3.10 also used RX, TX, GND, and 3.3V instead of OTA. [#20797138]

What does the CEN pad do on BK7231N devices, and when is it actually needed for flashing?

CEN is a reset-related pad, but these Mini Smart Switches usually flash without it. "CEN is a BK7231 control pad used for reset or boot control during flashing, but the thread repeatedly shows UART flashing with only RX, TX, GND, and 3.3V." One developer said he flashed hundreds of devices via wires without using CEN. [#20889669]

How do I configure power monitoring on a BK7231N Mini Smart Switch that uses the BL0942 metering chip?

Start the BL0942 driver in OpenBeken and use the relay template for that PCB. For one power-monitor version, the working pins were P6 TglChanOnTgl, P7 Rel, P23 Btn, and P26 LED. After entering startDriver BL0942, measurements appeared on the OpenBeken main page. Add the command in startup if you want it after each reboot. [#20992948]

What is the BL0942 chip and how does OpenBeken read voltage, current, and power from it?

BL0942 is the metering chip used by some power-monitor Mini Smart Switch variants. "BL0942 is an energy-metering IC that reports electrical measurements to firmware, letting OpenBeken display voltage, current, power, and energy when the BL0942 driver is started." The thread identifies BL0942 inside a power-meter variant and confirms OpenBeken measurements after startDriver BL0942. [#20992948]

Why should I add PowerSave 1 to startup commands on BK7231N smart switches, and how do I set it correctly in OpenBeken?

Add PowerSave 1 because BK7231N switches can otherwise overheat or need repair later. The recommended startup command is PowerSave 1; use backlog when combining it with other commands. One working T34/BK7231N-style config used backlog PowerSave 1. Another user reported warmth with no load attached and had already placed PowerSave 1 in startup. [#20525130]

What safety issue is caused by the Mini Smart Switch connecting N-out and S1 together?

The switch connects N-out and S1 together, making non-classic switch wiring unsafe. The teardown warns that this design is “unsafe for use other than with the classic wall switch.” The device handles mains voltage, so open or flash it only while disconnected from the power line. This warning appears in multiple board revisions. [#20524167]

How do I flash ESPHome firmware to a BK7231N Mini Smart Switch, and what board setting should I use?

Build ESPHome for generic-bk7231n-qfn32-tuya and upload it over UART. A user first confirmed OpenBK worked, then created an ESPHome project using: bk72xx: board: generic-bk7231n-qfn32-tuya They uploaded successfully without touching CEN. This was on a BK7231N Mini Smart Switch after serial flashing experiments. [#21126030]

How can I use BK7231GUIFlashTool to flash a custom ESPHome BIN instead of an OpenBeken BIN?

Use BK7231GUIFlashTool as the UART flasher and select the custom ESPHome BIN file. The thread points users to BK7231GUIFlashTool for BK7231 serial flashing, then confirms ESPHome firmware was uploaded to BK7231N without CEN. If flashing stalls, use only RX, TX, GND, and 3.3V first, then power-cycle the module; do not short the supply rail. [#21125858]
Summary generated by AI based on the discussion content.
%}