Skip to content

Commit

Permalink
Fix grid import treated as available power (refs #78)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed May 1, 2020
1 parent 8669853 commit a21b332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/loadpoint.go
Expand Up @@ -212,7 +212,7 @@ func (lp *LoadPoint) evChargeCurrentHandler(m *wrapper.ChargeMeter) func(para ..
}
if current > 0 {
// limit available power to generation plus consumption/ minus delivery
availablePower := math.Abs(lp.pvPower) + lp.availableBatteryPower() + lp.gridPower
availablePower := math.Abs(lp.pvPower) + lp.availableBatteryPower() - lp.gridPower
availableCurrent := int64(powerToCurrent(availablePower, lp.Voltage, lp.Phases))
current = min(current, availableCurrent)
}
Expand Down

0 comments on commit a21b332

Please sign in to comment.