Repository navigation
v0.4.0: history from install date, feed-in price, net metering end date - #6
Merged
Merged
Conversation
Before that day solar in the battery is valued at the import price; from it the feed-in price counts. Prefilled with 1 January 2027 for Dutch installs.
PeterSlijkhuis
marked this pull request as ready for review
September 26, 2026 21:07
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.
Before: All totals started at zero on the day Battery ROI was set up. Telling solar charging from grid charging needed a feed-in price sensor, which users on a fixed feed-in tariff don't have. Users whose net metering ends on a known date had to come back and change the settings on that day.
After:
How:
backfill.pyloads raw state history (about 10 days by default). For older periods it falls back to hourly long-term statistics means, then replays everything on a one-minute grid through the sameAccumulatorandSamplelogic; the hub's sample building is shared as_build(get, at), so the net metering date also applies to replayed history. Hours without statistics for the battery power sensor are skipped as downtime. Version 0.4.0.Tests: 23 pass, including replay profit, skipping downtime, solar vs grid charging with a fixed feed-in, and the switch on the net metering end date.