Skip to content

Feat: SoC balance Cycle option with configurable hysteresis - #159

Open
wouterbouvy wants to merge 1 commit into
gitcodebob:mainfrom
wouterbouvy:feat/soc-balance-cycle
Open

Feat: SoC balance Cycle option with configurable hysteresis#159
wouterbouvy wants to merge 1 commit into
gitcodebob:mainfrom
wouterbouvy:feat/soc-balance-cycle

Conversation

@wouterbouvy

@wouterbouvy wouterbouvy commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new SoC balance Cycle option that prioritizes the lowest-SoC battery when charging and the highest-SoC battery when discharging on every control cycle.
  • Includes configurable SoC balance hysteresis (default 3%) so priority does not chatter when SoCs are close; set to 0 for pure SoC sort.
  • Especially helpful for mixed-capacity setups (different kWh). Existing Auto balance (30-minute round-robin) is unchanged.

Test plan

  • Reload HA helpers / package and confirm Cycle shows SoC balance and the new hysteresis helper (default 3%)
  • Select SoC balance with 2+ batteries at different SoC; verify charge prefers lowest SoC and discharge prefers highest SoC
  • With hysteresis at 3%, confirm priority does not flip when SoC gap is < 3%
  • Set hysteresis to 0 and confirm order follows live SoC every cycle
  • Confirm Auto balance / Daily / Weekly / Never still behave as before
  • Run ./contribute/check.ps1 and confirm it passes

Made with Cursor

Keep multi-battery SoC aligned by prioritizing lowest SoC when charging
and highest when discharging, with sticky hysteresis to avoid chatter.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wouterbouvy
wouterbouvy marked this pull request as ready for review July 23, 2026 09:25
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