Repository navigation
Hold charging: freeze_charge with a target below the SoC discharges down to it - #50
Merged
Merged
Conversation
…own to it Predbat's "Hold charging" (limit below the SoC) sends freeze_charge with the limit as target_soc and raises the reserve to limit+1, meaning "discharge down to the reserve, then hold". The executor froze at the current SoC at once and ignored both, so a 90% battery planned to fall to 86% stayed at 90% (2026-10-11, depth 90 written at 12:01). freeze_charge now keeps target_soc. While the whole SoC is above it the executor stays in AUTO; after TARGET_DEBOUNCE at the target it freezes there and stays frozen. No target, or a target at or above the whole SoC (FrzChrg, car/iBoost hold), still freezes at the current SoC at once. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 4 tasks
3 tasks done
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.
Why
Predbat's "Hold charging" with a limit below the current SoC means "discharge down to the limit, then hold". It sends
freeze_chargewith the limit astarget_socand raises the reserve to limit+1. The executor ignoredtarget_socforfreeze_chargeand froze at the current SoC at once. On 2026-10-11 a battery at 90% that was planned to fall to 86% stayed at 90% (depth 90 was written at 12:01).What
control.py:freeze_chargenow keepstarget_soc.auto(reasonholding above target_soc).TARGET_DEBOUNCE, it freezes there and stays frozen (latched).MQTT_TOPICS.md: thecontrol/settable documentstarget_socforfreeze_charge. The HA script andapps.yamlchanges that pass it are in Docs: HA + Predbat setup as deployed, Python 3.12, systemd service #51 (that PR works with or without this one; without it the target is ignored as before).Deployed
Running on my Pi since 2026-10-11, as part of
hold-charge-below-soc: the same commit, on top of #49. This branch is that commit rebased ontomainon its own.Test plan
pytest -q tests: 596 passed.tests/test_control.pyhas new cases for a hold above the target, the debounce, the latch, and a target at or above the SoC.🤖 Generated with Claude Code