Skip to content

Planner: only skip short slot if more slots follow - #34604

Open
naltatis wants to merge 2 commits into
masterfrom
fix/plan-short-slot
Open

naltatis wants to merge 2 commits into
masterfrom
fix/plan-short-slot

Conversation

@naltatis

@naltatis naltatis commented Oct 9, 2026

Copy link
Copy Markdown
Member

fixes #34466, refs #33936

The short slot rule (#6970, tolerance in #26814) protects the charger from short on/off cycles. Since 15m tariff slots, every plan needing less than 14m is a single trimmed slot without successor, so it was always skipped. Skipping a final slot avoids no cycle: the planner keeps proposing it until the insufficient time fallback charges at a worse price or misses the target.

  • Short slots are only skipped if a later slot follows after a gap. Its remainder is then charged at the end of that later slot via the existing "continuing for remaining" path
  • Short plans and the last slot of a plan now start immediately
  • Fixes the insufficient time fallback being blocked as well (Frage: "plan: slot too short- ignoring" korrekt? #33936 finished 7m after the target)

🤖 Generated with Claude Code

@github-actions github-actions Bot added the bug Something isn't working label Oct 9, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@naltatis

naltatis commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

\cc @iseeberg79

@naltatis
naltatis requested a review from andig October 9, 2026 15:40
@andig

andig commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Is this even an issue? If the "last" cheap slot is skipped it ends up as the very last slot in the plan, charging right before departure or before preconditioning. What does this PR do if preconditioning is active?

Comment thread core/loadpoint_plan.go Outdated
@naltatis

naltatis commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Is this even an issue? If the "last" cheap slot is skipped it ends up as the very last slot in the plan, charging right before departure or before preconditioning. What does this PR do if preconditioning is active?

Right now a short final slot right before the goal is skipped, including a short preconditioning block. The planner then falls back to charging continuously once time runs out, which finishes late and at a higher price. The skipping was introduced to guard against on/off cycles. If no further on/off follows (last slot or part of a longer section), there is nothing to guard and we shouldn't skip.

@iseeberg79

Copy link
Copy Markdown
Contributor

Yes, thinking this direction as well. Kind of special case to charge a short slot / soc range which should not hit the guard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Planner skips charging slot when required duration is under 14 minutes ("slot too short")

3 participants