How to use PZEM004T Energy Monitor with esphome

how can we use this PZEM004T Energy Monitor with esphome and home assistant ?

2 Likes

I have it working, I use PZEM and SONOFF basic with Tasmota:
https://github.com/arendst/Sonoff-Tasmota/wiki/PZEM004T-Energy-Monitor

You should setup MQTT comunication in Tasmota soft:


and next define sensors in the configuration.yaml:

- platform: mqtt
  name: "Voltage"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Voltage}}"
  unit_of_measurement: "V"
- platform: mqtt
  name: "Current"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Current}}"
  unit_of_measurement: "A"
- platform: mqtt
  name: "Power"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Power}}"
  unit_of_measurement: "W"
- platform: mqtt
  name: "Power Factor"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Factor}}"
  unit_of_measurement: ""
- platform: mqtt
  name: "Energy Today"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Today}}"
  unit_of_measurement: "kWh"
- platform: mqtt
  name: "Energy Yesterday"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Yesterday}}"
  unit_of_measurement: "kWh"
- platform: mqtt
  name: "Energy Total"
  state_topic: "tele/pzem/SENSOR"
  value_template: "{{ value_json['ENERGY'].Total}}"
  unit_of_measurement: "kWh"

but i want to use it with esphome as now a days we have converted all of our nodes from tasmota to esphome , as after using esphome we are liking it ,
but each and everytime there is a update of esphome then we have to face many many problem .

i am thinking of switching to tasmota again .

I personally use EspHome where it is trouble-free, and Tasmota in other cases.

One day we can use our PZEM004T with the great esphome! :innocent:

3 Likes

My PZEM004T with tasmota just stopped working yesterday :face_with_raised_eyebrow:
It would be nice to be able to use ESPHOME, so I would add a display and notification leds.

2 Likes

We all hope for a working pzem004t integration in esphome soon!

Give some thumbs up for issue 49!

1 Like

It’s getting serious :star_struck:

2 Likes

can we use with esphome now ?
a there is no mention of this in the latest update ?

As always: wait patiently. The master will tell when it’s ready and a release is rolling. If it get’s merged in the dev branch (you could see this in the pr up) you could experiment with the dev version (extra hassio addon) and report feedback. But for now it’s not yet merged so a little more patient is needed :pray:

i can do all the testing which is required for this integration but i cant understand how to create a node for testing ?
can i test in this esphome addon or i need to start esphome dev addon ?

For now both will not work because the code is not merged yet. Next step will be to merge the pzem004t support into the dev branch which equals the esphome-dev addon in hassio.

For now that’s not done yet. I will give a sign when it happens and you are ready to go :wink:

Like it says in the linked PR

Normal/python users: check out this branch with git to test; hass.io users: Add "esphome_version": "pzem004t" to your addon config

1 Like

This is what i want to ask , what does this line means ?
How to check this ?

Are you using hassio? Or something else?

I m using hassio

So add the config as it says and esphome will use the pzem004t branch of the esphome code.

Could you test it successfully? I had no luck. Can’t get any values in the logs :frowning_face:

I tried but din’t got any values from the pzem. Looks like the code is not working properly yet.

Any news? No one successful so far? @bpmittal @nickrout maybe?