diff --git a/hems/eebus/eebus.go b/hems/eebus/eebus.go index 453593018..09e1e3227 100644 --- a/hems/eebus/eebus.go +++ b/hems/eebus/eebus.go @@ -2,6 +2,7 @@ package eebus import ( "context" + "errors" "sync" "time" @@ -246,6 +247,10 @@ func (c *EEBus) run() error { // LPP if c.productionLimitActivated.IsZero() { if c.productionLimit.IsActive { + if c.productionNominalMax <= 0 { + return errors.New("production limit received but productionNominalMax is not configured") + } + c.log.WARN.Println("activating production limit") c.setProductionLimit(c.productionLimit.Value, true) } diff --git a/hems/eebus/eebus_test.go b/hems/eebus/eebus_test.go index 5e898e25e..8b8554e06 100644 --- a/hems/eebus/eebus_test.go +++ b/hems/eebus/eebus_test.go @@ -150,6 +150,18 @@ func TestRun_ProductionLimitReleasedEarly(t *testing.T) { assertProductionLimit(t, c, false) } +// TestRun_ProductionLimitWithoutNominalMax verifies an incoming LPP limit +// errors instead of being silently ignored when productionNominalMax is unset (#31469). +func TestRun_ProductionLimitWithoutNominalMax(t *testing.T) { + c := newTestEEBus(t) + c.heartbeat.Set(struct{}{}) + c.productionNominalMax = 0 + + c.productionLimit = ucapi.LoadLimit{Value: -2200, IsActive: true, Duration: time.Hour} + require.Error(t, c.run()) + assert.Nil(t, c.CurtailedPercent()) +} + // TestRun_ConsumptionLimitReleasedEarly is the LPC mirror of the LPP early-release // case: an active consumption limit must drop as soon as the EG deactivates it. func TestRun_ConsumptionLimitReleasedEarly(t *testing.T) { diff --git a/templates/definition/hems/fnn-eebus.yaml b/templates/definition/hems/fnn-eebus.yaml index bb029c351..3e49dd8d8 100644 --- a/templates/definition/hems/fnn-eebus.yaml +++ b/templates/definition/hems/fnn-eebus.yaml @@ -31,7 +31,6 @@ params: - name: productionnominalmax type: float unit: W - advanced: true description: en: Installed generator power (Wp) de: Installierte Generatorleistung (Wp) diff --git a/templates/definition/hems/hemspro-eebus.yaml b/templates/definition/hems/hemspro-eebus.yaml index c56fc2775..3feffacb7 100644 --- a/templates/definition/hems/hemspro-eebus.yaml +++ b/templates/definition/hems/hemspro-eebus.yaml @@ -32,7 +32,6 @@ params: - name: productionnominalmax type: float unit: W - advanced: true description: en: Installed generator power (Wp) de: Installierte Generatorleistung (Wp)