I am using an integral helper (Riemann sum) to calculate the energy produced (kWh) based on the power production (W) of my Panasonic A2W heat pump.
In the morning when the heat pump starts up after a night without any production (0 W), the power production is negative for a few minutes. The result of this start is a really large and faulty negative energy production (kWh) value.
I tried integral methods "trapezoidal" and "left". Only the trapezoidal method gives the unexpected results. I started with the example integral yaml code on the HA website and only adjusted the source, name & unique ID, see code below.
Anything I am doing wrong here?
# Use Riemann Sum to track total Aquarea Total Energy Produced Calculated (kWh)
# Source is template sensor Aquarea Power Produced Calculated (W)
- platform: integration
source: sensor.aquarea_power_produced_calculated
name: "Aquarea Total Energy Produced Calculated"
unique_id: "panasonic_heat_pump_total_energy_produced_calculated"
unit_prefix: k
round: 2
max_sub_interval:
minutes: 5