Ever increasing sensor value --> delta consumption (per measuring interval)?

My HA collects measurements from pzem-004 energy meter: current(A), voltage(V), power(W), total power consumption (Wh).
Lates one is ever increasing value. But i need consumption per measuring interval. Wh(now) - Wh(previous).
Can this be done in HA with some built-in capabilities?

You have two options : -

  1. Let’s say you want the readings weekly, set an automation to copy an input number (current) to another input number (last) then update the current input number (from the sensor value say every 5 mins ? You would then configure a new sesor to display current - last
  2. depending on your hardware you should be able to zero out your values for kWh or Wh (whichever) read your documentation on the device
1 Like

Or just set a weekly, monthly or daily interval in the utility meter.


thanks man! it works just fine