diff --git a/.changeset/ledger-hourly-four-years.md b/.changeset/ledger-hourly-four-years.md new file mode 100644 index 000000000..494f633c6 --- /dev/null +++ b/.changeset/ledger-hourly-four-years.md @@ -0,0 +1,5 @@ +--- +"ftw": patch +--- + +The energy ledger keeps hourly totals for four years instead of two, then daily totals. Skatteverket's refund of energy tax after battery storage is worked out hour by hour for a calendar year and may be claimed until three years after the year ends; with two years of hours, the start of an older year had only daily totals and counted as incomplete. diff --git a/go/internal/state/energy_ledger.go b/go/internal/state/energy_ledger.go index 4b4f9c5cf..84f3ee317 100644 --- a/go/internal/state/energy_ledger.go +++ b/go/internal/state/energy_ledger.go @@ -24,8 +24,11 @@ const ( // Keep recent ledger detail aligned with the legacy history hot tier. // Older energy is additive, so hourly totals preserve its contract while // bounding history growth. Daily totals remain after the hourly horizon. + // Skatteverket's battery refund is worked out hour by hour for a + // calendar year and may be claimed until three years after it ends, so + // the hours of a whole year must last four. EnergyLedgerDetailedRetention = 30 * 24 * time.Hour - EnergyLedgerRetention = 2 * 365 * 24 * time.Hour + EnergyLedgerRetention = 4 * 366 * 24 * time.Hour EnergyLedgerRollupBucketMS = int64(time.Hour / time.Millisecond) EnergyLedgerDailyBucketMS = 24 * EnergyLedgerRollupBucketMS ) @@ -505,7 +508,7 @@ func (s *Store) LoadEnergyHistoryContext(ctx context.Context, q EnergyHistoryQue } // PruneEnergyLedger keeps five-minute detail for 30 days, hourly totals for -// two years and daily totals thereafter. Energy and its source/quality remain +// four years and daily totals thereafter. Energy and its source/quality remain // intact. Each completed hour or day commits before the next begins. func (s *Store) PruneEnergyLedger(ctx context.Context, now time.Time) (hourly, daily int64, err error) { for _, tier := range []struct { diff --git a/web/index.html b/web/index.html index 7f6df3f7a..e5d167340 100644 --- a/web/index.html +++ b/web/index.html @@ -800,7 +800,7 @@

What stands out

-

The figure is grid electricity that the battery stored and later sent back to the grid. Where the readings cannot tell where energy went, FTW counts low: solar counts first in every hour, what the house takes from the battery counts as grid energy first and what goes to the grid as other energy first, losses count as other energy, and an hour counts only when every meter read all of it. The figure assumes FTW reads every solar inverter, battery and car charger on the site, and it uses the battery size set today. You can apply within three years after the year ends, but FTW keeps hourly readings for two, so download the CSV soon after the year ends and keep it with your application. Skatteverket's rules

+

The figure is grid electricity that the battery stored and later sent back to the grid. Where the readings cannot tell where energy went, FTW counts low: solar counts first in every hour, what the house takes from the battery counts as grid energy first and what goes to the grid as other energy first, losses count as other energy, and an hour counts only when every meter read all of it. The figure assumes FTW reads every solar inverter, battery and car charger on the site, and it uses the battery size set today. You can apply within three years after the year ends, and FTW keeps the hourly readings that long. Keep the CSV with your application. Skatteverket's rules