Repository navigation
fix consideration of max ac out of hybrid systems - #3397
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 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) |
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
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.
Ticket #66003348