Repository navigation
fix(car): default car_charging_plan_smart to on (#5237) - #5251
Merged
Merged
Conversation
With smart planning off, the car fills every low-rate slot in time order from plug-in. Low-rate means "below the automatic import threshold", which is rate_max - 0.5, so any one-off rise in rate_max (an Octopus saving session's reward on the import rate) admits the ordinary peak. On #5237 the default setup then charged the car at the 34.6p Go peak; the same cycle after the session ended moved it to 9.5p. Existing installs keep their saved switch value; only new installs (or a switch never created) pick up the new default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
springfall2008
added a commit
that referenced
this pull request
Sep 27, 2026
This was referenced Oct 5, 2026
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.
Addresses #5237 (does not close it - see "Relation to #5163").
Why
With
car_charging_plan_smartoff (the current default),plan_car_charging()fills every slot inlow_ratesin time order from plug-in, whatever the price. "Low rate" means "below the automatic import threshold", which israte_max - 0.5. So anything that liftsrate_maxfor a while admits the ordinary peak as a "low-rate" slot, and a default install charges the car at peak.The #5237 log shows this happening. The user was on default settings, Octopus Go, with a saving session joined for 18:00-19:00:
rate_max43.98p = 34.6p + 9.375p reward)That is roughly 10 kWh × 25p ≈ £2.50 on the car. It also caused a knock-on: with
car_charging_from_batteryon and abest_soc_keepof 5 kWh, the optimiser topped the house battery up to 85% at 34.6p to feed the car. That top-up disappeared in the same cycle that the car plan moved.The battery optimiser rejects an uneconomic charge window. The non-smart car planner does not: admission to
low_ratesis its approval. So the default setting should not be the one that trusts the threshold blindly.Change
car_charging_plan_smartdefaultFalse→TrueinCONFIG_ITEMS, and the matchingget_argfallback infetch.pycar-charging.mdandcustomisation.mdstate the new default and what turning it off doessmart_defaultintest_car_charging_smart.pypins the defaultWho is affected
Existing installs keep their current value. The switch is restored from
predbat_config.jsonor HA history before the default is consulted. Only new installs, or users whose switch has never been created (no car configured until now), get the new default.Users who want the old behaviour can turn the switch off; the docs now say what that does.
Relation to #5163
#5163 fixes the underlying threshold distortion: it takes saving/Axle minutes out of the min/max/average that
set_rate_thresholds()uses, which would have kept the threshold at 34.1p here. That is a code-reading claim - the attached debug.yaml is from 20:00, after the session ended, so it cannot replay the 17:45 state. This PR is independent of #5163 and still worth having: the automatic threshold is a blunt min/max rule, and any other one-off import spike would have the same effect on a price-blind car planner.Testing
./run_all --quick: all passed (includesdebug_cases)./run_pre_commit: all hooks passed🤖 Generated with Claude Code