evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Incorrect calculation of the total generated PV output in the history

Open TeutoRockA opened this issue 3 months ago β€’ 9 comments

Describe the bug

The total PV output generated by various inverters is displayed as too lowβ€”in the examples (screenshots), it is about 10 kWh too low!

Version [v0.314.2]

Image Image

Steps to reproduce

  1. Go to history site

Configuration details

-

Log details

-

What type of operating system or environment does evcc run on?

Linux

External automation

  • [x] I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.

Nightly build

  • [x] I have verified that the issue is reproducible with the latest nightly build

Version

evcc version 0.314.2

TeutoRockA avatar Aug 22 '26 01:08 TeutoRockA

Thanks for the report. The history view (main.history) is explicitly marked as work-in-progress and its calculations are still being verified, so a discrepancy is plausible β€” but the screenshots alone aren't enough to pin down the cause.

To investigate further, could you provide:

  • Your (redacted) evcc.yaml/device configuration β€” specifically the pv/inverter meter(s) involved (type, e.g. Modbus/SunSpec, MQTT, plugin, etc.)
  • The exact date/period shown in the screenshots and the expected total (e.g. from the inverter's own portal/display) vs. what evcc shows, so we can compare against the raw data
  • Whether the affected inverter(s) report cumulative energy counters or only instantaneous power (evcc would need to integrate power over time in the latter case)
  • Any relevant log output around that period (evcc log at debug level for the meter/inverter in question)

That will let us compare the underlying meter readings against the aggregated total and see whether energy is being dropped somewhere in the aggregation, or whether it's a difference in how the source device reports/rounds its counter.

πŸ€– Generated with Claude Code

github-actions[bot] avatar Aug 22 '26 01:08 github-actions[bot]

The individual PV production outputs are displayed correctly on the page. In my case, it involves a Shelly device and a KOSTAL inverter. However, the total production figure shown above the graph is calculated incorrectly. I don't think any log files are needed for that.

TeutoRockA avatar Aug 22 '26 12:08 TeutoRockA

Thanks for narrowing it down. I looked at how the PV card's total is built in assets/js/views/History.vue (groupTotalLabel) and it sums the exact same per-slot energy values that are also summed for the individual entity legend entries (entityLegends) β€” both read from seriesByGroup['pv']. So a plain summation bug in the frontend that would make the total diverge from the sum of the correctly-displayed individual entries looks unlikely from code inspection alone.

A more likely explanation: the PV total only includes entities whose history entity is stored with group = "pv". If one of your two PV sources (Shelly or Kostal) is configured as an "additional meter" rather than under pv: in your evcc.yaml, its energy is stored under the meter group in the database, still shown correctly as its own tile/legend, but intentionally excluded from the PV group total (core/metrics/db_history.go, assets/js/views/History.vue:440). That would produce exactly the symptom described: correct individual values, understated total.

To confirm or rule this out, could you share:

  • The pv:/meter section of your evcc.yaml (or Config UI screenshot) showing how the Shelly and the Kostal inverter are each configured (as pv, or as an additional/aux meter?)
  • The exact period (day/month/year and date) shown in the screenshot, plus the total value evcc shows vs. the sum of the individual PV entries you'd expect

That will tell us whether this is a device miscategorization vs. an actual aggregation bug.

πŸ€– Generated with Claude Code

github-actions[bot] avatar Aug 22 '26 12:08 github-actions[bot]

The various PV generation outputs also feature different shades of green; unfortunately, since the latest version, the color differentiation is no longer displayed in the graph, as you also can see on the screenshots.

TeutoRockA avatar Aug 22 '26 12:08 TeutoRockA

Unfortunately your report is missing a detailed log file. Without log, we donβ€˜t have the information for diagnosing the issue described. See https://docs.evcc.io/docs/faq#wie-kann-ich-ein-logfile-zur-fehleranalyse-erstellen.

andig avatar Aug 22 '26 12:08 andig

Hope this helps?! I dropped the Trace log

evcc-20260822-145015-trace.log

TeutoRockA avatar Aug 22 '26 12:08 TeutoRockA

And this as well:

Image Image Image

TeutoRockA avatar Aug 22 '26 13:08 TeutoRockA

Please reopen this issue

TeutoRockA avatar Aug 22 '26 13:08 TeutoRockA

Please reopen this issue

Pls provide logfile upfront next time. It's a lot of effort having to request them time and again. Thank you.

andig avatar Aug 23 '26 10:08 andig