From c53a67ef993bd93be2dff930d4eef2953343f4bf Mon Sep 17 00:00:00 2001 From: Ingo <71161062+iseeberg79@users.noreply.github.com> Date: Sun, 8 Feb 2026 14:12:00 +0100 Subject: [PATCH] Planner: fix plan charging too early when preconditioning (#27299) --- core/loadpoint_plan.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/loadpoint_plan.go b/core/loadpoint_plan.go index 286777bb9..9f59c9db2 100644 --- a/core/loadpoint_plan.go +++ b/core/loadpoint_plan.go @@ -221,11 +221,11 @@ func (lp *Loadpoint) plannerActive() (active bool) { // TODO check when schedule is implemented lp.log.DEBUG.Println("plan: continuing after target time") return true - case lp.clock.Now().Before(lp.planSlotEnd) && !lp.planSlotEnd.IsZero(): + case lp.clock.Now().Before(lp.planSlotEnd) && !lp.planSlotEnd.IsZero() && requiredDuration > strategy.Precondition: // don't stop an already running slot if goal was not met lp.log.DEBUG.Printf("plan: continuing until end of slot at %s", lp.planSlotEnd.Round(time.Second).Local()) return true - case requiredDuration < tariff.SlotDuration: + case requiredDuration < tariff.SlotDuration && requiredDuration > strategy.Precondition: lp.log.DEBUG.Printf("plan: continuing for remaining %v", requiredDuration.Round(time.Second)) return true case lp.clock.Until(planStart) < tariff.SlotDuration-time.Minute: