Repository navigation
feat(car): one charging decision, resting in solar rather than off - #4
Merged
Merged
Conversation
…an off The choice between charging now, following the sun and not charging lived inside the evcc component, derived from two binary sensors. Anyone driving another charger from Home Assistant had to re-derive it, and could combine the sensors into states Predbat never meant. It is now Predbat's own decision, published per car as sensor.<prefix>_car_charging_mode with a reason attribute. The evcc component maps those three states onto evcc's modes and decides nothing itself, so evcc and a plain automation behave identically. Solar is now the resting state rather than off. Off means "do not charge from the surplus", and for a charger holding its own departure plan - evcc included - off takes that plan down with it, which is the plan the component exists to read. Off is therefore published only when it is a decision: the export pays better, or this car does no solar charging. Not being plugged in is an absence, not a decision, and leaves the charger following the sun. The solar slot sensor now also carries why it is off, which is what separates those cases. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mbuhansen
force-pushed
the
fix/car-plugged-state
branch
from
August 19, 2026 16:10
02cd6e9 to
a6053c8
Compare
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.
The choice between charging now, following the sun and not charging lived inside the evcc component, derived from two binary sensors. It is now Predbat's own decision, published per car as
sensor.predbat_car_charging_modewith areasonattribute; the evcc component maps those three states onto evcc's modes and decides nothing itself, so evcc and a plain Home Assistant automation driving any other charger behave identically.Solar is now the resting state rather than off.
offmeans "do not charge from the surplus", and for a charger holding its own departure plan - evcc included -offtakes that plan down with it, which is the plan the component exists to read.offis published only when it is a decision: the export pays better, or the car does no solar charging at all.nowgrid_slotnowsolarsolar/idlepv(orminpv)offexport_better/solar_disabledoffNew
car_charging_modetest covering all six cases without evcc, plus the reworked evcc mapping tests. Docs updated in car-charging.md, components.md and customisation.md.🤖 Generated with Claude Code