Pzem-004t via EspEasy

Ah one more question. Perhaps that @dynamicdave know this...

A pzem-004t can measure 6 different types of values (see documentation). But in EspEasy I can only have 4 of the 6 available values in the output of my device:


Do you know how I can read all 6 measured values? Creating two separate devices, each having 3 measured values feels not a good practice? Because then you are putting a high load on the wt32-eth01? But perhaps I should look at that from a different point of view...


The last two are not much use in real life :wink:
If the frequency varies even a small amount the power companies are in trouble !
Power factor isn't something you have any control over either, it just depends on the load type.

Although Tasmota does report all metrics :rofl: :rofl:

1 Like

I swapped-over to using Tasmota on the Wemos D1 Mini (3+ years ago) and vaguely recall seeing the values you posted above for devices flashed with ESPeasy. As @smcgann99 stated, some of these values aren't much use in real life.
Here are some screen shots of readings I get from Tasmota - I suspect some of them are caculated.
Here's my simple local dashboard. However, all my data is logged to Clarify.

1 Like

Heuh, what, ...
You are the reason I have gone for EspEasy :joy:
Will need to have a look at a Tasmota introduction. The concept of the templates is totally unclear to me, but I have not done much of research...

1 Like

I forget the reason I swapped over (as it was so long ago). Setting it up with Tasmota was fairly easy.
I've also re-flashed my SonOff S20 and S26 mains switches (which were using ESPeasy) with Tasmota as I get feedback to indicate the status of each switch.

Now that I have a POC working, I need to build something solid and safe with it to measure the power consumption of my entire house.

I really like the setup of this guy:

Which means one box per phase.


Wooooo - that is impressive. I think he may have bought-up the entire stock of PZEMs.
I have just one PZEM with the clamp around the 'live' that enters my consumer unit.
Note: Only single phase is used in most homes here in the UK.

I am not 100% familiar with all the names of the components being used in this drawing. So a bit difficult to search these components on Ali... Like e.g. the green things around the end of the AC wires, or which terminal blocks would fit, or the white connectors, and so on...

If anybody knows where to buy these components on Ali, I would appreciate if some hyperlinks could be shared here. Thanks!!

Simplest search would be:
Google for Pluggable PCB terminal blocks, then if decided the shape and stuff, find manufacturer and search for wire gauge sizes and then search for wire end sleeves according to dimensions of choosed terminals.

1 Like

I get the "live" power consumption reading from the meter via a photosensor on the flashing LED connected to a GPIO setup as a counter. So don't need a clamp on the incoming feed.

I have energy monitoring plugs / PZEMs on most high usage appliances, so I can track what they use individually. I subtract this from the meter readings and class the difference as "other".

My goal is to add a couple of PZEMs to monitor the 2 lighting circuits, thereby reducing the "other" reading further. I'm also going to add one to my boiler as this about the only high use device still not monitored.

After that the "other" value will hopefully be only about 100 watts :wink:

In terms of monitoring the cost of devices, it's quite surprising to see that its the lower power devices that are running most of the time that cost the most.

Thanks for the starting point :wink:

Ok, trying to create a shopping list...

  1. The highest components seem to be around 1 cm heigh, and then there are some cut of soldered wires below the pcb. So I think that brass hex spacers of 2 cm long should be sufficient, like these. Not sure whether M3 (thread 5 mm) is sufficient?

  2. Seems that the green pluggable terminal blocks in the picture are from the brand Pheanix. Not sure whether I need those. The green terminal blocks on the pzem-004t are very solid, so looks to me that there is not need to replace them.

  3. The line end caps (or sleeves) are available in different colors, like e.g. here . It looks to me that those "ferrules" need to obey the DIN 46228 Part 4 standard, which means the colors are standardized also. So I can buy the same colors: larger green ones in the middle, because 2 cables need to be plugged into the ferrule. And blue ones on top and bottom, because only 1 cable need to be plugged into the ferrule.

  4. Shorter (1cm) brass hex spacers at the bottom, to screw the entire stack to the case for firmness.

  5. Female 4 pin straight XH2.54 header connectors (see here), to connect the serial interfaces of all pzem-004t together on the bord on top of the stack.

  6. XH2.54 Female Connector Terminal Cable ( see here) 4-pin double headed (i.e. at female connector at both sides). I assume cables of 20 cm would do the job...

If anybody sees something weird in my shopping list, don't hesitate to let me know!

And is there anybody who has an idea what the use of the board with "???" is in the above picture?

I would assume its a 5V PSU for the PZEMs and ESP, also mains output to the PZEM, hopefully. with some fuses as well.

It looks neat from the front but we cannot see what spaghetti may be at the back !

Having looked at that thread as well, I don't think the OP managed to get more than 5 PZEM working.

I wouldn't bother with the terminal blocks, or ferrules.
Use a smaller gauge wire and solder the two pieces together, then you have a solid end to screw into the terminals. Less points of failure that way.

You could also solder the 0v / 5v and the RX pins a similar way looping from one to the other, and then solder a diode to each PZEM TX and solder a wire looping from each TX, so at the end you only have 4 wires to the ESP.

Great feedback!!! Nice to have this discussion before I buy my stuff...

  1. Where would you add the fuses in the diagram, and which ones?
  2. Yes indeed there is a lot of wiring, which could be reduced like you say. Perhaps I can remove the orignal white jst-xh2.54 connectors, and replace them by terminal blocks with 2.54mm pitch (like these). Because I am not really fond of soldering wires directly to the boards,
  3. About the spaghetti at the back. A few months ago I have designed a pcb for one of my shelly setups. I was surprised how easy it has become these days to draw and order pcb's. But of course then I need to be sure my diagram is correct and complete...
  4. I have never used such small psu's, certainly not to solder on a pcb. However my idea was to power my wt32-eth01 via my POE switch, like I do for all my other wt32-eth01 devices. But of course in this case there is already 230V AC available in the box, which I don't have for my other wt32-eth01 devices. Need to think about which way I want to go with this...

Oh that would be a problem for me. I assume that is somehow related to some voltage issue on the serial connection, or in the communication library? Because I had always assumed that there are 255 addresses possible on such a Modbus interface?

I can't speak for ESPEASY, I checked the Tasmota code and it allows for 8 PZEM on an ESP32.

I have just ordered another 8 PZEM (not to be outdone!)
So I will see how many I can get on 1 serial line when they arrive :wink:

Re PSU you could use something like a HLK-5M05 from aliexpress.


FYI there is also a free model available for the folks that - unlike me :frowning_face: - have a 3D printer, so your can create a small nice din-rail case for the pzem-004t (and a PSU and a Wemo):

By using a wemo per pzem-004t you are of course rid of all the troubles to attach multiple pzem-004t devices to a single serial bus. And you have a nice and safe setup.

Here is an example image from the same author:

Although I would install those devices in a separate electrical box (with din rail)...

Woow. Never had a look at prices of 3D printing services. But even if I select the cheapest material (i.e. PLA) then craftcloud shows me that it would be around 20 euro per case:

Then it becomes expensive...

That would seem like a lot of redundant hardware, not to mention a lot of new devices hogging your wifi.

How many PZEMS do you actually plan to use ?

Yes true. But even without separate wemo's per case (i.e. interconnect them via a serial cable) would also have been a decent setup. I have always been a fan of din-rail stuff for some unexplainable reason. But it is too expensive for my purpose, so back to the original setup...

Since I have 3 phases, I will need more pzem's compared to a house with a single phase. I think that in first instance I will start small with about 10 pzem's, but that number will most probably grow soon. Because those power measurements can learn me a lot of things. For example I have a water pump that is attached to an expansion bladder tank. When there is not enough pressured air in the tank (e.g. because the bladder is broken), the pump will run continiously. I can monitor my tank very easily via a pzem. And I have lot's of other ideas :wink:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.