esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

PZEM-004T V3 incorrect power value #2527

Closed pioneershahid closed 2 years ago

pioneershahid commented 2 years ago

The problem

Hi folks, hope everyone is doing well. I think I have an issue so like to get clarification or support on it.

I bought PZEM-004T V3 Energy Monitor from aliexpress https://www.aliexpress.com/item/32840804812.html?spm=a2g0s.9042311.0.0.266b4c4dDGPX5j and successfully integrated it with home assistant using instruction https://esphome.io/components/sensor/pzemac.html.

I reviewed the documents referenced on the esphome page. all I can say is my connection is as per innovatorsguru.com.

The issue I am facing is with the calculation of Power value. the current is sensed correctly but when you convert the current value into Power, the reading is wrong.

for example, Current: 1.1787 A voltage: 237.5 V (esphome calculated) Power 106.00 W (incorrect)

However, if calculate Power using formula Power = Amps x Volts. The correct calculated watt is 279.9 1.1787 Amps x 237.5 Volts = 279.9 Watts.

For some reason the calculated Power value from esphome is incorrect. can someone please look into it and advise if my understanding is incorrect or is it to do with some calculation?

Which version of ESPHome has the issue?

2021.9.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2021.10.0

What platform are you using?

ESP8266

Board

Nodmcu V3

Component causing the issue

PZEM-004T V3 Energy Monitor

Example YAML snippet

uart:
  rx_pin: D1
  tx_pin: D2
  baud_rate: 9600

modbus:

sensor:
  - platform: pzemac
    current:
      name: "PZEM-004T V3 Current"
    voltage:
      name: "PZEM-004T V3 Voltage"
    energy:
      name: "PZEM-004T V3 Energy"
    power:
      name: "PZEM-004T V3 Power"
    frequency:
      name: "PZEM-004T V3 Frequency"
    power_factor:
      name: "PZEM-004T V3 Power Factor"
    update_interval: 20s

Anything in the logs that might be useful for us?

this will throw off the Power monitoring incorrectly.

Additional information

No response

martgras commented 2 years ago

The power value is not calculated by esphome. Esphome just reads the value from the modbus register. Probably powerfactor is considered for the caluclation inside pzem .
See https://en.wikipedia.org/wiki/Power_factor for alot more details

pioneershahid commented 2 years ago

Thanks, i think it's probably taking the power factor into account. thanks for the commnets. i will close it as it's not an issue.