Skip to content

Duration-based charging plan type#31722

Draft
andig wants to merge 2 commits into
masterfrom
feat/duration-charging-plan
Draft

Duration-based charging plan type#31722
andig wants to merge 2 commits into
masterfrom
feat/duration-charging-plan

Conversation

@andig

@andig andig commented Jul 12, 2026

Copy link
Copy Markdown
Member

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 with planEnergy; remaining run time tracked against charge duration with a set-time offset (mirrors planEnergyOffset)
  • REST POST /plan/duration/{seconds}/{time}, DELETE /plan/duration, preview GET /plan/static/preview/duration/{seconds}/{time}
  • MQTT planDuration setter and config round-trip
  • UI: an Energy / Duration toggle in the charging plan modal for non-soc loadpoints, with a preset run-time select

Opening 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

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.
@andig andig added the enhancement New feature or request label Jul 12, 2026
@github-actions github-actions Bot added the needs decision Unsure if we should really do this label Jul 12, 2026
The ChargingPlan summary tile has no planDuration prop, so the story
failed tsc. Duration UI is covered via the modal components.
@andig

andig commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

UI screenshots of the new Energy / Duration goal toggle in the charging plan modal (non-soc loadpoint):

Energy goal (existing behaviour)

Charging plan — Energy goal

Duration goal (new) — run-time preset select, preview scheduled against the tariff:

Charging plan — Duration goal

Captured with Playwright against a local build of this branch using tests/plan.evcc.yaml (its first, non-soc loadpoint).

Images are hosted on a throwaway assets/screenshots-31722 branch — delete it once GitHub has cached the images, or I can re-upload them as native attachments.


🤖 Generated with Claude Code

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

Labels

enhancement New feature or request needs decision Unsure if we should really do this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minumum cycle runtime, and minumum daily run time, with configurable times.

1 participant