New export more solar feature#4117
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an “export more solar” optimisation pass to Predbat’s planning engine, allowing the optimiser to convert otherwise-idle export windows into “freeze export” windows when PV is predicted, as long as the plan metric impact stays within a configurable threshold.
Changes:
- Introduces new config entities:
switch.predbat_export_more_solarandinput_number.predbat_export_more_solar_threshold(expert). - Implements
optimise_solar()in the planner and wires it intooptimise_all_windows(). - Adds a dedicated unit test suite for the new optimisation and documents the feature.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/customisation.md | Documents the new “Export more solar” switch and threshold behavior. |
| apps/predbat/unit_test.py | Registers the new optimise-solar test suite in the unit test runner. |
| apps/predbat/tests/test_single_debug.py | Adds a commented debug toggle for the new feature. |
| apps/predbat/tests/test_optimise_solar.py | New tests validating optimise_solar behavior (PV present/absent, threshold reject, freeze disabled, active window untouched). |
| apps/predbat/predbat.py | Bumps version and initializes new config fields on reset. |
| apps/predbat/plan.py | Adds optimise_solar() and invokes it late in optimise_all_windows(). |
| apps/predbat/fetch.py | Reads new config options from args into runtime settings. |
| apps/predbat/config.py | Defines the new switch and threshold entities in CONFIG_ITEMS. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.