arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.2k stars 4.81k forks source link

New PZEM-004T version (protocol changed) #5765

Closed martindb closed 5 years ago

martindb commented 5 years ago

There is a new firmware version of the PZEM-004T sensor. It actualy uses MODBUS RTU protocol. Also now reports power factor and frequency. It should be great tasmota support it.

modbus_PZEM-004T.txt

curzon01 commented 5 years ago

I think that's already in - use #define USE_PZEM_AC

A better readable document for these sensors pzem-016_pzem014_user_manual.pdf

The related energy module is xnrg_05_pzem_ac.ino

(edit: add document & file link)

Giardo84 commented 5 years ago

Pzem-004T v3.0.pdf I also have a new pzem-004T (v3.0). I tried to make it work with Tasmota but it doesn't work. I tried also with Arduino without any result. The documentation is slightly different from the one posted by you. In the documentation, the functional diagram shows a TTL interface instead of RS485

curzon01 commented 5 years ago

The documentation is slightly different from the one posted by you. In the documentation, the functional diagram shows a TTL interface instead of RS485

The dox desc are the same protocol, TTL and RS485 are only different physical layer.

Giardo84 commented 5 years ago

The documentation is slightly different from the one posted by you. In the documentation, the functional diagram shows a TTL interface instead of RS485

The dox desc are the same protocol, TTL and RS485 are only different physical layer.

OK thanks. So what modification should be made to make this library work with the pzem-004T (v3.0)?

curzon01 commented 5 years ago

So what modification should be made to make this library work with the pzem-004T (v3.0)?

The name of the sensor may be confuse you - PZEM-004T protocol is implemented in module as xnrg_05_pzem_ac.ino and enabled as default in sonoff.bin/sonoff-sensors.bin (#define USE_PZEM_AC).

Have a look into xnrg_05_pzem_ac.ino comment at the beginning you read the following: Hardware Serial will be selected if GPIO1 = [98 PZEM016 Rx] and GPIO3 = [62 PZEM0XX Tx] - pls try this or use [98 PZEM016 Rx]/[62 PZEM0XX Tx] on other GPIOs

But anyway if you have problems to configure your device it's better to use some of the community channels. Github issues are used for Tasmota software feature requests and bug reporting. Troubleshooting is more effective using an interactive forum.

Support Information

See Wiki for more information. See FAQ for common questions/answers and links if none of your question is in the list See Chat for more user experience. See Community for forum. See Code of Conduct

SeByDocKy commented 5 years ago

Hi,

I don't know if it's related or not but I am using also a PZEM-004T (I don't which version but probably the newest)... and I noticed that the informations are freezed after a couple of minutes. I have the last Tasmota build, timeperiod 10.

When it's freezing, after sometime 5min, measurements are back.... I noticed it's freezeing more for low power values.... don't know it's related or not.

If I do a software rebood of my NodeMCU V3, measuresments are back

Giardo84 commented 5 years ago

ok, it works but there is a little note to make. In the sonoff configuration it is necessary to set GPIO1 = [62 PZEM0XX Tx] and GPIO3 = [98 PZEM016 Rx]. Physically connecting RX of an ESP01S with the PZEM-004T and TX of the ESP01S with the PZEM-004T RX.

SeByDocKy commented 5 years ago

ok, it works but there is a little note to make. In the sonoff configuration it is necessary to set GPIO1 = [62 PZEM0XX Tx] and GPIO3 = [98 PZEM016 Rx]. Physically connecting RX of an ESP01S with the PZEM-004T and TX of the ESP01S with the PZEM-004T RX.

Yes .... THanks ....

In fact I got a V2 and and V3..... Unfortunatly I killed my V2 this afternoom.... tried to fix why informations are freezed after a couple of Minutes. I did some test with the V3.... Seems to suffer from the same symptoms. I will do more test tmr. Thanks anyway

SeByDocKy commented 5 years ago

Just tested the V3 and new hardware serial setting mentioned above and for me both current (and by consequence power) reading are wrong

Voltage 238 V

0.036 A 0 W 9 VA 9 VAr 0.05 50 Hz 2.565 kWh 11.427 kWh 18.933 kWh

I collected that on with the curent version

curzon01 commented 5 years ago

Calibrated?

meingraham commented 5 years ago

Can't calibrate a PZEM using Tasmota - https://github.com/arendst/Sonoff-Tasmota/issues/3208#issuecomment-405048466