Skip to content

fix consideration of max ac out of hybrid systems - #3397

Merged
LKuemmel merged 4 commits into
openWB:masterfrom
LKuemmel:fix_max_ac_out
Jun 10, 2026
Merged

LKuemmel merged 4 commits into
openWB:masterfrom
LKuemmel:fix_max_ac_out

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

Ticket #66003348

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the battery discharge limiting logic to correctly account for hybrid inverters where battery power flows through the inverter and can affect the inverter’s max_ac_out constraint (Ticket #66003348).

Changes:

  • Replaced the prior “PV power beyond max AC out” approach with a hybrid-aware calculation that includes battery discharge power flowing through the inverter.
  • Added helper logic to derive battery power associated with an inverter via the hierarchy.
  • Updated unit tests to validate the new limiting behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/control/bat_all.py Reworks max-AC-out limiting by incorporating hybrid battery power when computing remaining inverter headroom.
packages/control/bat_all_test.py Updates tests to match the new hybrid-aware limiting behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +195 to +207
try:
children = data.data.counter_all_data.get_entry_of_element(inverter.num)["children"]
if len(children):
hybrid = []
for c in children:
if c.get("type") == "bat":
hybrid.append(f'bat{c["id"]}')
break
if len(hybrid):
for bat in hybrid:
# nur wenn der Speicher entlädt, fließt Leistung über den WR
if data.data.bat_data[bat].data.get.power < 0:
bat_power += data.data.bat_data[bat].data.get.power
Comment thread packages/control/bat_all_test.py Outdated
Comment on lines +47 to +48
mock_enty_children = Mock(return_value={"children": [{"id": 1, "type": "bat"}]})
monkeypatch.setattr(data.data.counter_all_data, "get_entry_of_element", mock_enty_children)
@LKuemmel
LKuemmel merged commit 61a8b49 into openWB:master Jun 10, 2026
1 check passed
@LKuemmel
LKuemmel deleted the fix_max_ac_out branch June 10, 2026 12:17
@LKuemmel LKuemmel linked an issue Jul 15, 2026 that may be closed by this pull request
ndrsnhs pushed a commit to ndrsnhs/core that referenced this pull request Aug 24, 2026
* fix consideration of max ac out of hybrid systems

* type hints

* type checker

* typo
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.

Hybrid leistungsbeachtung bei der passiven Speichersteuerung

2 participants