Support for PZEM 004T Energy monitor
Moderators: grovkillen, Stuntteam, TD-er
Re: Support for PZEM 004T Energy monitor
Thank you very much.
Yes, it is very strange. I have cleaned the project and compiled it again but no luck... I dont understand what it is going on. I am using last mega release.
Any other suggestion will be appreciated.
kind regards,
Yes, it is very strange. I have cleaned the project and compiled it again but no luck... I dont understand what it is going on. I am using last mega release.
Any other suggestion will be appreciated.
kind regards,
Re: Support for PZEM 004T Energy monitor
Hello everybody,
My energy measurement is operationnal by following this post and this one http://www.domoticz.com/forum/viewtopic ... 14&t=20820
I use an ESP8266_4096.
But I have a problem :
- if I boot my ESP connected to the PZEM. My ESP doesn't start (no effect if I push on RESET button),
- If I boot my ESP (not connected to the PZEM), this one start normaly and after i can connect the PZEM to the ESP and the Energy measurement is OK.
This problem is painful because if i have a power cut, my Energy measurement does not restart.
Can you help me ?
Thanks in advance.
My energy measurement is operationnal by following this post and this one http://www.domoticz.com/forum/viewtopic ... 14&t=20820
I use an ESP8266_4096.
But I have a problem :
- if I boot my ESP connected to the PZEM. My ESP doesn't start (no effect if I push on RESET button),
- If I boot my ESP (not connected to the PZEM), this one start normaly and after i can connect the PZEM to the ESP and the Energy measurement is OK.
This problem is painful because if i have a power cut, my Energy measurement does not restart.
Can you help me ?
Thanks in advance.
Re: Support for PZEM 004T Energy monitor
Maybe you connected the sensor to one of the pins needed to indicate the boot-mode?
For example GPIO0, which is connected to the "Flash" button on NodeMCU boards, will put the ESP into flash mode when pressed.
I can imagine the sensor will do the same when connected to that pin.
For example GPIO0, which is connected to the "Flash" button on NodeMCU boards, will put the ESP into flash mode when pressed.
I can imagine the sensor will do the same when connected to that pin.
Re: Support for PZEM 004T Energy monitor
I modified the GPIO pin : GPIO-12 and 13 instead of GPIO-14 and 15 and all is OK.Dim33 wrote: ↑29 Aug 2018, 00:16 Hello everybody,
My energy measurement is operationnal by following this post and this one http://www.domoticz.com/forum/viewtopic ... 14&t=20820
I use an ESP8266_4096.
But I have a problem :
- if I boot my ESP connected to the PZEM. My ESP doesn't start (no effect if I push on RESET button),
- If I boot my ESP (not connected to the PZEM), this one start normaly and after i can connect the PZEM to the ESP and the Energy measurement is OK.
This problem is painful because if i have a power cut, my Energy measurement does not restart.
Can you help me ?
Thanks in advance.
Re: Support for PZEM 004T Energy monitor
Hi there,
I've got a PZEM an tried to compile, but got same "multiple definition" error, as miki_tnt :
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\SoftwareSerial.cpp.o: In function `sws_isr_0()':
SoftwareSerial.cpp:(.iram.text+0xd0): multiple definition of `sws_isr_0()'
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\ESPeasySoftwareSerial.cpp.o:ESPeasySoftwareSerial.cpp:(.iram.text+0xd4): first defined here
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\SoftwareSerial.cpp.o: In function `sws_isr_1()':
SoftwareSerial.cpp:(.iram.text+0xe8): multiple definition of `sws_isr_1()'
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\ESPeasySoftwareSerial.cpp.o:ESPeasySoftwareSerial.cpp:(.iram.text+0xec): first defined here
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\SoftwareSerial.cpp.o: In function `sws_isr_2()':
SoftwareSerial.cpp:(.iram.text+0x100): multiple definition of `sws_isr_2()'
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\ESPeasySoftwareSerial.cpp.o:ESPeasySoftwareSerial.cpp:(.iram.text+0x104): first defined here
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z21Plugin171_ReadVoltagev+0x8): undefined reference to `PZEM004T::voltage(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o: In function `Plugin171_ReadVoltage()':
ESPEasy.ino.cpp:(.text._Z21Plugin171_ReadVoltagev+0x25): undefined reference to `PZEM004T::voltage(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z21Plugin171_ReadCurrentv+0x0): undefined reference to `PZEM004T::current(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z21Plugin171_ReadCurrentv+0x1d): undefined reference to `PZEM004T::current(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z19Plugin171_ReadPowerv+0x0): undefined reference to `PZEM004T::power(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z19Plugin171_ReadPowerv+0x1d): undefined reference to `PZEM004T::power(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z20Plugin171_ReadEnergyv+0x0): undefined reference to `PZEM004T::energy(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o: In function `Plugin171_ReadEnergy()':
ESPEasy.ino.cpp:(.text._Z20Plugin171_ReadEnergyv+0x1d): undefined reference to `PZEM004T::energy(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z10Plugin_171hP11EventStructR6String+0x1c): undefined reference to `PZEM004T::PZEM004T(unsigned char, unsigned char)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z10Plugin_171hP11EventStructR6String+0x20): undefined reference to `PZEM004T::setAddress(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o: In function `Plugin_171(unsigned char, EventStruct*, String&)':
ESPEasy.ino.cpp:(.text._Z10Plugin_171hP11EventStructR6String+0x14e): undefined reference to `PZEM004T::PZEM004T(unsigned char, unsigned char)'
ESPEasy.ino.cpp:(.text._Z10Plugin_171hP11EventStructR6String+0x15b): undefined reference to `PZEM004T::setAddress(IPAddress con
.....
.....
....
Is there any suggestion to overcome this issue ?
Perhaps something changed in libraries, etc. in the last months ?
Thanx & Regards
Paolo
I've got a PZEM an tried to compile, but got same "multiple definition" error, as miki_tnt :
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\SoftwareSerial.cpp.o: In function `sws_isr_0()':
SoftwareSerial.cpp:(.iram.text+0xd0): multiple definition of `sws_isr_0()'
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\ESPeasySoftwareSerial.cpp.o:ESPeasySoftwareSerial.cpp:(.iram.text+0xd4): first defined here
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\SoftwareSerial.cpp.o: In function `sws_isr_1()':
SoftwareSerial.cpp:(.iram.text+0xe8): multiple definition of `sws_isr_1()'
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\ESPeasySoftwareSerial.cpp.o:ESPeasySoftwareSerial.cpp:(.iram.text+0xec): first defined here
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\SoftwareSerial.cpp.o: In function `sws_isr_2()':
SoftwareSerial.cpp:(.iram.text+0x100): multiple definition of `sws_isr_2()'
.pioenvs\test_ESP8266_4096\lib46c\ESPEasySoftwareSerial\ESPeasySoftwareSerial.cpp.o:ESPeasySoftwareSerial.cpp:(.iram.text+0x104): first defined here
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z21Plugin171_ReadVoltagev+0x8): undefined reference to `PZEM004T::voltage(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o: In function `Plugin171_ReadVoltage()':
ESPEasy.ino.cpp:(.text._Z21Plugin171_ReadVoltagev+0x25): undefined reference to `PZEM004T::voltage(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z21Plugin171_ReadCurrentv+0x0): undefined reference to `PZEM004T::current(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z21Plugin171_ReadCurrentv+0x1d): undefined reference to `PZEM004T::current(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z19Plugin171_ReadPowerv+0x0): undefined reference to `PZEM004T::power(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z19Plugin171_ReadPowerv+0x1d): undefined reference to `PZEM004T::power(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z20Plugin171_ReadEnergyv+0x0): undefined reference to `PZEM004T::energy(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o: In function `Plugin171_ReadEnergy()':
ESPEasy.ino.cpp:(.text._Z20Plugin171_ReadEnergyv+0x1d): undefined reference to `PZEM004T::energy(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z10Plugin_171hP11EventStructR6String+0x1c): undefined reference to `PZEM004T::PZEM004T(unsigned char, unsigned char)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o:(.text._Z10Plugin_171hP11EventStructR6String+0x20): undefined reference to `PZEM004T::setAddress(IPAddress const&)'
.pioenvs\test_ESP8266_4096\src\ESPEasy.ino.cpp.o: In function `Plugin_171(unsigned char, EventStruct*, String&)':
ESPEasy.ino.cpp:(.text._Z10Plugin_171hP11EventStructR6String+0x14e): undefined reference to `PZEM004T::PZEM004T(unsigned char, unsigned char)'
ESPEasy.ino.cpp:(.text._Z10Plugin_171hP11EventStructR6String+0x15b): undefined reference to `PZEM004T::setAddress(IPAddress con
.....
.....
....
Is there any suggestion to overcome this issue ?
Perhaps something changed in libraries, etc. in the last months ?
Thanx & Regards
Paolo
Re: Support for PZEM 004T Energy monitor
Would it give advice to throw the plugin into the latest software. PZEM has been working very well for me for half a year but I miss some features from the new software.
Greetings.
Greetings.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Support for PZEM 004T Energy monitor
Please open an issue for it on GitHub and ask the maintainer to add it as a PR.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Support for PZEM 004T Energy monitor
Thank you very much for your answer.
I did what you wrote.
Greetings.
GieBek
I did what you wrote.
Greetings.
GieBek
Re: Support for PZEM 004T Energy monitor
I am not getting correct value for Watts when i did the calculation, example as below
Actual reading from meter = 232.20 Volts , 2.89 Amps, 665.00 Watts, 1311707.00 KWH
232.20 x 2.89 = 671.06 Watts, but in the meter it shows 665.00, can i know why its not accurate ?
Thanks in advance.
Actual reading from meter = 232.20 Volts , 2.89 Amps, 665.00 Watts, 1311707.00 KWH
232.20 x 2.89 = 671.06 Watts, but in the meter it shows 665.00, can i know why its not accurate ?
Thanks in advance.
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: Support for PZEM 004T Energy monitor
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
-
- New user
- Posts: 6
- Joined: 16 Jan 2019, 22:00
Re: Support for PZEM 004T Energy monitor
I also have some problem with building this project
I have two builds ESPEasy_mega-20181231 and latest with changed Softwareserial library
ESPEasy_mega-20181231 compiles without error only if espsoftwareserial-3.2.3 used
20190110 compiles with new ESPEasySerial library also without any errors
But both firmwares always shows me 0.00, even old version mega 2.00 dev
I think that is not a hardware problem, wifi-iot firmware works fine, but with the hardware serial.
Im already tried to change GPIOs to another with the same result.
Interesting that is no voltage measuring in the log, A W Wh only
I have two builds ESPEasy_mega-20181231 and latest with changed Softwareserial library
ESPEasy_mega-20181231 compiles without error only if espsoftwareserial-3.2.3 used
20190110 compiles with new ESPEasySerial library also without any errors
But both firmwares always shows me 0.00, even old version mega 2.00 dev
I think that is not a hardware problem, wifi-iot firmware works fine, but with the hardware serial.
Im already tried to change GPIOs to another with the same result.
Interesting that is no voltage measuring in the log, A W Wh only
- Attachments
-
- Снимок.JPG (100.53 KiB) Viewed 1581176 times
Re: Support for PZEM 004T Energy monitor
Hi guys,
I got working on one esp-12f 6 of PZEM 004T. Probably I could connect up to 8 PZEM in the same time to one esp-12f.
The idea was to use many PZEM 004T on one esp-12f without using address of each one. I connected each one in parallel with RX, TX, and GND. For select with whom I am communicating right now I decided to use esp-12f ports.
If anyone interested I would share my schematic and plugin.
Thank you.
I got working on one esp-12f 6 of PZEM 004T. Probably I could connect up to 8 PZEM in the same time to one esp-12f.
The idea was to use many PZEM 004T on one esp-12f without using address of each one. I connected each one in parallel with RX, TX, and GND. For select with whom I am communicating right now I decided to use esp-12f ports.
If anyone interested I would share my schematic and plugin.
Thank you.
- Attachments
-
- IMG_20190330_161357_750.jpg (73.95 KiB) Viewed 1579899 times
-
- IMG_20190330_105736.jpg (2.54 MiB) Viewed 1579899 times
Re: Support for PZEM 004T Energy monitor
I'm interested - can you send me plugin ?
Also you can share public
Also you can share public
Re: Support for PZEM 004T Energy monitor
Hi serjkru,
I'm very interested, too! This seems to have a good fit with the direction I'd like to take, which is to measure power use in each (main) circuit in my house.
I'd be very happy if you could share your schematic and plugin, please.
Thanks in advance,
Andrew
I'm very interested, too! This seems to have a good fit with the direction I'd like to take, which is to measure power use in each (main) circuit in my house.
I'd be very happy if you could share your schematic and plugin, please.
Thanks in advance,
Andrew
Re: Support for PZEM 004T Energy monitor
Hi guys,
Thank you for your interest.
There is a pdf how to connect them
Plugin for PZEM-004T.(I used one from playground but change it a lot)
Also I had to change Software serial ESPeasySoftwareSerial.cpp because original didnot work.
I think I did not mess something.
If you have a question, do not hesitate!
Thank you for your interest.
There is a pdf how to connect them
Plugin for PZEM-004T.(I used one from playground but change it a lot)
Also I had to change Software serial ESPeasySoftwareSerial.cpp because original didnot work.
I think I did not mess something.
If you have a question, do not hesitate!
- Attachments
-
- PZEM-004T.zip
- (693.54 KiB) Downloaded 3950 times
Last edited by serjkru on 02 Apr 2019, 02:16, edited 1 time in total.
Re: Support for PZEM 004T Energy monitor
If someone use OpenHab there is sample:
items
sitemap
items
Code: Select all
Number Sensor_Laundry_Voltage "Laundry [%.1f V]" <voltage>(Home) [ "LaundryVoltage" ] { mqtt="<[myhome:/HouseVACMeter/PZEM_1/Voltage(V):state:default]" }
Number Sensor_Laundry_Current "Laundry [%.1f A]" <current>(Home) [ "LaundryCurrent" ] { mqtt="<[myhome:/HouseVACMeter/PZEM_1/Current(A):state:default]" }
Number Sensor_Laundry_Power "Laundry [%.1f W]" <power> (Home) [ "LaundryPower" ] { mqtt="<[myhome:/HouseVACMeter/PZEM_1/Power(W):state:default]" }
Number Sensor_Laundry_Energy "Laundry [%.1f Wh]" <energy> (Home) [ "LaundryEnergy" ] { mqtt="<[myhome:/HouseVACMeter/PZEM_1/Energy(Wh):state:default]" }
Code: Select all
Frame label="House Sensors" icon="house"{
Text label="Power management" icon="power" {
Text label="Laundry" icon="energy" {
Text item=Sensor_Laundry_Voltage label="Voltage" icon="energy"
Text item=Sensor_Laundry_Current label="Current" icon="energy"
Text item=Sensor_Laundry_Power label="Power" icon="energy"
Text item=Sensor_Laundry_Energy label="Energy" icon="energy"
}
}
}
Re: Support for PZEM 004T Energy monitor
Hi guys,
I have developed many projects for my smart house but not sure when I should post them.
If someone lives in US or Canada, you might be interested in WiFi wall switch.
My idea was to use jst regular wall switch and put all elecrtonics right under switch button. You can see it on the photoes:
It is dimmable switch with two buttons.
I created plugin for it as well and connected to OpenHab.
Also I developed two version of Humidity/Temperature/Pressure devices. I use BME280 as sensor.
One of them looks like usb stick for remoute mouse or keyboard another one a little bit bigger.
I have developed many projects for my smart house but not sure when I should post them.
If someone lives in US or Canada, you might be interested in WiFi wall switch.
My idea was to use jst regular wall switch and put all elecrtonics right under switch button. You can see it on the photoes:
It is dimmable switch with two buttons.
I created plugin for it as well and connected to OpenHab.
Also I developed two version of Humidity/Temperature/Pressure devices. I use BME280 as sensor.
One of them looks like usb stick for remoute mouse or keyboard another one a little bit bigger.
- Attachments
-
- usb BME280.png (2.84 MiB) Viewed 1579855 times
-
- Light3.png (3.56 MiB) Viewed 1579858 times
-
- Light2.png (4.63 MiB) Viewed 1579858 times
-
- Light.png (72.34 KiB) Viewed 1579858 times
Re: Support for PZEM 004T Energy monitor
@serjkru.
Please could you post the wiring schematic for the PZEM-004 modules to the ESP-8266 module,I do not see the pdf file.
Looking at the wiring picture posted earlier, you are sequentially supplying power to the PZEM modules and taking readings to send to openhab.
Good idea to save IO pins !
Thanks
Please could you post the wiring schematic for the PZEM-004 modules to the ESP-8266 module,I do not see the pdf file.
Looking at the wiring picture posted earlier, you are sequentially supplying power to the PZEM modules and taking readings to send to openhab.
Good idea to save IO pins !
Thanks
Re: Support for PZEM 004T Energy monitor
Cheers mate.
Very nice work !
Very nice work !
Re: Support for PZEM 004T Energy monitor
Very good idea.
What is the reading time of all sensors?
How often can you read?
What is the reading time of all sensors?
How often can you read?
Re: Support for PZEM 004T Energy monitor
Hi Guys!
Thank you Serjkru for firmware. I tried with two device (Wemos D1 4 MB, and Wemos D1 mini 4 MB), but I did not found the Voltage & Current (AC) in device list.
Where did I go wrong?
Thank you
Best
Tamas
Thank you Serjkru for firmware. I tried with two device (Wemos D1 4 MB, and Wemos D1 mini 4 MB), but I did not found the Voltage & Current (AC) in device list.
Where did I go wrong?
Thank you
Best
Tamas
Re: Support for PZEM 004T Energy monitor
"P183-Voltage & Current (AC) - PZEM-004T" almost at the end of the list of devices
Re: Support for PZEM 004T Energy monitor
I did not found.
Here is the picture about the last devices.
Thank you
Best
Tamas
Here is the picture about the last devices.
Thank you
Best
Tamas
Re: Support for PZEM 004T Energy monitor
Try with attached file
- Attachments
-
- firmware_PZEM004T multiple.zip
- (584.94 KiB) Downloaded 3537 times
Re: Support for PZEM 004T Energy monitor
RobertM, you are GENIUS!
It works!
Thank you very much!
Best
Tamas
It works!
Thank you very much!
Best
Tamas
Re: Support for PZEM 004T Energy monitor
serjkru Why did you removed R15?
And why you swap R17 to 120 Ohm except 510 Ohm?
It would not be enough to solder 1k resistor as in the picture?
And why you swap R17 to 120 Ohm except 510 Ohm?
It would not be enough to solder 1k resistor as in the picture?
Re: Support for PZEM 004T Energy monitor
Hi all,
I'm using the firmware provided by serjkru and is working fine (pzem-004t v2.0)...good job
I have another question: is it possible to use the PZEM-004T V3.0 ? The firmware on the board has changed and I think the protocol is different, so no communication with esp.
The last board I got is 3.0
Anyone is working with that kind of board ?
Thank you
Gianluca
I'm using the firmware provided by serjkru and is working fine (pzem-004t v2.0)...good job
I have another question: is it possible to use the PZEM-004T V3.0 ? The firmware on the board has changed and I think the protocol is different, so no communication with esp.
The last board I got is 3.0
Anyone is working with that kind of board ?
Thank you
Gianluca
Re: Support for PZEM 004T Energy monitor
you should have used USPS service, it is very good
Now USPS employees can use liteblue portal (liteblue usps gov) to get all the benefits.
Re: Support for PZEM 004T Energy monitor
Hi I ordered PZEM-004 and got V3.0 version.
This version have new mdbus MTU protocol.
Someone tried develop a plugin?
This version have new mdbus MTU protocol.
Someone tried develop a plugin?
Re: Support for PZEM 004T Energy monitor
Friends, I bought PZEM 004t v3, he refused to work on this firmware. I found articles in the network, how people use the corrected libraries for the PZEM 004t v3. Maybe someone of you can download a new library and upload it with a new firmware for 4mb?
Re: Support for PZEM 004T Energy monitor
gumilev If you need only one device you can use Tasmota software.
PZEM004T v3 uses same protocol as PZEM-016 So you need set proper rx and tx gpio's in config.
PZEM004T v3 uses same protocol as PZEM-016 So you need set proper rx and tx gpio's in config.
Re: Support for PZEM 004T Energy monitor
Thanks for the advice, it really works, this is enough to transfer data using MQTT to Domoticz. However, I will continue to wait for the plugin to be updated for EspEasy. In order to run pzem004t v3.0 in tasmota - it was necessary to enter only one line:
Code: Select all
{"NAME":"HW-655 PZEM","GPIO":[0,62,0,98,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
Then we assign gpio and go configure mqtt for data transfer!
- Attachments
-
- Screenshot_20190802-030452_Chrome.jpg (422.63 KiB) Viewed 1573073 times
-
- Screenshot_20190802-030323_Chrome.jpg (336.19 KiB) Viewed 1573073 times
-
- Screenshot_20190802-030427_Chrome.jpg (378.09 KiB) Viewed 1573073 times
Re: Support for PZEM 004T Energy monitor
Can you make an issue for it on GitHub and provide a link to this topic as well.However, I will continue to wait for the plugin to be updated for EspEasy
I have to order one of these sensors too before I can work on it.
But since I've been doing a number of Modbus plugins recently I don't expect it to be very hard to do.
Is it similar to model 017?
Re: Support for PZEM 004T Energy monitor
Unfortunately, I can’t help. My copy-paste programming level, all that I could find and try, I outlined above.
Re: Support for PZEM 004T Energy monitor
Hi,
I am new to automation. I got PZEM 004t. Anyone can guide how I can add it to Home Assistant as Energy Meter. Thanks in advance
I am new to automation. I got PZEM 004t. Anyone can guide how I can add it to Home Assistant as Energy Meter. Thanks in advance
Re: Support for PZEM 004T Energy monitor
Hi guys,
This is my first post, so keep cool. I'm a great fan of ESPeasy; So I try to contribute with this code for PZEM004Tv30. I'm not a software expert so please be tolerant with me.
Hardware part:
PZEM004Tv30 can be wired in parallel without any aditionnal component: simply connect RX of PZEM together and Tx of PZEM together.
However, if programming the address, only one PZEM must be connected at once during address setting.
Software part:
If you want to use several PZEM, you need to add several occurence of the pluggin.
First occurence of pluggin allows to configure serial interface and modify address of PZEM.
Next occurence of the pluggin only allows to read an adress and reset energy
Energy can also be reset with command : http://<espeasyip>/control?cmd=resetenergy,<PZEM address> (example: "http://192.168.0.1/control?cmd=resetenergy,2" => Reset energy of the PZEM with address #2)
I modify PZEM004Tv30.h and PZEM004Tv30.cpp in order to be compatible with espeay serial. Please use it rather than official PZEM004Tv30.h and PZEM004Tv30.cpp from PZEM github.
Known restriction:
Don't use HW serial when several PZEM connected in series. Over 2 PZEM, frames conflict occurs and I don't know why. The solution is to use SW serial with GPIO3 as TX and GPIO1 as RX (or to use other pins with software serial)
I try only with WEMOS D1mini. So I compile 1M bin, but I don't test it. 4M is OK
Don't hesitate to give me your feedback. And feel free to improve my code.
Djelau
This is my first post, so keep cool. I'm a great fan of ESPeasy; So I try to contribute with this code for PZEM004Tv30. I'm not a software expert so please be tolerant with me.
Hardware part:
PZEM004Tv30 can be wired in parallel without any aditionnal component: simply connect RX of PZEM together and Tx of PZEM together.
However, if programming the address, only one PZEM must be connected at once during address setting.
Software part:
If you want to use several PZEM, you need to add several occurence of the pluggin.
First occurence of pluggin allows to configure serial interface and modify address of PZEM.
Next occurence of the pluggin only allows to read an adress and reset energy
Energy can also be reset with command : http://<espeasyip>/control?cmd=resetenergy,<PZEM address> (example: "http://192.168.0.1/control?cmd=resetenergy,2" => Reset energy of the PZEM with address #2)
I modify PZEM004Tv30.h and PZEM004Tv30.cpp in order to be compatible with espeay serial. Please use it rather than official PZEM004Tv30.h and PZEM004Tv30.cpp from PZEM github.
Known restriction:
Don't use HW serial when several PZEM connected in series. Over 2 PZEM, frames conflict occurs and I don't know why. The solution is to use SW serial with GPIO3 as TX and GPIO1 as RX (or to use other pins with software serial)
I try only with WEMOS D1mini. So I compile 1M bin, but I don't test it. 4M is OK
Don't hesitate to give me your feedback. And feel free to improve my code.
Djelau
- Attachments
-
- 4Mbin+1Mbin.zip
- (1.07 MiB) Downloaded 5787 times
Last edited by djelau on 23 Jan 2020, 07:38, edited 2 times in total.
Re: Support for PZEM 004T Energy monitor
Can you make a pull request for it on GitHub?
That's easier to discuss compared to downloading ZIP and looking at separate files.
That's easier to discuss compared to downloading ZIP and looking at separate files.
Re: Support for PZEM 004T Energy monitor
Why not. But unfortunately, I ve no knowlege about how to work with github! As said I'm a beginner.
Re: Support for PZEM 004T Energy monitor
I try to do something in "Pull requests" of ESPEasyPluginPlayground. Don't know if I'm in right way ...
Re: Support for PZEM 004T Energy monitor
I have seen your PR and already commented on it
Re: Support for PZEM 004T Energy monitor
Hello, thanks for plugin.
What kind of sensor to choose in domoticz to display data?
I have a pzem-004(V3.0) sensors, it can transmit more data than V1, can you add this data (VA, VAr, PF...) to the plugin?
Here's how, for example, in tasmota, this data is transferred:
Re: Support for PZEM 004T Energy monitor
I don't know about domoticz, because I use Jeedom.
But what I know is in Espeasy, it's not possible to have more than 4 data in a pluggin.
To bypass this, you can create a second occurence of this plugin with the same PZEM address than the first occurence. In this second occurence, you can select the other missing data that are not in the first occurence.
By the way, PZEMv3 only measures 6 parameters: Voltage, Current, Active power, Active energy, Frequency, Power factor. Other parameters that you can find in Tasmota (Apparent power, Reactive power, Today and yesterday energy) are calculated by Tasmota. It can be done with a dummy device in espeasy if you really need this information
But what I know is in Espeasy, it's not possible to have more than 4 data in a pluggin.
To bypass this, you can create a second occurence of this plugin with the same PZEM address than the first occurence. In this second occurence, you can select the other missing data that are not in the first occurence.
By the way, PZEMv3 only measures 6 parameters: Voltage, Current, Active power, Active energy, Frequency, Power factor. Other parameters that you can find in Tasmota (Apparent power, Reactive power, Today and yesterday energy) are calculated by Tasmota. It can be done with a dummy device in espeasy if you really need this information
Re: Support for PZEM 004T Energy monitor
I had difficulties with connecting 2 devices at the same time.
I connect both devices in parallel and if I connect load to one of it, then the data is displayed, and if I connect the load to both devices, then NAN.
I changed the GPIO. turned on / off Serial port.
Сan you write instructions for beginners. so that in steps from 0 to configure 2 devices on your firmware
Here are the pictures assembled diagram and settings, what needs to be changed in them?
Who is online
Users browsing this forum: Bing [Bot] and 45 guests