Skip to content

bidi: fix discharging if limit_soc is reached#2775

Merged
LKuemmel merged 2 commits intoopenWB:masterfrom
LKuemmel:bidi
Oct 23, 2025
Merged

bidi: fix discharging if limit_soc is reached#2775
LKuemmel merged 2 commits intoopenWB:masterfrom
LKuemmel:bidi

Conversation

@LKuemmel
Copy link
Contributor

@LKuemmel LKuemmel commented Sep 22, 2025

Wenn der Überschuss-SoC erreicht ist, darf nur noch bidirektional entladen werden, aber nicht weiter geladen.

Überschuss-SoC = 90%
Bidi:

  • 89% -> lädt und entlädt
  • 90%, 91% -> entlädt, lädt nicht

PWM:

  • 89% -> lädt
  • 90%, 91% -> lädt nicht

@LKuemmel LKuemmel added this to the 2.1.9 milestone Sep 22, 2025
Comment on lines +553 to +556
if (limit.selected == "soc" and
(soc > limit.soc_limit if (plan.bidi_charging_enabled and bidi_state == BidiState.BIDI_CAPABLE)
else soc >= limit.soc_limit) and
soc >= limit.soc_scheduled):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (limit.selected == "soc" and
(soc > limit.soc_limit if (plan.bidi_charging_enabled and bidi_state == BidiState.BIDI_CAPABLE)
else soc >= limit.soc_limit) and
soc >= limit.soc_scheduled):
def is_below(soc: int, soc_limit: int) -> bool:
if plan.bidi_charging_enabled and bidi_state == BidiState.BIDI_CAPABLE:
return soc > soc_limit
else
return soc >= soc_limit
if all(limit.selected == "soc"
soc >= limit.soc_scheduled
is_below(soc, limit.soc_limit)):

@LKuemmel LKuemmel merged commit b5714c7 into openWB:master Oct 23, 2025
1 check passed
@LKuemmel LKuemmel deleted the bidi branch October 23, 2025 12:55
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.

2 participants