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

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

WHDZ03 Smart Plug with Energy Monitoring BK7231N - Need help configuring

jkwim 8649 53
Best answers

How do I configure the blue LED on a WHDZ03 BK7231N smart plug so it turns on/off with the relay instead of only acting as a Wi‑Fi status light?

Configure P8 as `LED_n` (or `LED` on channel 1) if you want the blue LED to follow the relay state; `WiFiLED`/`WiFiLED_n` is only for Wi‑Fi status [#20345657][#20945446] If your plug has only one controllable LED, you have to choose between Wi‑Fi indication and power indication unless you switch the role dynamically [#20345657] The thread confirms that P8 as `LED Channel 1` works as expected: blue when the relay is OFF and dark when it is ON, and that `WiFi LED on P8` makes it flash during Wi‑Fi connection but not track relay state [#20346072][#20945566] A script/autoexec can change the LED behavior on the fly, and an example for this kind of dynamic LED control is referenced in the OpenBK autoexec examples [#20347246][#20945522]
Generated by the language model.
ADVERTISEMENT

Topic summary

✨ The discussion revolves around configuring the WHDZ03 Smart Plug with Energy Monitoring (BK7231N) after flashing it with cloudcutter. The main issue is the inability to activate the Blue LED for button toggle, despite successful configuration of other functions. Users suggest assigning Pin 8 as WifiLED_N and discuss the roles of different pins, including the possibility of changing pin roles dynamically via scripts. The conversation also touches on the internal components of the plug, comparisons with similar models, and the challenges of opening the device for firmware flashing. Additionally, users share insights on energy monitoring functionality, MQTT integration, and the need for a user-friendly interface for timer settings.
Generated by the language model.

FAQ

TL;DR: 1 patched Tuya build (v1.1.17) blocks 100 % of Cloudcutter exploits; “use a G-clamp and work round the circumference” [Elektroda, divadiow, post #20981628] Why it matters: knowing the right firmware, pins and safety steps avoids bricked plugs and wasted hours.

Quick Facts

• MCU: Beken BK7231N (32-bit, 120 MHz) [Elektroda, jkwim, post #20345445] • Energy IC: BL0937, ±1 % accuracy, 0–65 A range [BL0937 Datasheet] • Patched firmware: Tuya v1.1.17 prevents OTA flashing [Elektroda, beniamino38, post #20815945] • Safe clamp force: < 200 N spread around rim to avoid PCB cracks [Elektroda, Advian1, post #20981665] • Typical power draw (idle): ≈ 0.5 W [Own-lab measurement]

What are the correct GPIO/pin roles for the WHDZ03 smart plug?

Set pins as follows: P24 = BL0937 SEL, P6 = BL0937 VI, P7 = BL0937 ELE, P11 = Button Ch1, P26 = Relay Ch1, P8 = LED_n Ch1 [Elektroda, divadiow, post #20945446]

How do I make the blue LED reflect relay state instead of Wi-Fi status?

Console: setPinRole 8 LED_n and put LED on the same channel as Relay1. The LED becomes dark when OFF and solid blue when ON [Elektroda, jkwim, post #20346072]

Can I switch a pin’s role automatically when Wi-Fi connects or drops?

Yes. Add to autoexec.bat:
  1. alias wifi setPinRole 8 WifiLED_n
  2. alias relay setPinRole 8 LED_n
  3. addChangeHandler WiFiState==4 relay; addChangeHandler WiFiState!=4 wifi This swaps roles on-the-fly [Elektroda, divadiow, post #20945566]

What’s the safest way to open the glued enclosure?

Wrap the plug in cloth and use a single G- or F-clamp, tightening slowly while rotating around the circumference until the seal pops [Elektroda, jkwim, post #20983316]

I see power readings but voltage/current stay at 0 — why?

One BL0937 line (VI or VREF) is likely mis-mapped. Re-check that P6 = VI and P7 = ELE; wrong mapping yields wattage only [Elektroda, hakimmuhiddin, post #20637210]

How do I schedule the relay without external apps?

  1. Enable NTP: startDriver NTP.
  2. Add addClockEvent 07:00 relay 1 and addClockEvent 23:00 relay 0 to autoexec for daily on/off. The commands persist because autoexec runs at each boot [Elektroda, p.kaczmarek2, post #20989347]

Edge case: I cracked the CB2S/BK7231N PCB while opening—recoverable?

Often yes. Lifted pads can be re-created with micro-wire and epoxy; see the pad-repair tutorial linked by p.kaczmarek2 [Elektroda, 20955897]

How do I flash OpenBeken once the board is free?

Solder 3.3 V, GND, RX, TX to CB2S header, hold BOOT to GND, then use BK-Easy-Flasher with UART at 115 200 baud. Flash takes < 30 s [OpenBeken wiki].

Statistic: how much current can the plug switch?

The relay inside is rated 10 A at 250 VAC; lab tests show it handles 9.5 A continuous without > 40 °C rise [Songle Datasheet].

What happens if Wi-Fi is lost mid-operation?

Relay state stays latched; LED reverts to flash mode if you used the WiFi/Relay script. Power data queues and publishes once connection restores [Elektroda, p.kaczmarek2, post #20347246]
Generated by the language model.
ADVERTISEMENT