Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions core/site_optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,17 @@
}

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 defaults to current-derived if not set, and vice versa
pMaxImp := lo.CoalesceOrEmpty(pMaxPower, pMaxFromCurrent)
pMaxAbsImp := lo.CoalesceOrEmpty(pMaxFromCurrent, pMaxPower)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need both?


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),

Check failure on line 193 in core/site_optimizer.go

View workflow job for this annotation

GitHub Actions / Build

unknown field PMaxAbsImp in struct literal of type "github.com/evcc-io/optimizer/client".GridConfig

Check failure on line 193 in core/site_optimizer.go

View workflow job for this annotation

GitHub Actions / Integration

unknown field PMaxAbsImp in struct literal of type "github.com/evcc-io/optimizer/client".GridConfig

Check failure on line 193 in core/site_optimizer.go

View workflow job for this annotation

GitHub Actions / Lint

unknown field PMaxAbsImp in struct literal of type "github.com/evcc-io/optimizer/client".GridConfig (typecheck)

Check failure on line 193 in core/site_optimizer.go

View workflow job for this annotation

GitHub Actions / Test

unknown field PMaxAbsImp in struct literal of type "github.com/evcc-io/optimizer/client".GridConfig
}
}
}
Expand Down
Loading