Skip to content

fix(inverter): hold software-controlled charging after target overshoot - #5541

Open
Jeff-Bond-UK wants to merge 1 commit into
springfall2008:mainfrom
Jeff-Bond-UK:fix/non-native-charge-target-hold
Open

Jeff-Bond-UK wants to merge 1 commit into
springfall2008:mainfrom
Jeff-Bond-UK:fix/non-native-charge-target-hold

Conversation

@Jeff-Bond-UK

@Jeff-Bond-UK Jeff-Bond-UK commented Oct 13, 2026 •

Copy link
Copy Markdown

When an inverter without native target-SoC control overshoots its charge target between Predbat updates, adjust_charge_immediate() calls charge_stop_service. If that service restores self-consumption, the battery supplies the house until it falls below target and charging starts again. Reaching the target exactly already selects the configured freeze service.

This change tries charge_freeze_service in the existing non-native, above-target branch, retaining charge_stop_service when no freeze service is configured. Native target-SoC control, exact-target handling, explicit freeze handling and discharge/export control keep their existing behaviour.

Hardware evidence

Tested by the reporter on Anker SOLIX Solarbank 4 E5000 Pro with Predbat v9.3.8 and reserve control disabled. Log timestamps are Europe/London, 13 October 2026:

  • 04:35: charging at 2,500 W, reported SoC 19%, target 20%.
  • 04:40: SoC 22%, target 20%; the patched branch invokes the freeze service to set battery power control to 0 W. Subsequent telemetry reports battery power 0 W.
  • 04:45–04:50: SoC remains 22%, battery power 0 W, Hold charging.
  • 04:50: the plan moves to explicit Freeze charging; the battery remains at 22%.
  • 12:05–13:25: explicit Freeze charging remains at 22%, battery power approximately 0 W.
  • 13:30: the next charge period requests 2,500 W normally.

Only the above-target Hold charging behaviour changes in this PR. Explicit freeze observations demonstrate continued operation.

Validation

  • New regression case fails against the unchanged upstream overshoot branch, then passes with this patch.
  • Tests cover above-target charging with and without a freeze service, native-target compatibility, exact-target legacy behaviour, below-target charging, explicit freeze and its fallback, charge termination, and repeated-call deduplication.
  • Inverter and execution suites pass.
  • Ruff, Black, trailing-whitespace, end-of-file and export-limit-encoding hooks pass on the changed files; git diff --check passes.
  • The full pre-commit command could not finish because npm rejected the markdownlint hook's local Git-package installation (EALLOWGIT). No hook configuration was changed.
  • The full --quick suite passes: all tests passed, four slow tests skipped, total time 505.20 seconds.

@Jeff-Bond-UK

Copy link
Copy Markdown
Author

@springfall2008, my Reviewers control is disabled on this PR. Could you formally request a review from a maintainer, or review it yourself please?
Thank you.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant