From 1f3196b105097720a987123b465fb4bce730f6b9 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 26 Jul 2026 15:16:06 +0200 Subject: [PATCH] Loadpoint: ignore implausible charge rater readings (#32174) --- core/loadpoint.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/loadpoint.go b/core/loadpoint.go index deaddf4cf..076bf1452 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -56,6 +56,8 @@ const ( minActiveCurrent = 1.0 // minimum current at which a phase is treated as active minActiveVoltage = 207 // minimum voltage at which a phase is treated as active + maxSessionEnergy = 1e3 // kWh, above this a charge rater reading is treated as garbage + chargerSwitchDuration = 60 * time.Second // allow out of sync during this timespan phaseSwitchDuration = 60 * time.Second // allow out of sync and do not measure phases during this timespan @@ -1811,8 +1813,14 @@ func (lp *Loadpoint) publishChargeProgress() { if f, err := lp.chargeRater.ChargedEnergy(); err == nil { // workaround for Go-E resetting during disconnect, see // https://github.com/evcc-io/evcc/issues/5092 - if f > lp.chargedAtStartup { - added, addedGreen := lp.energyMetrics.Update(f - lp.chargedAtStartup) + switch session := f - lp.chargedAtStartup; { + case session > maxSessionEnergy: + // guard against meters reporting register garbage, see + // https://github.com/evcc-io/evcc/issues/32159 + lp.log.WARN.Printf("ignoring implausible session energy: %.3fkWh", session) + + case session > 0: + added, addedGreen := lp.energyMetrics.Update(session) if added > 0 { lp.log.DEBUG.Printf("session energy: %.3fkWh", f) }