evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Plan pause scales phases down to 1p although the plan resumes without pv surplus

Open iqdoq-dfischer opened this issue 1 month ago • 2 comments

During a short pause of a charging plan, evcc scales a phase-switching charger down from 3p to 1p and back up to 3p when the next plan slot starts. Without PV surplus in the pause, the two switches only add relay cycles and an extra contactor start, and on our charger that restart failed.

Setup

  • evcc 0.317.2, Tinkerforge WARP3 (warp-ws) with automatic phase switching (phases: 0), mode smart
  • Tesla Model Y, plan 70 % by 07:30, plan strategy with precondition 2h, not continuous

What happened (2026-10-22, all times local)

  • 05:31 plan starts, 3p at 11.4 kW
  • 06:05 a fresh vehicle SoC (52.9 → 54 %) shortens the required duration below the precondition window, so the planner moves the rest to 06:22–07:30 and pauses charging. This part is expected.
  • 06:05:16 in the pause, smart mode falls through to the PV logic: "scale down to 1p", executed 06:07:15. There was no PV surplus (before sunrise).
  • 06:23:17 plan resumes, fastCharging() scales back to 3p and re-enables. The contactor restart failed on our charger, and the car never charged again until it was unplugged at 07:20.

Expected No PV-driven phase down-scaling while a plan is pending and measured surplus does not enable 1p charging, because the next plan slot switches back to max phases anyway.

Code pvScalePhases() treats scaling down as always useful while the charger is disabled (useful := !lp.enabled || …). plannerActive() knows the plan's slots but only publishes the projected start.

Proposal

  • Remember the plan's first slot start in the loadpoint (recomputed every cycle, cleared whenever there is no plan).
  • In pvScalePhases(), skip the scale-down while the charger is disabled, a plan exists without an active slot, and the loadpoint's own pv enable decision (pvEnableDecision() on 1p, so enable threshold, solar share and residual power apply) would not enable 1p on measured site power.
  • Keep today's behaviour when the loadpoint may not disable (always charge/minpv, battery start or boost), the climater is active, or load management needs the scale-down for headroom.
  • Without a plan, nothing changes. Scaling up is unchanged.

Related

  • Dynamic tariffs: a plan split into the cheapest slots has more pauses, each causing a 3p→1p→3p cycle at night. Smart cost charging runs through fastCharging() with max phases anyway. Pauses before cheap (non-plan) slots are not covered by this proposal.
  • If the optimizer controls the loadpoint, a stop suggestion also falls back to the pv loop (optimizerCharging() → "following measured pv surplus"), so the same check in pvScalePhases() covers that path.

I have a patch with tests ready and will open a PR referencing this issue.

šŸ¤– Generated with Claude Code

iqdoq-dfischer avatar Oct 22 '26 14:10 iqdoq-dfischer

Confirmed in the code: pvScalePhases() in core/loadpoint.go sets useful := !lp.enabled || …, so a disabled charger always scales down to 1p, with no check for a pending plan. The planned fix (skip the scale-down while a plan is pending, the charger is disabled and 1p would not be enabled by the pv decision) looks reasonable. It touches the control loop, so it needs maintainer review. A PR is welcome.

šŸ¤– Generated with Claude Code

github-actions[bot] avatar Oct 22 '26 14:10 github-actions[bot]

Related: #34853 (same idle phase switching path), #33658 (relay wear from unneeded phase switches)

hidminds avatar Oct 22 '26 21:10 hidminds