Get pzem-004T modbus address in status 10 outputs

48 views
Skip to first unread message

Khurram

unread,
Apr 8, 2025, 9:41:32 AMApr 8
to TasmotaUsers
I have attached 2 pzem-004T to my inverter input and output. I would like to get the pzem modbus address in "Status 10 output" to differentiate between the 2 sets of readings. I compile my own binaries. I believe that I can modify xnrg_05_pzem_ac.ino and/or xdrv_03_esp32_energy.ino. Am I on the right track?

One other thing. Is this possible in berry?

Thanks,
Khurram

Philip Knowles

unread,
Apr 8, 2025, 10:02:54 AMApr 8
to Khurram, TasmotaUsers
It's already in the Smart meter section

From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Khurram <kfha...@gmail.com>
Sent: 08 April 2025 14:41
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Get pzem-004T modbus address in status 10 outputs
 
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/sonoffusers/3941fdf9-5227-44e6-8145-2dd07316c615n%40googlegroups.com.

Khurram

unread,
Apr 8, 2025, 10:34:31 AMApr 8
to TasmotaUsers
Yes I know that. But there are 2 shortcomings/problem with the smart meter interface:

1) I don't get energy today and energy yesterday reading.
2) If 1 of the devices is not working, I still get a 0 reading instead of a NaN (for example).

Philip Knowles

unread,
Apr 8, 2025, 12:15:37 PMApr 8
to Khurram, TasmotaUsers
The energy today and yesterday readings don't come from the PZEM. The PZEM just has a consumption reading from power on. Tasmota simply does some maths at midnight each day.
It is possible to just use the normal power measurement system for multiple PZEMs - look in the Power Monitoring section of the Commands page. There are also numerous discussions (it's possible to connect up to 8 apparently)
In order to optimize components, I'd like to use the Multi-phase/adresses feature to monitor 3 different single phase circuits/devices. IE: one Sonoff basic + 3x PZEM004T ( setup as per #2315). Therefore, I'd like to get Today/Yesterday/Total Energy separately for each "phase".



From: sonof...@googlegroups.com on behalf of Khurram
Sent: Tuesday, April 08, 2025 15:34
To: TasmotaUsers
Subject: Re: Get pzem-004T modbus address in status 10 outputs

Khurram

unread,
Apr 8, 2025, 1:37:01 PMApr 8
to TasmotaUsers
I am aware that the energy today/yesterday are calculated readings; I could do that in my nodered flow. But it is nice to see it in the interface. However, in all the examples for multi-phase measuring system, there is no way to tell which particular pzem stops working. In my case, I am measuring inverter in and out. I can attach both pzems without any problems on address 1 (for input) and address 2 (for output). The readings are returned in an array with the 1st index for input readings and 2nd index for output readings. But if for some reason, one of the pzems stops working, the output just returns readings from the other pzem without error. That is why I wanted the readings indexed by the modbus address so that I continue to store readings for the correct pzem. I have looked at the 2 ino files I mentioned in my above post. I think I can store the address in the energy structure defined in the xdrv_03_esp32_energy.ino file. But I cannot figure out how it is returning the data for Status 10.

Andrew L

unread,
Apr 8, 2025, 11:14:44 PMApr 8
to TasmotaUsers
This is worth bringing up on the Tasmota GitHub. A worthwhile feature to add, imo. 
Reply all
Reply to author
Forward
0 new messages