Repository navigation
fix(execute): leave the discharge rate alone while charging during a car hold (#5419) - #5470
Open
chalfontchubby wants to merge 1 commit into
Open
chalfontchubby wants to merge 1 commit into
chalfontchubby wants to merge 1 commit into
Conversation
…car hold (#5419) "Hold for car" on an inverter without timed pause set the battery discharge rate to 0 for the whole car slot, even while the house battery was charging in a charge window. A charging battery cannot feed the car, so the write did nothing useful - and some GivEnergy hybrids (GIV-HY3.6 / Gen 1 via GivTCP) will not grid-charge at all with the discharge rate at 0 and the SoC on the reserve. The battery then sat at reserve for the whole cheap window while the status read "Charging, Hold for car" (#5419, #5467). While the inverter's own status is "Charging", the hold now skips the rate write, as it already skipped the reserve bump (#3899), and logs that it has deferred. Once charging stops (Hold charging, Demand), both apply as before. The test now reads this inverter's status rather than the fleet-wide one, which can carry over from an earlier inverter. Inverters with timed pause still pause discharge during the charge: it is one latched write that blocks only discharge, and no report ties it to the charging fault. Tests: car_charge_no_reserve_ratchet now expects the maximum rate while charging (it failed on main with "Discharge rate should be 1000 got 0"), and car_charge2_no_pause pins the rate hold still applying under Hold charging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Posted by Claude on behalf of @chalfontchubby.
Closes #5419. Also fixes the house-battery half of #5467, which is the same fault on a GivEnergy Hybrid Gen 1.
What users see
On a night when the car charges, the house battery stays at its reserve for the whole cheap window. Predbat's status reads
Charging, Hold for car, and the inverter has accepted every write: charge slot enabled, target 100%, charge rate 2600 W. The battery starts charging only after the car hold ends.Cause
On an inverter without timed pause, "Hold for car" sets the battery discharge rate to 0 for the whole car slot (
execute.py, the car-hold block inexecute_plan). It does this even while the house battery is charging in a charge window. A charging battery cannot feed the car, so the write achieves nothing. On these GivEnergy hybrids, a discharge rate of 0 with the SoC on the reserve stops grid charging altogether.The evidence comes from two installs:
Fix
While the inverter's own status is
Charging, the hold now skips the rate write. It already skipped the reserve bump in this state (#3899). Instead it logs that the hold is deferred. Once charging stops (Hold charging, Demand), the rate and reserve hold apply as before.The condition reads this inverter's status (
status_per_inverter), not the fleet-widestatus, which can carry over from an inverter processed earlier.Inverters with timed pause are deliberately unchanged and still pause discharge during the charge. The pause is one latched write that blocks only discharge. It also covers the moments when the inverter reaches its target before Predbat sees it, and no report ties it to the charging fault.
Known limits (deliberately out of scope)
set_discharge_during_chargeoff (default on): on these inverters it still sets the rate to 0 for every charge window, so the same quirk could bite with no car involved. I have no report of that, so I've left it alone.set_soc_enableoff, the status stays "Charging" even after the inverter reaches its own target., Hold for carstatus annotation stays while the hold is deferred, because the hold comes back as soon as charging stops. I'm happy to drop it if you'd rather the status show only holds actually applied.How to check
./run_all --test execute:car_charge_no_reserve_ratchetnow expects the maximum discharge rate while charging. On main it fails withDischarge rate should be 1000 got 0.car_charge2_no_pausepins the rate hold still applying under Hold charging on an inverter without timed pause. It fails if the skip is widened to cover "Hold charging"../run_all --quickpasses, and pre-commit passes.🤖 Generated with Claude Code