diff --git a/core/loadpoint.go b/core/loadpoint.go index 0347a7eb1..066c7d34e 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -1877,12 +1877,13 @@ func (lp *Loadpoint) phaseSwitchCompleted() bool { func (lp *Loadpoint) Update(sitePower, batteryBoostPower float64, consumption, feedin api.Rates, batteryBuffered, batteryStart bool, greenShare float64, effPrice, effCo2 *float64) { // auto-disable battery boost when SOC drops below limit if lp.GetBatteryBoost() != boostDisabled { - limit := lp.GetBatteryBoostLimit() - if limit < 100 { - batterySoc := lp.site.GetBatterySoc() - if batterySoc < float64(limit) { + if limit := lp.GetBatteryBoostLimit(); limit < 100 { + if batterySoc := lp.site.GetBatterySoc(); batterySoc < float64(limit) { lp.log.DEBUG.Printf("battery boost disabled: soc below limit (%.0f%% < %d%%)", batterySoc, limit) - _ = lp.SetBatteryBoost(false) + + if err := lp.SetBatteryBoost(false); err != nil { + lp.log.ERROR.Printf("set battery boost: %v", err) + } } } }