Incorrect calculation of the total generated PV output in the history
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]
Steps to reproduce
- 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
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 thepv/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 (
evcclog atdebuglevel 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
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.
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 yourevcc.yaml(or Config UI screenshot) showing how the Shelly and the Kostal inverter are each configured (aspv, 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
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.
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.
And this as well:
Please reopen this issue
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.