As this is project I’m guessing I could post here, although it’s also hardware.
I also have posted this to reddit recently just in case some of you see that as well.
For a few months now I’ve been running this setup without issue. Using a PZEM-004 and a tasmota NodeMCU I’ve been able to get real time power usage from my home in Japan.
When combining it with grafana it’s a very comprehensive utility to monitor the monthly usage.
I had made a post in order to remember what to do should I need to redo it and if it helps others at the same time I would be happy.
For those thinking about doing something similar, I’m also doing whole house monitoring.
I’m using the PZEM-016, which has no display but seems otherwise very similar. Since I have a split phase system and I wanted to monitor both legs, I didn’t want to have two ESPs flashed with tasmota running next to each other, so I’m using the USR-W610 to connect to the two modbus outputs of the PZEMs and convert them to modbus TCP/IP and connect it to my WiFi. From there I use the Home-Assistant Modbus TCP component to read the values, and some template sensors to combine them.
Guys anyone can direct me to how to monitor two different main lines i.e backup generators vs mains - mainly i need to know my house is drawing power from which line: line 1 or line 2 - thanks
One way to accomplish this without getting the power draw is to connect a sonoff to each source and monitor the online/offline status. (ex. If sonoff1 is on main power is on, if sonoff 2 is on then the backup is on)
I just got two PZEM-016s, with the split core current transformer, and put one CT on each of the two legs of my incoming power. Photo to show it a bit better.
From there, I used a computer with a RS485 to USB converter to change the modbus address of one of them. This is because modbus is a multi-node communication protocol that allows for many devices on the same 2 wire bus, but all nodes must have a unique address for that to work, and all the PZEMs ship with the same address. The manual for them explains how to set this.
With both modules having a different slave address, I used a USR-W610 ($35 on ebay) to convert the serial modbus RTU to modbus TCP/IP (the USR-W610 has built-in wifi as well as a RJ45 port). Then just added the modbus component in home-assistant to pull in the data.
It sounds more complicated than it is honestly. I can share my HA config for it if you want, but it’s pretty basic.
Hello, I’ve just finished the project as the guide from @Leaninghouse
One thing to add, I am powering the pzem-004t TTL from the nodemcu VU pin and it is working perfectly. It seems a separate usb power adapter is not necessary after all.
Also I am creating mqqt discovery config messages from MQTT.Fx for auto-discovery.
For instance:
Hello, thank you for this guide. I have followed it as best I can however I am stuck. I have flashed my nodemcu and wired everything correctly however no values appear on my tasmota webpage. I am using a newer version of tasmota than the one in the guide 6.5.0.4 one difference is when setting the GPIO pins I use PZEM0XX TX (62) and PZEN004 Rx (63), however no such luck. I have tried with a wemos d1 and nodemcu now. If anyone has any suggestions I would really appreciate
Hi,
I was reading this post about using the USR-W610 with the PZEM-016 and I was wondering if anyone can assist me with getting mine set up. currently I have everything connect with the Pzem-016 connected to live and neutral and the ct connected…On the rs485 side, I have a twisted pair cable going from the A and B port of the PZem to the A and B of the USR. but nothing is happening, the TXD and RXD leds are not blinking (not sure if they should be but that makes sense to me). I was also wondering which settings should be used to the USR-w610 and if something there is causing this not to work or if i have a fault device. I have ordered a usb to RS485 to test the PZEMs (i bought 2) but I don’t think it’s them…Can anyone provide any insight ?
P.S. I PM’d Silicon_Avatar yesterday evening but no reply as yet.
As I was updating tasmota on a device I noted that not all firmware are the same.
Some firmaware versions do not have the PZEM004T sensor capabilities.
This is what blakadder said. Which went under my radar.
Sorry. I managed to get it working by assigning GPIO D1 and D2 instead of the nodemcu’s TX RX pins. I also was able to use my power companies kwh rate and use a calculation to show daily cost on my home screen. I also have this logged onto a google spreadsheet daily to keep track