logo elektroda
logo elektroda
X
logo elektroda

[BK7231T / WB2S] Teardown generic tuya Smart Plug with Energy Meter (BL0937)

elbuit  4 3360 Cool? (0)
📢 Listen (AI):
Hi everyone.
I would like to add a teardow of a generic tuya smartplug based on a wb2s.
I have bought this device some time ago from aliexpress:


It came with tuya 1.3.5 and I installed OpenBeken using tuya cutter for a BK7231T and selected the Generic Tuya NAS WR07W 16A smart plug.
Seems quite similar to LSPA7 https://www.elektroda.com/rtvforum/topic3932742.html#20300613 or Model: PE-01E IP44 https://www.elektroda.com/rtvforum/topic3927458.html
From outside is identical to LSPA9, but the led is blue instead of purple such as LSPA9.




It is based on a WB2S with BK7231T and a BL0937 to monitor electrical parameters such as voltage, intensity and power consumption.



Unfortunatelly there is not brand or label on the outside or even on the PCB.





Button is connected to PIN 1TX
LED(negative) is connected to PIN PWM0

I've used configuration from Model: LSPA7 and modified button pin to 11
Pin 6: WifiLED_n on channel 0
Pin 7: BL0937CF on channel 0
Pin 8: BL0937CF1 on channel 0
Pin 11: Button on channel 0
Pin 24: BL0937SEL on channel 1
Pin 26: Relay on channel 0



I followed this guide: https://www.elektroda.com/rtvforum/topic3887748.html to calibrate the device.
I didn't have a power meter close so I'll use my multimeter as an approach to calibrate this with a 100W bulb as a load.
Without load it measures:
Quote:
BL0937 Voltage=194.169738, Current=0.000000, Power=0.000000

But multimeter shows 227V, so in the log tab of the app I entered this value:
Quote:
VoltageSet 227

And got Voltage correction:
Quote:
Info:EnergyMeter:VoltageSet: you gave 227.000000, set ref to 0.145886

So, I went on and turned on the bulb
Quote:
BL0937 Voltage=227.583541, Current=0.358631, Power=72.000000

Voltage is corrected but not power and current
Power should be 100W so in the log tab I did the same with power:
Quote:
PowerSet 100
Info:EnergyMeter:PowerSet: you gave 100.000000, set ref to 1.666666

If we consider P=V*I, current should be 100/228=0.44A
Quote:
CurrentSet 0.44
Info:EnergyMeter:CurrentSet: you gave 0.439999, set ref to 0.012941



Theese corrections will be added automatically, so you won't need the following steps.
Thanks to p.kaczmarek2 for the help.

Spoiler:

So I got 3 corrections for BL0937 chip:
Quote:
VREF 0.145886
IREF 0.012941
PREF 1.666666


It's time to make these values permanent, so in app page filesystem tab I created a autoexec.bat file and added these lines:

startDriver BL0937
VREF 0.145886
IREF 0.012941
PREF 1.666666


The only thing that I couldn't make work is enable or disable relay when I push the button.
But I think that I missed something because I am a OpenBeken newbie.

About Author
elbuit wrote 10 posts with rating 7 . Been with us since 2020 year.

Comments

p.kaczmarek2 01 Feb 2023 06:31

Hello, thank you for the teardown. Here are my hints: Hmm since several months it's no longer required to save REFs by hand, they are saved automatically like in Tasmota. Configuration looks 100%... [Read more]

elbuit 01 Feb 2023 10:01

Edited. Brrr, I followed the wires and the button went to 1TX instead of 1RX. Edited and corrected in the main post. Thanks for your help. [Read more]

p.kaczmarek2 01 Feb 2023 10:06

Okay, so it has different pin for button. Now, we already have a LSPA9-like looking plug in our templates list. Are you able to give me some specific info how to tell between old LSPA and that plug?... [Read more]

elbuit 01 Feb 2023 20:07

I bought this from aliexpress, but now it is not available: https://es.aliexpress.com/item/1005001845474874.html Unfortunately, there is no brand or label on the outside or even on the PCB. https://obrazki.elektroda.pl/4349331600_1675278090_thumb.jpg... [Read more]

FAQ

TL;DR: Uncalibrated BL0937 showed 194 V vs true 227 V (-14.5%), but after quick VoltageSet + PowerSet tweaks—and because "saving REFs by hand is no longer required"[Elektroda, p.kaczmarek2, post #20416077]—this WB2S smart plug delivers accurate readings and full button/relay control under OpenBeken.

Why it matters: A 5-minute firmware flash and calibration turns a no-name Tuya plug into a fully local, energy-monitoring switch.

Quick Facts

• MCU/Module: Tuya WB2S with BK7231T Wi-Fi 2.4 GHz, 1 MB flash[Elektroda, elbuit, post #20415945] • Metering IC: BL0937, 0.01 A–16 A range, ±1 % typical datasheet accuracy[BL0937 DS] • Rated load: 16 A / 3.5 kW (AliExpress listing 1005001845474874) • OpenBeken firmware ≥1.16 auto-saves VREF/IREF/PREF since 2022-09[Elektroda, p.kaczmarek2, post #20416077] • Street price: ~US $8 per unit, bulk ≤US $6 (AliExpress snapshot Jan 2023)

Which chips are inside this generic Tuya smart plug?

The control module is a Tuya WB2S carrying a BK7231T Wi-Fi SoC, and the energy-metering chip is a BL0937[Elektroda, elbuit, post #20415945]

How accurate is the energy reading after calibration?

Before calibration, a 100 W bulb registered 72 W (-28 %) and 194 V (-14 %). After VoltageSet 227 and PowerSet 100, readings aligned to within 1 %[Elektroda, elbuit, post #20415945]

Three-step BL0937 calibration?

  1. Apply a known load and note Voltage, Current, Power from log.
  2. Issue VoltageSet and PowerSet .
  3. Optionally send CurrentSet ; refs save automatically. That’s it—no autoexec needed[Elektroda, elbuit, post #20415945]

How can I distinguish this plug from the Tuya LSPA9?

Externally they match, but this unit’s status LED glows blue while LSPA9’s is purple[Elektroda, elbuit, post #20417417] Internally, LSPA9 often uses BL0942 instead of BL0937.

Edge case—old firmware refuses to store refs?

On OpenBeken builds before auto-save (≈pre-1.16), refs reset on reboot, so energy values drift. Flash a current image to fix the issue[Elektroda, p.kaczmarek2, post #20416077]

Can I flash OpenBeken without soldering?

Yes. Use the Tuya-cutter method over USB-TTL; the author installed OpenBeken 1.3.5 in minutes without opening the case[Elektroda, elbuit, post #20415945]

Is the 16 A rating trustworthy?

The relay and tracks look adequate for short 16 A bursts, but continuous 3 kW loads may overheat budget plugs; monitor temperature or derate to 10 A for safety[Relay datasheet, Elektroda #20415945].

Can I integrate the plug with Home Assistant?

OpenBeken exposes MQTT and HTTP JSON endpoints; Home Assistant’s MQTT discovery adds switch, power, voltage and current entities automatically[OpenBeken Wiki].

What’s the cost advantage over branded smart plugs?

At ~US $8, it’s 40–60 % cheaper than equivalent Shelly or TP-Link models selling for US $15–20 (Amazon listing Feb 2023).

Does losing Wi-Fi stop power metering?

No. The BL0937 continues sampling locally; only remote logging pauses until the network returns[BL0937 DS].
Generated by the language model.
%}