feat: let attenuate_grid_peaks withhold charging (#71)#79
Open
andig wants to merge 1 commit into
Open
Conversation
The attenuate_grid_peaks charging strategy previously only re-timed (deferred) battery charging toward high-solar intervals via a +c*ft reward. For feed-in peak shaving (Solarspitzengesetz) it is also useful to actively withhold charging below the solar peak, keeping battery capacity free to absorb the midday peak instead of filling early and losing curtailed surplus. Add a per-battery `withhold_charge` capability flag. When set, the strategy adds a -c*(max_solar-ft) term so charging below the peak carries a net-negative incentive, letting the battery forgo charging (exporting cost-neutral surplus) rather than only deferring it. This mirrors a battery that can be told to pause charging (evcc#27906); without the capability the strategy behaviour is unchanged. Stays within the cost-neutral tie-breaker regime: the term is not part of get_clean_objective_value(), so the economic optimum is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
closes #71
The
attenuate_grid_peakscharging strategy could previously only re-time charging toward high-solar intervals, never forgo it. For feed-in peak shaving (Solarspitzengesetz) the battery should also be able to hold off charging early in the day, so feed-in spreads out and capacity stays free to absorb the midday peak that would otherwise be lost to the export cap. Whether the optimizer may plan this depends on the battery being able to pause charging (the counterpart to evcc-io/evcc#27906), so it is gated behind a new per-battery capability.withhold_chargeflag (defaultfalse), behavior unchanged when unsetattenuate_grid_peaks, awithhold_chargebattery gets a net-negative incentive on charging below the solar peak, so it may forgo charging and export cost-neutral surplus instead of filling early