Loadpoint: log battery boost errors (#28403)

This commit is contained in:
andig 2026-03-20 19:51:13 +01:00 • committed by GitHub
parent 5877d0acd5
commit cfec1b6af8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}
}
}
}