Skip to content

Commit 426b3b8

Browse files
committed
wip
1 parent e05135a commit 426b3b8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

core/site_optimizer.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/evcc-io/evcc/core/loadpoint"
1919
"github.com/evcc-io/evcc/core/metrics"
2020
"github.com/evcc-io/evcc/core/types"
21+
"github.com/evcc-io/evcc/hems/hems"
2122
"github.com/evcc-io/evcc/tariff"
2223
"github.com/evcc-io/evcc/util/config"
2324
"github.com/evcc-io/evcc/util/request"
@@ -332,9 +333,9 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error {
332333

333334
// soft grid feed-in cap from active HEMS curtailment (e.g. German 70% rule):
334335
// export is capped at this power, excess PV is curtailed instead of exported
335-
if site.hems != nil {
336-
if p := site.hems.MaxProductionPower(); p != nil && *p > 0 {
337-
req.Grid.PMaxExp = float32(*p)
336+
if curtailed := hems.Curtailed(site.hems); curtailed != nil && *curtailed {
337+
if pMaxExp := site.hems.MaxProductionPower(); pMaxExp != nil {
338+
req.Grid.PMaxExp = float32(*pMaxExp)
338339
}
339340
}
340341

0 commit comments

Comments
 (0)