Support for PZEM 004T Energy monitor
Moderators: grovkillen, Stuntteam, TD-er
Re: Support for PZEM 004T Energy monitor
What do you mean?
This sensor is using the (Hardware) serial port, so you must uncheck "Enable Serial port:" on the Tools->Advanced page.
This does make sure no logs are sent to the serial port and also any incomming data is not interpreted as commands and thus allows exclusive access to the serial port for the plugin.
This sensor is using the (Hardware) serial port, so you must uncheck "Enable Serial port:" on the Tools->Advanced page.
This does make sure no logs are sent to the serial port and also any incomming data is not interpreted as commands and thus allows exclusive access to the serial port for the plugin.
Re: Support for PZEM 004T Energy monitor
I have kept the settings as it is and still receiving accurate readings.TD-er wrote: ↑22 Oct 2020, 16:28 What do you mean?
This sensor is using the (Hardware) serial port, so you must uncheck "Enable Serial port:" on the Tools->Advanced page.
This does make sure no logs are sent to the serial port and also any incomming data is not interpreted as commands and thus allows exclusive access to the serial port for the plugin.
Re: Support for PZEM 004T Energy monitor
Hello
finally, how is it possible to compile easily PZEM plugin ?
i tried with P171 from playground, but it complains no *.h library as it is not provided.
and from this source , https://github.com/djelau/ESPEasyPlugin ... v30-master i don't see the trick as it is not a plugin format
Thomas
finally, how is it possible to compile easily PZEM plugin ?
i tried with P171 from playground, but it complains no *.h library as it is not provided.
and from this source , https://github.com/djelau/ESPEasyPlugin ... v30-master i don't see the trick as it is not a plugin format
Thomas
Re: Support for PZEM 004T Energy monitor
Isn't the code in the mega branch working as it should?
See P102: https://github.com/letscontrolit/ESPEas ... 004Tv3.ino
See P102: https://github.com/letscontrolit/ESPEas ... 004Tv3.ino
Re: Support for PZEM 004T Energy monitor
thanks, I miss it as it was not declare in Custom_Sample.hTD-er wrote: ↑17 Dec 2020, 22:22 Isn't the code in the mega branch working as it should?
See P102: https://github.com/letscontrolit/ESPEas ... 004Tv3.ino
Re: Support for PZEM 004T Energy monitor
Yep that one needs an update as well indeed.
Re: Support for PZEM 004T Energy monitor
I have seen, that now following firmware exists:
ESP_Easy_mega_20210114_energy_ESP8266_4M1M.bin
Is the functionality the same as the version compiled from DJELAU?
ESP_Easy_mega_20210114_energy_ESP8266_4M1M.bin
Is the functionality the same as the version compiled from DJELAU?
Re: Support for PZEM 004T Energy monitor
I have not tested it myself.
The only thing I did, was update the existing code from the playground to match the current code base and thus it should be functional identical, or at least do what the original code did + probably some more as added in newer code changed in the ESPEasy core.
The only thing I did, was update the existing code from the playground to match the current code base and thus it should be functional identical, or at least do what the original code did + probably some more as added in newer code changed in the ESPEasy core.
Re: Support for PZEM 004T Energy monitor
Thank you for your reply
I will test it and let you know if the functionality is the same
I will test it and let you know if the functionality is the same
- Andrew Mamohin
- Normal user
- Posts: 95
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
Re: Support for PZEM 004T Energy monitor
I installed this firmware a few days ago. Yes, the plugin works fine. But, I had to configure the PZEM device again.
Andy.
Re: Support for PZEM 004T Energy monitor
The plugin got a new plugin-id when it was moved from the plugin-playground to the main repository (to keep the numbers consecutive). As the settings are related to this plugin-id you'll have to re-configure.Andrew Mamohin wrote: ↑17 Jan 2021, 06:44 I installed this firmware a few days ago. Yes, the plugin works fine. But, I had to configure the PZEM device again.
/Ton (PayPal.me)
- Andrew Mamohin
- Normal user
- Posts: 95
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
-
- New user
- Posts: 1
- Joined: 16 Mar 2021, 19:44
Re: Support for PZEM 004T Energy monitor
Did anyone had tried to connect PZEM004T to arduino Nano 33 IoT?
Apparently this arduino does not support SoftwareSerial library, and PZEM004T library is using SoftwareSerial,
any idea how to create compatibility to this arduino board?
This is from arduino official site:
Serial ports on the Arduino NANO 33 IoT
The USB connector of the board is directly connected to the USB host pins of the SAMD21. This routing enables you to use the Arduino NANO 33 IoT as a client USB peripheral (acting as a mouse or a keyboard connected to the computer) or as a USB host device so that devices like a mouse, keyboard, or an Android phone can be connected to the Arduino NANO 33 IoT. This port can also be used as a virtual serial port using the Serial object in the Arduino programming language. The RX0 and TX1 pins are a second serial port available as Serial1
So I've tried to simply write the code like this:
But getting these errors in the arduino IDE:
error: no matching function for call to 'PZEM004Tv30::PZEM004Tv30(Uart&)'
PZEM004Tv30 pzem(Serial1);
Documents\Arduino\libraries\PZEM-004T-v30/PZEM004Tv30.h:65:5: note: candidate: PZEM004Tv30::PZEM004Tv30(arduino::HardwareSerial*, uint8_t)
PZEM004Tv30(HardwareSerial* port, uint8_t addr=PZEM_DEFAULT_ADDR);
^~~~~~~~~~~
Documents\Arduino\libraries\PZEM-004T-v30/PZEM004Tv30.h:59:7: note: candidate: constexpr PZEM004Tv30::PZEM004Tv30(const PZEM004Tv30&)
class PZEM004Tv30
^~~~~~~~~~~
exit status 1
no matching function for call to 'PZEM004Tv30::PZEM004Tv30(Uart&)'
Apparently this arduino does not support SoftwareSerial library, and PZEM004T library is using SoftwareSerial,
any idea how to create compatibility to this arduino board?
This is from arduino official site:
Serial ports on the Arduino NANO 33 IoT
The USB connector of the board is directly connected to the USB host pins of the SAMD21. This routing enables you to use the Arduino NANO 33 IoT as a client USB peripheral (acting as a mouse or a keyboard connected to the computer) or as a USB host device so that devices like a mouse, keyboard, or an Android phone can be connected to the Arduino NANO 33 IoT. This port can also be used as a virtual serial port using the Serial object in the Arduino programming language. The RX0 and TX1 pins are a second serial port available as Serial1
So I've tried to simply write the code like this:
Code: Select all
#include <PZEM004Tv30.h>
PZEM004Tv30 pzem(Serial1);
void setup() {
Serial.begin(115200);
Serial.print("Reset Energy");
pzem.resetEnergy();
Serial.print("Set address to 0x42");
pzem.setAddress(0x42);
}
void loop() {
float volt = pzem.voltage();
float cur = pzem.current();
float powe = pzem.power();
float ener = pzem.energy();
float freq = pzem.frequency();
float pf = pzem.pf();
Serial.print(volt);
Serial.print(" ");
Serial.print(cur);
Serial.print(" ");
Serial.print(powe);
Serial.print(" ");
Serial.print(ener,3);
Serial.print(" ");
Serial.print(freq);
Serial.print(" ");
Serial.println(pf);
delay(1000);
}
error: no matching function for call to 'PZEM004Tv30::PZEM004Tv30(Uart&)'
PZEM004Tv30 pzem(Serial1);
Documents\Arduino\libraries\PZEM-004T-v30/PZEM004Tv30.h:65:5: note: candidate: PZEM004Tv30::PZEM004Tv30(arduino::HardwareSerial*, uint8_t)
PZEM004Tv30(HardwareSerial* port, uint8_t addr=PZEM_DEFAULT_ADDR);
^~~~~~~~~~~
Documents\Arduino\libraries\PZEM-004T-v30/PZEM004Tv30.h:59:7: note: candidate: constexpr PZEM004Tv30::PZEM004Tv30(const PZEM004Tv30&)
class PZEM004Tv30
^~~~~~~~~~~
exit status 1
no matching function for call to 'PZEM004Tv30::PZEM004Tv30(Uart&)'
Re: Support for PZEM 004T Energy monitor
I was searching for the Espeasy binary which offers the plugin for multiple PZEM004 V3... but in the new ESP Easy Mega I don't find any binary that offers support for the pzem 004 V3.TD-er wrote: ↑16 Jan 2021, 20:51 I have not tested it myself.
The only thing I did, was update the existing code from the playground to match the current code base and thus it should be functional identical, or at least do what the original code did + probably some more as added in newer code changed in the ESPEasy core.
Which do I have to use for this scenario?
hope to hear you soon
ice77
Re: Support for PZEM 004T Energy monitor
Have you tried a .bin with 'energy' in the name?
/Ton (PayPal.me)
Re: Support for PZEM 004T Energy monitor
ok I did find it just a few minutes ago
in the actual ESP Mega release there is no *energy file (ESPEasy_ESP82xx_mega-20201125.zip).
In the "old" release I did find the *energy file (ESPEasy_ESP82xx_mega-20210114.zip)
why it wasnt recompiled in the new release???
thanks in advance
in the actual ESP Mega release there is no *energy file (ESPEasy_ESP82xx_mega-20201125.zip).
In the "old" release I did find the *energy file (ESPEasy_ESP82xx_mega-20210114.zip)
why it wasnt recompiled in the new release???
thanks in advance
Re: Support for PZEM 004T Energy monitor
The build script detects when a compiled bin file exceeds its maximum size.
So if it wasn't included in the ZIP, it very likely exceeded the max. size you can flash.
So if it wasn't included in the ZIP, it very likely exceeded the max. size you can flash.
Re: Support for PZEM 004T Energy monitor
I think at that time, November 2020, the Energy build wasn't defined yet.
/Ton (PayPal.me)
Re: Support for PZEM 004T Energy monitor
Oh I did a mistake. I took the wrong filename of the ESP mega release in the upper post. Now I'm writing over the cellular phone but checked out the newest ESP mega release file and there isn't the energy release included.
Do I have to take only the one release from January or could there be the chance to get release updates with also included pzem004 V3 device?
Release of dejelau works also fine, but i waited for the pzem device being included into the regular release to get security updates on the ESP easy software.
Re: Support for PZEM 004T Energy monitor
Hi,
Is the plugin Energy (AC) - PZEM-004Tv30-Multiple compatible/usable with multiplexer functionality?
I add a BME280 Temperature sensor into multiplexer channel 1 and works fine, but when I add a PZEM device the config of software serial options are different. I can't select the channel... only appears a address option list (>0x48 ¿?) and channels list (A/B ¿?) .
Config:
tnks
Is the plugin Energy (AC) - PZEM-004Tv30-Multiple compatible/usable with multiplexer functionality?
I add a BME280 Temperature sensor into multiplexer channel 1 and works fine, but when I add a PZEM device the config of software serial options are different. I can't select the channel... only appears a address option list (>0x48 ¿?) and channels list (A/B ¿?) .
Config:
tnks
Re: Support for PZEM 004T Energy monitor
The red text suggests, each must be used on a separate serial bus.
N.B. I have not tested this plugin myself, but based on the text marked in red, I would think those cannot be shared on the same serial bus.
So either you use one of those I2C to serial bridges from NXP, or use SW serial for the next one.
I'm not a big fan of SW serial, but it does work for not too 'chatty' devices (N.B. do not use it for GPS..)
Or you can use an ESP32 as those have more GPIO-pins and upto 3 HW serial ports.
N.B. I have not tested this plugin myself, but based on the text marked in red, I would think those cannot be shared on the same serial bus.
So either you use one of those I2C to serial bridges from NXP, or use SW serial for the next one.
I'm not a big fan of SW serial, but it does work for not too 'chatty' devices (N.B. do not use it for GPS..)
Or you can use an ESP32 as those have more GPIO-pins and upto 3 HW serial ports.
Re: Support for PZEM 004T Energy monitor
First, I take this opportunity to thank you for the work you are doing in this community.
Ok, Tnks!! I will try to test it using the other 2 HWSerial pins (in Software serial mode: I need to integrate 11 PZEM sensors + 2 BME280).
by another hand: I prefer, if it's possible, to use only the HWSerial2 (or SoftSerial 16,17) and a multiplexer.
when I active the multiplexing (hardware) functionality, the I2C Schema on PZEM device changes and I don't understand how to use/configure it or I don't know if this fuctionality isn't implemented yet for PZEM device...
you says for "I2C to serial bridges from NXP": sorry, i don`t understand. I googled and find some examples like I2C to SPI Scenarios but i don't see the idea for my current scenario.
I see the code and (If I'm not wrong) you perform some changes to integrate BME280 with the multiplexer functionality: I try to see it in more detail, but I can't just put the pieces together. exist any doc. reference (multiplexer + BME280 for easyEsp) to review?
This is my current Scenario:
(only for explain and understand the scenario & complexity. If I need help on other topics that are not for PZEM with multiplexer I will open another thread because I have multiple doubts about other devices... like TFT & SD... to integrate into EasyEsp ecosystem but I understand that It's not the correct place... )
I know and familiar with the PZEM libraries and I made some Arduino Sketches code for ESP32 to read 1 or various PZEMS and outputs into Blynk (or other) and TFT/SD device changing screen information via menus. and for 4-6PZEM works.
The problem (you have already imagined it) it's the number of PZEM devices into a unike I2c Bus (11): it's very, very unstable. (capacitive problems + noise + large nº devices ;( etc...)
I try some solutions like Pollups resistors, diferent electronic & wiring scenarios: something improves but does not finish working.
The idea is to split to multiple I2C buses: 3 PZEMS each bus + 2 BME280 using a multiplexer. I start to change my code to adapt this scenario but y see this wonderful platform and I decide to implement it. (and if it's possible, next steps: add my frontend customizations).
BR
JMER
Ok, Tnks!! I will try to test it using the other 2 HWSerial pins (in Software serial mode: I need to integrate 11 PZEM sensors + 2 BME280).
by another hand: I prefer, if it's possible, to use only the HWSerial2 (or SoftSerial 16,17) and a multiplexer.
when I active the multiplexing (hardware) functionality, the I2C Schema on PZEM device changes and I don't understand how to use/configure it or I don't know if this fuctionality isn't implemented yet for PZEM device...
you says for "I2C to serial bridges from NXP": sorry, i don`t understand. I googled and find some examples like I2C to SPI Scenarios but i don't see the idea for my current scenario.
I see the code and (If I'm not wrong) you perform some changes to integrate BME280 with the multiplexer functionality: I try to see it in more detail, but I can't just put the pieces together. exist any doc. reference (multiplexer + BME280 for easyEsp) to review?
This is my current Scenario:
(only for explain and understand the scenario & complexity. If I need help on other topics that are not for PZEM with multiplexer I will open another thread because I have multiple doubts about other devices... like TFT & SD... to integrate into EasyEsp ecosystem but I understand that It's not the correct place... )
I know and familiar with the PZEM libraries and I made some Arduino Sketches code for ESP32 to read 1 or various PZEMS and outputs into Blynk (or other) and TFT/SD device changing screen information via menus. and for 4-6PZEM works.
The problem (you have already imagined it) it's the number of PZEM devices into a unike I2c Bus (11): it's very, very unstable. (capacitive problems + noise + large nº devices ;( etc...)
I try some solutions like Pollups resistors, diferent electronic & wiring scenarios: something improves but does not finish working.
The idea is to split to multiple I2C buses: 3 PZEMS each bus + 2 BME280 using a multiplexer. I start to change my code to adapt this scenario but y see this wonderful platform and I decide to implement it. (and if it's possible, next steps: add my frontend customizations).
BR
JMER
Re: Support for PZEM 004T Energy monitor
The actual issue is that this plugin is not a 'real' I2C plugin, but a serial-based plugin, and the I2CSerial is one of the options in that config. And in this Serial-type plugin, no support for I2C Multiplexer is available.
I'm not fully sure that it is possible to multiplex these serial adapters reliably (I don't use them, currently), but it would be an enhancement if the I2C Multiplexer support is extended to the serial plugin option. Further investigation would be needed, though.
Can you create an issue on the ESPEasy github issue tracker, so it won't be forgotten? (and it will be registered to your name
)
I'm not fully sure that it is possible to multiplex these serial adapters reliably (I don't use them, currently), but it would be an enhancement if the I2C Multiplexer support is extended to the serial plugin option. Further investigation would be needed, though.
Can you create an issue on the ESPEasy github issue tracker, so it won't be forgotten? (and it will be registered to your name
![Knipoog ;)](./images/smilies/icon_e_wink.gif)
/Ton (PayPal.me)
Re: Support for PZEM 004T Energy monitor
The NXP I2C to UART chip we do support is the SC16IS752
This one does add 2 UART ports to an ESPEasy module and is connected to ESPEasy via I2C.
This one does add 2 UART ports to an ESPEasy module and is connected to ESPEasy via I2C.
Re: Support for PZEM 004T Energy monitor
Hi,
Ath > Done! https://github.com/letscontrolit/ESPEasy/issues/3701 Tnks!!!
TD-er > Ok! I see that: a UART bridge to split I2c into 2 TX/RX channels --> I will test it: I order 2 from aliexpress (I see that this device is working to control RS485 communication too: I use this for another of my projects!)
To check:
- Only 2 channels (TCA9548a = 8)
- I see that this device only admits 3.3v. Pzem 5v: I try to ajust using resistors...
For the moment I will continue doing tests and try to use the other 2 HWserial that the esp32 has (until I get the order from aliexpress). I will be reviewing the improvements that are made on EasyEsp project. Thanks!!!
BR
JMER
Ath > Done! https://github.com/letscontrolit/ESPEasy/issues/3701 Tnks!!!
TD-er > Ok! I see that: a UART bridge to split I2c into 2 TX/RX channels --> I will test it: I order 2 from aliexpress (I see that this device is working to control RS485 communication too: I use this for another of my projects!)
To check:
- Only 2 channels (TCA9548a = 8)
- I see that this device only admits 3.3v. Pzem 5v: I try to ajust using resistors...
For the moment I will continue doing tests and try to use the other 2 HWserial that the esp32 has (until I get the order from aliexpress). I will be reviewing the improvements that are made on EasyEsp project. Thanks!!!
BR
JMER
Re: Support for PZEM 004T Energy monitor
About the RS485.
I've noticed it in the datasheet too, but I don't know if I need to add some code and/or hardware to actually support any specific RS485 features of that chip.
Some RS485 devices are already supported in ESPEasy (e.g. AccuEnergy or Eastron) using any uart port. But then a MAX485 is needed to convert the levels.
So you can already use this I2C to UART chip with RS485, but not using any specific features of that chip.
I've noticed it in the datasheet too, but I don't know if I need to add some code and/or hardware to actually support any specific RS485 features of that chip.
Some RS485 devices are already supported in ESPEasy (e.g. AccuEnergy or Eastron) using any uart port. But then a MAX485 is needed to convert the levels.
So you can already use this I2C to UART chip with RS485, but not using any specific features of that chip.
Re: Support for PZEM 004T Energy monitor
dear community,
I have several pzem 004t V3.0 that work really really fine. There is no problem in stability - nothing, BUT...
...Now I have found that only the consumption is displayed, but not the direction of current flow. It is not possible to tell whether, for example, a photovoltaic system is feeding electricity into the grid or whether the displayed value represents the consumption in the house (I measure the current at L1, L2, L3 after the electricity meter).
Is there a possibility with the PZEM to recognize whether electricity is fed in or drawn from the electricity supplier?
I look forward to your ideas.
I have several pzem 004t V3.0 that work really really fine. There is no problem in stability - nothing, BUT...
...Now I have found that only the consumption is displayed, but not the direction of current flow. It is not possible to tell whether, for example, a photovoltaic system is feeding electricity into the grid or whether the displayed value represents the consumption in the house (I measure the current at L1, L2, L3 after the electricity meter).
Is there a possibility with the PZEM to recognize whether electricity is fed in or drawn from the electricity supplier?
I look forward to your ideas.
Re: Support for PZEM 004T Energy monitor
The only way how the direction can be measured with inductor based measurement is when you also measure the voltage at the same time.
And even then it is a bit tricky as you need to determine the phase shift between current and voltage to see which direction the current flows.
I think this is "omitted" on purpose as there is quite a big chance you get false readings, for example when connecting an inductive or capacitive load.
For example an electromotor, or (cheap) switching power supplies.
What I did to measure my solar panels, was using an Eastron module separately for my solar panels.
To compute the total consumption, you still need the current direction of the house. I tapped into the P1 port of my "smart" meter.
To summarize, I totally understand why you need to know the current flow, but I don't think it is possible how you're doing it now.
What you must do to achieve what you want is, you should feed in your production and only measure with the clamps the consumption part.
But I am not sure if that's easy to achieve as you can't simply split the thick main wires (6 mm^2 or more I assume?) and those clamps also need space.
And even then it is a bit tricky as you need to determine the phase shift between current and voltage to see which direction the current flows.
I think this is "omitted" on purpose as there is quite a big chance you get false readings, for example when connecting an inductive or capacitive load.
For example an electromotor, or (cheap) switching power supplies.
What I did to measure my solar panels, was using an Eastron module separately for my solar panels.
To compute the total consumption, you still need the current direction of the house. I tapped into the P1 port of my "smart" meter.
To summarize, I totally understand why you need to know the current flow, but I don't think it is possible how you're doing it now.
What you must do to achieve what you want is, you should feed in your production and only measure with the clamps the consumption part.
But I am not sure if that's easy to achieve as you can't simply split the thick main wires (6 mm^2 or more I assume?) and those clamps also need space.
Re: Support for PZEM 004T Energy monitor
I already thought that it would be very difficult. The problem is that the balcony power plant does not feed in separately, but is simply attached to a phase. This means that there is no dedicated point at which only the electricity is fed in (electricity produced) and no point at which it is only consumed.
I can measure the electricity generated, but I cannot tell whether electricity is being fed into the grid or whether electricity is being drawn.
E.g. 300 watts are generated and fed into L1 and I measure 200 watts on L1 ... then it could be that I only use 100 watts on L1 and 200 watts are fed in ... but it could also be that I produce 300W and consume 500W on L1 (drawing 200 watts).
This is going to be a difficult topic ... I can already see it![Bedroeft :-(](./images/smilies/icon_e_sad.gif)
I can measure the electricity generated, but I cannot tell whether electricity is being fed into the grid or whether electricity is being drawn.
E.g. 300 watts are generated and fed into L1 and I measure 200 watts on L1 ... then it could be that I only use 100 watts on L1 and 200 watts are fed in ... but it could also be that I produce 300W and consume 500W on L1 (drawing 200 watts).
This is going to be a difficult topic ... I can already see it
![Bedroeft :-(](./images/smilies/icon_e_sad.gif)
Re: Support for PZEM 004T Energy monitor
As long as you can't detect direction, then you also cannot deduct the actual netto consumption/production.
So you only can handle it if you measure the current, where the current only can go in 1 direction (well given it is AC the current does alternate, but you get the idea
)
If your solar converter is only using 1 fase, you might want to re-route that one wire to be able to split it.
But remember this is probably one that cannot be turned off and it really is a stiff wire. Here in the Netherlands those wires often are 6 mm^2 solid copper, which you hardly can bend using your hands.
Also you need to have a proper power rail to mount the 3 wires into (one from the grid, one to your fuse for the solar and one to the other groups on that phase)
Don't do it yourself if you cannot remove the main fuse, or turn the power off.
I once did it myself, with the help of a neighbor who was allowed to replace meters and had the tools (and seals and experience) to help me with it.
Still it felt a bit uncomfortable, when the lid to the mains fuses was removed to pull those out. Even though he did it and not me.
You could still accidentally drop in something which would not be protected by a fuse, so I still was a bit nervous when replacing my own fuse box, even though the main fuses were removed.
It really is something to be careful, when operating with unfused mains voltage. Only protected by the main fuses, I still consider quite dangerous as those are "slow" fuses and will only pop when you draw really a lot of current or draw several tens of amps for a longer time.
So you only can handle it if you measure the current, where the current only can go in 1 direction (well given it is AC the current does alternate, but you get the idea
![Lach :)](./images/smilies/icon_e_smile.gif)
If your solar converter is only using 1 fase, you might want to re-route that one wire to be able to split it.
But remember this is probably one that cannot be turned off and it really is a stiff wire. Here in the Netherlands those wires often are 6 mm^2 solid copper, which you hardly can bend using your hands.
Also you need to have a proper power rail to mount the 3 wires into (one from the grid, one to your fuse for the solar and one to the other groups on that phase)
Don't do it yourself if you cannot remove the main fuse, or turn the power off.
I once did it myself, with the help of a neighbor who was allowed to replace meters and had the tools (and seals and experience) to help me with it.
Still it felt a bit uncomfortable, when the lid to the mains fuses was removed to pull those out. Even though he did it and not me.
You could still accidentally drop in something which would not be protected by a fuse, so I still was a bit nervous when replacing my own fuse box, even though the main fuses were removed.
It really is something to be careful, when operating with unfused mains voltage. Only protected by the main fuses, I still consider quite dangerous as those are "slow" fuses and will only pop when you draw really a lot of current or draw several tens of amps for a longer time.
Re: Support for PZEM 004T Energy monitor
Where can I find a working latest build with PZEM 004T Energy monitor support for ESP32 / ESP8266?
Re: Support for PZEM 004T Energy monitor
I have this installed: ESP_Easy_mega_20211003_energy_ESP8266_4M1M Oct 3 2021
Re: Support for PZEM 004T Energy monitor
Yes, it is in the .zip file for ESP32 you can download from the Github Release page
/Ton (PayPal.me)
Re: Support for PZEM 004T Energy monitor
I don't see PZEM 004T Energy monitor in the listkini wrote: ↑13 Jan 2022, 10:41I have this installed: ESP_Easy_mega_20211003_energy_ESP8266_4M1M Oct 3 2021
Re: Support for PZEM 004T Energy monitor
The plugin name is somewhat non-standard, missing the 'Energy (AC) - ' prefix, this is in the current source: '# define PLUGIN_NAME_102 "PZEM-004Tv30-Multiple [TESTING]"'
/Ton (PayPal.me)
Re: Support for PZEM 004T Energy monitor
Sorry for asking this stupid question - but after reading mostly all of the thread and testing something on my own it's still not clear to me:
How many indepented PZEM-OO4T will I be able to use on a ESP32 using EspEasy - WITHOUT - any I2C-UART exentsion boards?
I naivly thought it might be at least three since the ESP32 supports three HW-UARTs - but as also mentioned here perviously - It seems that only one HW-Serial could be used (the one which is defined for the first PZEM module).
There is also this hint:
How could I "invert Tx and Rx" ?
And even when I "invert" this - how could I use two or three PZEM-004T at the same time?
Do they need to connect to the same UART pins - and do I need to progam/set first different adresses to the serveral PZEM-modules?
What is also strange: In Post #242 (link see below) there is the possibility to select "Software Serial" in the interface settings of the PZEM-module.
viewtopic.php?p=47459#p47459
But when using the latest EspEasy-Build (see end of this post) on ESP32 then I can only choose from "I2C Serial, HW Serial0,HW Serial1,HW Serial2" - but no way to choose "Software Serial". I would appreciate any helpful suggestions/explanations.
Thanks.
P.S. I using currently a ESP32 Dev borad (Node32S) with ESP_Easy_mega_20211224_energy_ESP32_4M316k - and try to get three PZEM-004T working - for only one it's working fine while using HW serial.![Erg Blij :D](./images/smilies/icon_e_biggrin.gif)
How many indepented PZEM-OO4T will I be able to use on a ESP32 using EspEasy - WITHOUT - any I2C-UART exentsion boards?
I naivly thought it might be at least three since the ESP32 supports three HW-UARTs - but as also mentioned here perviously - It seems that only one HW-Serial could be used (the one which is defined for the first PZEM module).
There is also this hint:
Especially the part in brackets of the hint above is a mystery for me.This PZEM is the first. Its configuration of serial Pins will affect next PZEM.
If several PZEMs foreseen, don't use HW serial (or invert Tx and Rx to configure as SW serial).
How could I "invert Tx and Rx" ?
And even when I "invert" this - how could I use two or three PZEM-004T at the same time?
Do they need to connect to the same UART pins - and do I need to progam/set first different adresses to the serveral PZEM-modules?
What is also strange: In Post #242 (link see below) there is the possibility to select "Software Serial" in the interface settings of the PZEM-module.
viewtopic.php?p=47459#p47459
But when using the latest EspEasy-Build (see end of this post) on ESP32 then I can only choose from "I2C Serial, HW Serial0,HW Serial1,HW Serial2" - but no way to choose "Software Serial". I would appreciate any helpful suggestions/explanations.
Thanks.
P.S. I using currently a ESP32 Dev borad (Node32S) with ESP_Easy_mega_20211224_energy_ESP32_4M316k - and try to get three PZEM-004T working - for only one it's working fine while using HW serial.
![Erg Blij :D](./images/smilies/icon_e_biggrin.gif)
Re: Support for PZEM 004T Energy monitor
Hello,
is there this sue plugin (PZEM004) for WT32 ETH01 board
I couldn't find a binary file for this board with this plugin.
thank you
sorry for my english....google translate !
is there this sue plugin (PZEM004) for WT32 ETH01 board
I couldn't find a binary file for this board with this plugin.
thank you
sorry for my english....google translate !
sorry for my English ! i use google translat.
Re: Support for PZEM 004T Energy monitor
That combination (ENERGY + ETH) currently isn't available, and the same goes for the DISPLAY build.
I'll see what can be done about that.
I'll see what can be done about that.
/Ton (PayPal.me)
Re: Support for PZEM 004T Energy monitor
all my gratitude if this version existed !Cette combinaison (ENERGY + ETH) n'est actuellement pas disponible, et il en va de même pour la version DISPLAY.
Je vais voir ce qu'on peut faire à ce sujet.
Supercalifragilisticexpialidocious !
sorry for my English ! i use google translat.
Re: Support for PZEM 004T Energy monitor
As no one else here seems to have answers I would like to share with those, who might also interested in an answer or try to using this hardware, what I have found out so far:
1) On the current latest ESP32 version there is no opportunity to use "Software Serial" for PZEM-004T - whereas in the ESP8266 version it is possible. No idea why "SoftwareSerial" is not available on ESP32 - maybe anybody here knows that? But in the end it doesn’t matters for me, as ESP32 seems to be having no advantage (as independent HW serial buses couldn’t be used for PZEM by ESPEasy) I switched back to an ESP8226.
2) On ESP8266 it is possible to use multiple PZEM-004T (with "Software Serial)" by first - programming a unique address to each device.
Note: one only device must be connected to the serial bus at that time.
Second: When each device has it's unique address, connecting all RX-PINs of all PZEM-004T together to the TX-PIN of ESP8266 and all TX-PINs from all PZEM-004T together to the RX-PIN of the ESP8226.
Note: the ESP8266 and ESP32 might not be 5 Volt tolerant - there are many "magic" circuits plans published when you search for it in the Web to avoid damage to ESP8266 and ESP32 - but there are also posts saying that they run this scenario even without additional measure for years without any damage of the ESP8266/ESP32.
Having said this: It's up to you how risk-taking you'll be. I have used/tried it on both ESP32/ESP8266 without any measure - and both boards are still working fine. The only thing I have introduce now is a 200 Ohm resistor between the TX-side of the PZEMs and the RX-side of the ESP8266 (like I have used for years now on CO2 projects with Senseair S8 without problems)
There are also circuits plans with diodes and pull up resistors (e.g. https://user-images.githubusercontent.c ... d35db8.jpg) but for me it's working even without that additional components. But it might be useful if it's not working for you to give it a try.
I would expect that such information would be available in the ESPEasy wiki or in the "help" link in the device definition in ESPEasy - but there is currently only a link to Plugin102 - with no content on it.
![Huilen :cry:](./images/smilies/icon_cry.gif)
So, currently I running three PZEM-004T in parallel on an ESP8266 with SoftwareSerial and the above mentioned setup.
Re: Support for PZEM 004T Energy monitor
Yes this is exatcly like that. To configure the adress, only one PZEM should be connected at time. Once each PZEM is configured, then all Tx can be connected together and all Rx can be connected together. Only one UART (HW or SW) is necessary: I test with 4 PZEM, but should work with more.2) On ESP8266 it is possible to use multiple PZEM-004T (with "Software Serial)" by first - programming a unique address to each device.
Note: one only device must be connected to the serial bus at that time.
It means that if you want to use GPIO3(Rx) and GPIO1(Tx) with several PZEM, it is possible under condition that you configure as SW serial and wire GPIO3 on PZEM RX and GPIO1 on PZEM TX. If you make a regular connection GPIO3 on PZEM TX and GPIO1 on PZEM RX, it will run as HW serial but a bug exists where some frames of PZEM are sometime missed.This PZEM is the first. Its configuration of serial Pins will affect next PZEM.
If several PZEMs foreseen, don't use HW serial (or invert Tx and Rx to configure as SW serial).
Especially the part in brackets of the hint above is a mystery for me.
How could I "invert Tx and Rx" ?
-
- Normal user
- Posts: 15
- Joined: 01 May 2019, 00:24
Re: Support for PZEM 004T Energy monitor
Hello,
Can someone explain to me something about the PZEM?
The value from Energy_WH it's the total consumption from the beginning of the device till the present?
If i want to see all the power used from Day1 to Day2, i need to make the sum from day1 to day2.
do I have to reduce the consumption of day 1 from day 2?
I want to understand the logic because i want to calculate the price of the energy used.
It gives me a headache
Thank you!
Can someone explain to me something about the PZEM?
The value from Energy_WH it's the total consumption from the beginning of the device till the present?
If i want to see all the power used from Day1 to Day2, i need to make the sum from day1 to day2.
do I have to reduce the consumption of day 1 from day 2?
I want to understand the logic because i want to calculate the price of the energy used.
It gives me a headache
Thank you!
Re: Support for PZEM 004T Energy monitor
Hello
Energy_WH is the total power consumption since the PZEM is first powered (it is power loss tolerant).
So each day, the Energy_WH value is higher than previous day. So Day1 consumption =Day2 @ 00h00 - Day1 @ 00h00
Or you can reset the Energy_WH value at the begining of each day and then get the value without any calculation at the end on the current day.
Reminder to reset the value:
http://*espeasyip*/control?cmd=resetenergy,*PZEM address*
Energy_WH is the total power consumption since the PZEM is first powered (it is power loss tolerant).
So each day, the Energy_WH value is higher than previous day. So Day1 consumption =Day2 @ 00h00 - Day1 @ 00h00
Or you can reset the Energy_WH value at the begining of each day and then get the value without any calculation at the end on the current day.
Reminder to reset the value:
http://*espeasyip*/control?cmd=resetenergy,*PZEM address*
-
- Normal user
- Posts: 15
- Joined: 01 May 2019, 00:24
Re: Support for PZEM 004T Energy monitor
But something is not right and I don't know how to test it.
How it's possible to consume in 24 hours just 308.35Wh?
I have a server that consumes 130w. a switch with 50W, some lights and a laptop.
It's there a way to check it?
Thanks!
Also, does espeasy store the last value in case of a power failure?
How it's possible to consume in 24 hours just 308.35Wh?
I have a server that consumes 130w. a switch with 50W, some lights and a laptop.
It's there a way to check it?
Thanks!
Also, does espeasy store the last value in case of a power failure?
Re: Support for PZEM 004T Energy monitor
About energy unit:
< 10 kWh, unit is Wh (1 kWh= 1000 Wh), such as : 9999 Wh.
10 kWh and more,unit is kWh, such as : 9999,99 kWh
So if your pzem is running for a long time, then the unit is kWh.
1. What type of current probe do you use ? If open one, be sure that it is stongly closed around a single wire.
2. When you say 130W, how do you get this information ? a measurement or on the label ? Because on the label, it is a maximum.
3. It's there a way to check it? => Have a look at Power_W value to confirm the mean value ~13W (indeed it's low, so check 1.).
4. Values are stored in PZEM directly. Neither calculation, nor mesurement are performed at ESP level. Everything is made by PZEM. Only communication to retreive value is performed by ESP. In case of power loss, value will be restore in ESP as soon as PZEM sends its values.
< 10 kWh, unit is Wh (1 kWh= 1000 Wh), such as : 9999 Wh.
10 kWh and more,unit is kWh, such as : 9999,99 kWh
So if your pzem is running for a long time, then the unit is kWh.
1. What type of current probe do you use ? If open one, be sure that it is stongly closed around a single wire.
2. When you say 130W, how do you get this information ? a measurement or on the label ? Because on the label, it is a maximum.
3. It's there a way to check it? => Have a look at Power_W value to confirm the mean value ~13W (indeed it's low, so check 1.).
4. Values are stored in PZEM directly. Neither calculation, nor mesurement are performed at ESP level. Everything is made by PZEM. Only communication to retreive value is performed by ESP. In case of power loss, value will be restore in ESP as soon as PZEM sends its values.
Re: Support for PZEM 004T Energy monitor
how to connect wemos d1 mini properly with pzem 004T v3.0 100A? schematic rx / tx as in this picture
can i use 3.3v with the same schematic or do I need a
1k ohm resistor, from the 5v pin in the optocoupler
Or
can i use 3.3v with the same schematic or do I need a
1k ohm resistor, from the 5v pin in the optocoupler
Or
Re: Support for PZEM 004T Energy monitor
@mojso
Supply PZEM with 5V directly (as your first schematic. No 1k requested). But don't use D3 and D4 for communication because these pin can prevent ESP to boot. D1,D2 can be used in place.
Supply PZEM with 5V directly (as your first schematic. No 1k requested). But don't use D3 and D4 for communication because these pin can prevent ESP to boot. D1,D2 can be used in place.
Re: Support for PZEM 004T Energy monitor
thanks for the reply. in espeasy pzem settings d1 and d2 are not allowed
maybe D6 and D7 will be ok to use
Who is online
Users browsing this forum: No registered users and 44 guests