Duration-based charging plan type#31722
Draft
andig wants to merge 2 commits into
Draft
Conversation
Add a duration-based static charging plan type alongside soc and energy.
A duration plan runs a loadpoint for a configured run time ("N minutes by
time Y") instead of filling to an energy or soc target - suited to
switch-controlled loads like pool pumps that have no capacity to reach.
The planner already schedules by required duration; duration plans pass
the remaining run time directly instead of converting energy via power.
Energy and duration plans are mutually exclusive per loadpoint. Adds
REST plan/duration + preview routes, MQTT setter, config round-trip and
a duration goal toggle in the charging plan UI.
The ChargingPlan summary tile has no planDuration prop, so the story failed tsc. Duration UI is covered via the modal components.
Member
Author
|
UI screenshots of the new Energy / Duration goal toggle in the charging plan modal (non-soc loadpoint): Energy goal (existing behaviour) Duration goal (new) — run-time preset select, preview scheduled against the tariff: Captured with Playwright against a local build of this branch using Images are hosted on a throwaway 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fix #31677
Adds a duration-based static charging plan as a third plan type next to soc and energy, per the discussion in #31677.
soc and energy plans both assume you are filling something up to a target. A switch-controlled load like a pool pump has no capacity, no soc — the meaningful target is run time: "run for at least N minutes, finishing by time Y". kWh can stand in but varies too much with ambient conditions (issue reporter measured 5–14 kWh for the same 6 h run).
The planner already schedules against a required duration — energy plans just convert energy to duration via power first. A duration plan skips that conversion and passes the remaining run time directly, so it inherits tariff-aware cheapest-slot scheduling, precondition and continuous strategy for free.
planDuration(seconds) stored per loadpoint, mutually exclusive withplanEnergy; remaining run time tracked against charge duration with a set-time offset (mirrorsplanEnergyOffset)POST /plan/duration/{seconds}/{time},DELETE /plan/duration, previewGET /plan/static/preview/duration/{seconds}/{time}planDurationsetter and config round-tripOpening as draft — @andig raised the idea and pinged @naltatis but the design wasn't settled, so this is a concrete proposal to react to rather than a finished call. Happy to adjust the model (units, whether duration counts from plan set vs. resets daily, UI shape).
The daily-minimum / repeating angle from the issue is intentionally out of scope — as noted in the thread that can be driven by creating a plan per day via API; repeating plans for non-soc loadpoints would be a separate change.
🤖 Generated with Claude Code