logo elektroda
logo elektroda
X
logo elektroda

WS-04H1 aka Sonoff POW R2 - energy measurement and relay (ESP8266 and CSE7759B)

p.kaczmarek2 1695 0

TL;DR

  • WS-04H1 elHome relay with energy measurement is essentially a repainted Sonoff POW R2 V2.0 with ESP8266 and CSE7759B inside.
  • Inside, the PCB includes a CSC7102C flyback supply, ESP8266EX plus flash, a 3.3V LDO, and a CSE7759B pulse-based power-measurement chip.
  • The PCB is dated 2018-06-11, and the device was bought for $12.
  • Tasmota can be flashed through the UART by pulling GPIO0 low with the button, using soldered GND, 3.3V, TX, and RX connections.
  • Accurate readings require VoltageSet, PowerSet, and CurrentSet calibration against a known load such as a 60W bulb.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • elHome WS-04H1 WiFi controller next to its box and manual .
    Here is another product which turned out to be a repainted relay from Sonoff - the WS-04H1 from elHome. Here I show its interior and the procedure for changing the ESP8266 firmware to Tasmota, for example. I bought the WS-04H1 for 12$ along with similar products in the series when I still thought it was a completely separate product family. I have already shown a few other gadgets from it:
    [ESP8285] WS-05H1 or Sonoff Dual R2 clone - firmware change, stencil, Tasmota .
    Interior and Tasmota upload on elHome WS-03H1 (Sonoff clone TH10/16 Ver 2.1) .
    And now and it's time for the WS-04H1, so here we go.

    The packaging suggests nothing that this could be a Sonoff:
    Box of the elHome WS-04H1 device with Smart Home features and mobile app control. Side of the elHome WS-04H1 packaging with eWeLink app logo and App Store and Google Play icons. Back of elHome WS-04H1 packaging with Polish instructions. WS-04H1 product packaging with a barcode and CE symbols on a white background. View of WS-04H1 elHome packaging and device .
    Someone has made an effort, as the instructions are in Polish:
    User manual for the WS-04H1 WiFi controller with the elHome logo lying on a wooden table. User manual for WS-04H1 device in Polish. Polish-language user manual for WS-04H1 with connection and pairing instructions with the application. User manual of WS-04H1 device with function description and LED indicators. User manual of WS-04H1 device with function description and LED indicators. Manual of WS-04H1 device with descriptions of features. Polish language manual for WS-04H1 with a warranty card. Polish-language instruction manual for the WS-04H1 product with a warranty card. .
    In the manual you will find detailed information about pairing the device with the eWeLink app. In addition, there is also a warranty card, I wonder if the "manufacturer" respects this.
    And then there is the product itself:
    Label on the packaging of the elHome WS-04H1 WiFi controller. .
    Time to look inside...

    Interior of WS-04H1 .
    Lift up the housing and look inside.
    PCB board from inside the WS-04H1 relay on a wooden table background. .
    At this point we learn the secret of this product - the writing on the PCB makes it clear. This is in fact the Sonoff Pow R2 V2.0, dated 2018-06-11.
    Interior of the WS-04H1 device with visible PCB and Sonoff Pow R2 labels. .
    Here we have the programming pads (IO0 is on the button):
    Interior of WS-04H1 device showing electronic components on a green PCB. .
    The design itself is not bad either, not only is a fuse resistor present but also a varistor and filter capacitor. Tuya often omits this from their products.
    PCB of the WS-04H1 device with visible electronic components.
    The rest happens on the bottom of the PCB:
    View of the PCB of the WS-04H1 relay with integrated circuits. Close-up of the PCB of the WS-04H1 device with visible components. .
    The power supply is a flyback, it is based on the CSC7102C. I am familiar with this circuit, I described it here:
    Sonoff Basic ZBR3, which is the famous relay version on Zigbee. Interior, schematic .
    Next we have the ESP8266EX with a flash memory bone:
    Interior of the WS-04H1 device, showing electronic components. Close-up of the WS-04H1 circuit board with visible electronic components and the ESP8266 chip. .
    Next to it is a 3.3V LDO supplying this part of the circuit.
    Apart from this, there is also just a bone for energy measurement - the CSE7759B:
    Close-up of a PCB with electronic components. .
    This circuit is similar to the BL0937, it represents the measured power/current/voltage as pulses with a frequency corresponding to the measured quantity:
    Circuit diagram of the CSE7759 chip with pin descriptions. .

    Changing WS-04H1 firmware .
    You can upload e.g. Tasmota, if only via esptool.py or the online method:
    How to install Tasmota easily - online installer tasmota.github.io/install via web browser .
    Solder the ground, power, TX and RX:
    Close-up of WS-04H1 circuit board with visible programming pads and components. Close-up of a circuit board with connected wires. .
    Here is all my programming circuitry (I have a 3.3V LDO on the contact board):
    View of the WS-04H1 device interior with connected breadboard. .
    Before connecting the power supply we push the button, as it is on GPIO0, and we need to run the ESP in bootloader mode from the UART . Only then can the batch be uploaded.
    The templates for this device are on the Blakadder website:
    https://templates.blakadder.com/sonoff_Pow_R2.html
    Code: JSON
    Log in, to see the code
    .
    Code: JSON
    Log in, to see the code
    .
    Both differ only in the behaviour of the blue LED.
    The device requires calibration with the VoltageSet/PowerSet/CurrentSet commands according to Tasmota's documentation for accurate measurements. Connect a known load, e.g. a 60W light bulb, switch on the relay and then enter the expected measurement results with these commands.

    Summary .
    It is definitely worth knowing that this product is essentially a Sonoff POW R2 with a different logo on the case. It's all ESP8266 inside, no weird surprises like in Tuya where you can end up with BK7231 or another chip . You can confidently order and change the batch. The Home Assistant can also be combined with. Tasmota has already been discussed on the forum, even in a DIY version:
    ESP8266 and Tasmota - WiFi relay control step by step .
    Do you use the Sonoff series, and if so, for what? Feel free to discuss.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14565 posts with rating 12578, helped 654 times. Been with us since 2014 year.
  • ADVERTISEMENT
📢 Listen (AI):

FAQ

TL;DR: For a $12 buyer, the WS-04H1 is, as the author puts it, "essentially a Sonoff POW R2": the PCB is marked Sonoff POW R2 V2.0, dated 2018-06-11, and it uses ESP8266 plus CSE7759B, so this FAQ helps anyone identify, reflash, and calibrate the unit for Tasmota and Home Assistant. [#21276052]

Why it matters: If you want a power-measuring relay you can actually reflash, the WS-04H1 avoids the chip roulette common in some Tuya devices.

Option What the thread found Reflash outlook Energy hardware
elHome WS-04H1 Rebranded Sonoff POW R2 V2.0 Straightforward UART flashing on ESP8266 CSE7759B
Sonoff POW R2 Original platform behind WS-04H1 Same Tasmota method and templates CSE7759B
Some Tuya relays Can hide BK7231 or another chip Less predictable before purchase Varies

Key insight: The most valuable finding is not the teardown itself. It is that WS-04H1 behaves like a known Sonoff platform, so firmware change, template selection, and calibration follow an established path instead of guesswork.

Quick Facts

  • The author bought the WS-04H1 for $12, then found a PCB marked Sonoff POW R2 V2.0 with board date 2018-06-11 inside the housing. [#21276052]
  • The logic side uses ESP8266EX, an external flash chip, and a 3.3 V LDO, which is why the programming setup must provide 3.3 V, not mains or higher logic voltage. [#21276052]
  • Energy monitoring is handled by CSE7759B, which represents measured voltage, current, and power as pulse frequencies, similar to BL0937. [#21276052]
  • The mains stage includes a fuse resistor, varistor, and filter capacitor; the author explicitly calls this a decent design because some Tuya products omit such parts. [#21276052]
  • Flashing uses UART pads for GND, power, TX, and RX, while the front button sits on GPIO0, so you hold it during power-up to enter bootloader mode. [#21276052]

1. How can I tell whether the elHome WS-04H1 is actually a rebranded Sonoff POW R2 before I buy it?

You usually cannot confirm it from the box alone, because the packaging does not indicate Sonoff branding. The thread's reliable proof came only after opening the unit and reading the PCB marking: Sonoff Pow R2 V2.0, dated 2018-06-11. A practical buying clue is that the manual and app flow match eWeLink-style products, but the board print is the decisive check. [#21276052]

2. What is the CSE7759B chip in the Sonoff POW R2 / WS-04H1, and how does it measure voltage, current, and power?

"CSE7759B is an energy-measurement IC that converts mains voltage, current, and power into output pulses, with pulse frequency tracking the measured quantity." In this relay, it sits beside the ESP8266 section and works similarly to BL0937. Tasmota reads those outputs, then converts them into displayed electrical values after calibration. [#21276052]

3. How do I flash Tasmota onto a WS-04H1 or Sonoff POW R2 using UART and esptool.py?

You flash it through the exposed UART pads on the PCB. 1. Solder GND, power, TX, and RX to the programming pads. 2. Hold the front button, because it is on GPIO0, then power the board so the ESP8266 starts in bootloader mode. 3. Upload Tasmota with esptool.py or another UART flashing method. The thread shows this exact pad-wiring workflow on the WS-04H1 board. [#21276052]

4. Why do I need to hold the WS-04H1 button during power-up, and how does GPIO0 put the ESP8266 into bootloader mode?

You hold the button because that button is wired to GPIO0. When GPIO0 is held low during power-up, the ESP8266 enters UART bootloader mode instead of normal firmware execution. Without that step, the board will boot the installed firmware and reject the flashing session. [#21276052]

5. Which programming pads on the WS-04H1 are GND, 3.3V, TX, RX, and GPIO0 for firmware flashing?

The thread identifies the usable programming connections as ground, power, TX, and RX, and it states that GPIO0 is on the button rather than a separate pad. The author's setup also used a contact-board 3.3 V LDO, which confirms the ESP side should be powered from 3.3 V during flashing. That means the practical flashing points are GND, 3.3 V power, TX, RX, plus the button for GPIO0. [#21276052]

6. What is a flyback power supply, and what role does the CSC7102C play inside the Sonoff POW R2?

"A flyback power supply is an isolated switch-mode converter that stores energy in a transformer and releases it to create a lower output voltage." In this device, the mains supply is described as a flyback design based on CSC7102C. Its role is to generate the low-voltage rail that supports the control electronics on the board. [#21276052]

7. How do I use the Tasmota Web Installer to change the firmware on an ESP8266-based Sonoff POW R2 clone?

You can use the online Tasmota installer instead of a manual esptool.py workflow. The thread points to the browser-based installer and treats the WS-04H1 as a normal ESP8266 target after you wire GND, power, TX, and RX and force bootloader mode with the GPIO0 button. The crucial condition stays the same: start the chip in bootloader mode first, then upload the firmware. [#21276052]

8. What is the correct Tasmota template for the Sonoff POW R2, and why are there two Blakadder templates with different LED behavior?

The thread lists two Sonoff Pow R2 Tasmota templates from Blakadder, and both are valid for this hardware. They differ only in the mapped behavior of the blue LED. One template uses GPIO array value 56 for that function, and the other uses 158, while the rest of the template remains the same. [#21276052]

9. How do I calibrate power monitoring on a Sonoff POW R2 in Tasmota using VoltageSet, PowerSet, and CurrentSet?

You calibrate it after flashing, because the thread says accurate readings require Tasmota commands VoltageSet, PowerSet, and CurrentSet. 1. Connect a known load, such as a 60 W bulb. 2. Turn the relay on and observe the expected values. 3. Enter the expected voltage, power, and current with those three commands so Tasmota aligns the measurements. [#21276052]

10. What known load should I use to calibrate a WS-04H1 energy meter accurately after flashing Tasmota?

Use a known, simple load such as a 60 W light bulb. The thread gives that exact example because it provides an easy reference point for PowerSet, and it also helps you derive the matching current and voltage entries for Tasmota calibration. A stable resistive load makes the adjustment easier than a variable appliance. [#21276052]

11. Sonoff POW R2 vs Tuya power relays with BK7231 or ESP chips — which platform is easier to reflash and integrate with Home Assistant?

The Sonoff POW R2 platform is easier in this thread, because the WS-04H1 turned out to be a known ESP8266 design with standard Tasmota support. The author explicitly contrasts that with Tuya products, where you can unexpectedly get BK7231 or another chip. That uncertainty makes Tuya-based buying and reflashing less predictable before you open the device. [#21276052]

12. Why does the author consider the WS-04H1 hardware design decent, and what do the fuse resistor, varistor, and filter capacitor add for safety?

The author calls the design decent because the mains side includes three protective parts that are often worth having: a fuse resistor, varistor, and filter capacitor. In practical terms, the fuse resistor limits fault damage, the varistor helps absorb voltage spikes, and the filter capacitor improves input filtering. The author notes that some Tuya products often omit such parts. [#21276052]

13. What problems can happen if I power the ESP8266 section of the WS-04H1 incorrectly during flashing, especially if I use the wrong voltage?

The main risk is damaging the logic section or failing to flash the board at all. The thread shows the author using a 3.3 V LDO for programming, which means the ESP8266 side expects 3.3 V during flashing. If you ignore that and power it incorrectly, the bootloader session may fail, and the low-voltage electronics can be stressed or destroyed. [#21276052]

14. How does the CSE7759B compare with the BL0937 for energy monitoring in smart relays like the Sonoff POW R2?

In this thread, the practical comparison is simple: CSE7759B is similar to BL0937 because both express electrical measurements as pulse outputs. The measured quantities are voltage, current, and power, and the pulse frequency corresponds to the value being measured. For firmware work, that means they follow a familiar pulse-based metering model rather than an unusual digital interface. [#21276052]

15. What are practical ways people use Sonoff POW R2 or WS-04H1 devices with Tasmota and Home Assistant for relay control and energy tracking?

They use them as Wi‑Fi relays that also report electrical consumption. The thread explicitly mentions combining the reflashed device with Home Assistant, and it centers on relay switching plus power, current, and voltage monitoring through Tasmota after calibration. In practice, that makes the hardware suitable for both remote on/off control and tracked energy use on the same circuit. [#21276052]
Generated by the language model.
ADVERTISEMENT