Energy dashboard calibration

Hi, community
I’m new to Home Assistant, but have a good experience with node-red, mqtt, hubitat, modbus etc in last ~5 years

I was excited to install HA ( docker compose ) and start configuring my Energy widget

I have 4600W mono solar panels, 70 degree angle ( winter ), 2 solar inverters ( Voltronic clones ) , solar connected to only one of the inverters

And I found Energy widget calculating kWh incorrectly.
I compare Energy calculation with 2 data sources

  • daily stats in inverter
  • Grafana dashboard

I’m pulling data every 15 seconds from inverters by running mpp-solar console app and storing it in influxdb via mqtt, as well as have configured sensors in HA from mqtt

  - state_topic: solar/lutsk/axioma/status/ac_output_active_power/value
    name: "Axioma 2kW:AC Output Active Power"
    object_id: inverter0_ac_output_active_power
    unique_id: inverter0_ac_output_active_power
    unit_of_measurement: W
    icon: mdi:lightning-bolt
    device_class: power
  - state_topic: solar/lutsk/king/status/l1_ac_output_active_power/value
    name: "King 5kW:AC Output Active Power"
    object_id: inverter1_ac_output_active_power
    unique_id: inverter1_ac_output_active_power
    unit_of_measurement: W
    icon: mdi:lightning-bolt
    device_class: power
- platform: integration
  source: sensor.inverter0_ac_output_active_power
  name: "Axioma 2kW: AC Output Active Energy"
  unique_id: inverter0_ac_output_active_energy
  unit_prefix: k
  round: 3
- platform: integration
  source: sensor.inverter1_ac_output_active_power
  name: "King 5kW: AC Output Active Energy"
  unique_id: inverter1_ac_output_active_energy
  unit_prefix: k
  round: 3

This is how mqtt and sensors configured in HA
And I see results in widget
Where House spending shows 10.7kWh today, on Inverter I see 5.74kWh today
For Solar panels it shows 0.9kWh, while the inverter shows 0,474kWh

When I calculate Solar PV in Grafana - I can see 0.576kWh
Usage from grid in Grafana - 6.126kWh
I can tune data in Grafana, not a problem

Timezone and clocks are in sync in inverter internal clock and Home Assistant. Server time is UTC. Home Assistant TZ is Europe/Kyiv

As a summary from the numbers above - I need some sort of calibration to add to HA Energy calculation in order to obtain proper calculations, but I can’t see any documentation about calibration of math in Home Assitant

If you had a similar issue with math, let me know how to find a workaround

My suspects are

  • periodicity of data polling from sensors. Probably 15s is too much.
  • inverter feels like has undercalculation of power from PV - when in the morning it showed 60-70W of power, in usage there was 10Wh, which is not true. Seems like the most accurate results are in Grafana from what I have on hand.

Thanks in advance for your thoughts and suggestions.

Add this to your Riemann Sum integrations to reduce errors:

method: left
1 Like

Where should I find this integration?

Here, in your configuration:

See the method notes in the documentation

1 Like

Thank you for your reply
It wasn’t obvious to me that this is Riemann Sum integration
Added method: left to all sensors.

The question, does it mean that data before the change is not correct and I’d see changes only tomorrow with new values calculated respectively to the method?

Yes. It won’t change past measurements.

1 Like

Thank you for the help.
It works now

1 Like