From 23ffe16145f4f4b6617d63aa4b689d3d3db447f0 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 12 Sep 2025 17:16:52 +0200 Subject: [PATCH] Loadpoint: make EffectiveMaxPower honor circuit limits (#23554) --- core/loadpoint_effective.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/loadpoint_effective.go b/core/loadpoint_effective.go index f1feb1adc..b38982ffd 100644 --- a/core/loadpoint_effective.go +++ b/core/loadpoint_effective.go @@ -217,11 +217,21 @@ func (lp *Loadpoint) EffectiveMinPower() float64 { return Voltage * lp.effectiveMinCurrent() * float64(lp.minActivePhases()) } -// EffectiveMaxPower returns the effective max power taking vehicle capabilities and phase scaling into account +// EffectiveMaxPower returns the effective max power taking vehicle capabilities, +// phase scaling and load management power limits into account func (lp *Loadpoint) EffectiveMaxPower() float64 { lp.RLock() defer lp.RUnlock() - return lp.effectiveMaxPower() + + res := lp.effectiveMaxPower() + + if lp.circuit != nil { + if v := lp.circuit.GetMaxPower(); v > 0 { + res = min(res, v) + } + } + + return res } // effectiveMaxPower returns the effective max power taking vehicle capabilities and phase scaling into account