Skip to content

v0.4.0: history from install date, feed-in price, net metering end date - #6

Merged
PeterSlijkhuis merged 4 commits into
mainfrom
claude/project-thread-1p9qg3
Sep 26, 2026
Merged

PeterSlijkhuis merged 4 commits into
mainfrom
claude/project-thread-1p9qg3

Conversation

@PeterSlijkhuis

@PeterSlijkhuis PeterSlijkhuis commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

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:

  • Battery installed on (under Battery costs) replays Home Assistant's history from that day and fills in Today, This month, Lifetime, energy and payback. A notification says when it's done and from which day data was found.
  • Fixed feed-in price, as an alternative to the sensor. Together with grid power, solar that goes into the battery costs the feed-in price that was given up, and grid charging costs the import price.
  • Net metering until: an optional date that starts empty and works in any country. Before that day the feed-in price is ignored, so a stored solar kWh is worth the full import price. From that day the feed-in price counts, so the setup only has to be done once.

How: backfill.py loads 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 same Accumulator and Sample logic; 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.

@PeterSlijkhuis PeterSlijkhuis changed the title v0.4.0: fill in history from the battery's install date v0.4.0: history from install date, fixed feed-in price Sep 26, 2026
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 PeterSlijkhuis changed the title v0.4.0: history from install date, fixed feed-in price v0.4.0: history from install date, feed-in price, net metering end date Sep 26, 2026
@PeterSlijkhuis
PeterSlijkhuis marked this pull request as ready for review September 26, 2026 21:07
@PeterSlijkhuis
PeterSlijkhuis merged commit 0be70e8 into main Sep 26, 2026
2 checks passed
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.

1 participant