From cecaedbc1fba34556bef26baef3a497964618869 Mon Sep 17 00:00:00 2001 From: rro Date: Fri, 13 Mar 2026 16:54:28 +0100 Subject: [PATCH 1/2] add PMaxAbsImp --- core/site_optimizer.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/site_optimizer.go b/core/site_optimizer.go index 732e99c2ae2..6cee49976ff 100644 --- a/core/site_optimizer.go +++ b/core/site_optimizer.go @@ -180,10 +180,17 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error { } if site.circuit != nil { - if pMaxImp := site.circuit.GetMaxPower(); pMaxImp > 0 { + pMaxPower := site.circuit.GetMaxPower() + pMaxFromCurrent := site.circuit.GetMaxCurrent() * site.Voltage * 3 + + // soft limit pMaxImp (monthly peak) defaults to current-derived if not set, and vice versa + pMaxImp := lo.CoalesceOrEmpty(pMaxPower, pMaxFromCurrent) + pMaxAbsImp := lo.CoalesceOrEmpty(pMaxFromCurrent, pMaxPower) + + if pMaxImp > 0 { req.Grid = optimizer.GridConfig{ - // hard grid import limit if no price penalty is set by PrcPExcImp - PMaxImp: float32(pMaxImp), + PMaxImp: float32(pMaxImp), + PMaxAbsImp: float32(pMaxAbsImp), } } } From 2fd8f73751fa6dc9567d1f618dfd4f139534bf33 Mon Sep 17 00:00:00 2001 From: rro Date: Fri, 13 Mar 2026 17:02:13 +0100 Subject: [PATCH 2/2] comment --- core/site_optimizer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/site_optimizer.go b/core/site_optimizer.go index 6cee49976ff..4438e7029b3 100644 --- a/core/site_optimizer.go +++ b/core/site_optimizer.go @@ -183,7 +183,7 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error { pMaxPower := site.circuit.GetMaxPower() pMaxFromCurrent := site.circuit.GetMaxCurrent() * site.Voltage * 3 - // soft limit pMaxImp (monthly peak) defaults to current-derived if not set, and vice versa + // soft limit pMaxImp defaults to current-derived if not set, and vice versa pMaxImp := lo.CoalesceOrEmpty(pMaxPower, pMaxFromCurrent) pMaxAbsImp := lo.CoalesceOrEmpty(pMaxFromCurrent, pMaxPower)