#ESPHome energy monitor with PZEM-004T and ESP01

15 messages · Page 1 of 1 (latest)

long hinge
#

So far I made 10 of these. I'm using a generic bar soap case as an enclosure. Soap cases are less than 1 USD.

I'm using a cheap bidirectional 5V-3V digital converter module to power the ESP01 with 5V and also to allow bidirectional communication with 5V serial TTL with PZEM. Also I'm using a simple USB TTL converter for ESP01 for programming. I've added a switch to put it into programming mode and a button to reset.

Power supplies are 5V USB chargers. I bought 25 of them from Amazon at 1 USD each when they were on sale. They are about 5 USD each now which is still a bit cheaper than their regular price.

I'm using computer power cables with IEC connectors. I cut the IEC connector and add a female mains connector. I using cable ties to keep the power cables from moving.

The way I wired the PZEM module allows me to measure its own consumption as well as the 5V power supply in addition to the load.

Here is the ESPHome code.

substitutions:
  device_description: "Fridge"

esphome:
  name: powermeter-10
  comment: '${device_description}'

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

ota:
  password: "*****"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Powermeter-10 Fallback Hotspot"
    password: "*****"

captive_portal:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600

modbus:

sensor:
  - platform: pzemac
    current:
      name: "PM-${device_description} Current"
    voltage:
      name: "PM-${device_description} Voltage"
    power:
      name: "PM-${device_description} Power"
    energy:
      name: "PM-${device_description} Energy"
    frequency:
      name: "PM-${device_description} Frequency"
    power_factor:
      name: "PM-${device_description} Power Factor"
    update_interval: 2s    
floral bluff
#

I like that these are along a cable with a slim connector for the outlet. I have Sonoff S31s and Shelly 1PMs currently. Is the project code available? Where did you source the PZEM modules?

magic patio
#

How does the plug itself uses in watt?

long hinge
long hinge
#

Total consumptipon of device without external load.

languid hamlet
#

I'm curious why you went that way instead of getting a $14 Sonoff Pow. The pleasure of building it yourself?

nimble fractal
#

beside a pow has a relay which needs to be always energized when using it only for power measurements (might double the power usage of compared to the solution from Mr.Tor) 💡

languid hamlet
#

So for $7, sounds like it’s worth it. Interesting!

nimble fractal
#

Guess there is no other device like a pzem004t v3 out there or even close to it regarding price/performance ratio

#

Another goody: The pzem004tv3 continues to count the (total) energy consumption even when the esp is disconnected. It essentially means you don't loose track of your consumption... which is something most other solution can't provide...

#

Good to know: One esp can handle/connect to more than one pzem004tv3 💪

hoary cosmos
#

Hi, I'm using a similar setup to yours, but I'm only getting "Unavailable." The communication indicator lights on the PZEM are blinking in sequence. Have you encountered this issue? How did you resolve it?