Repository navigation
Repair historical Home use gaps from retained source measurements #1750
Description
On v0.154.0-beta.1 (3c9ff912), Home use for 19 October 2026, Europe/Stockholm remains unknown after short source/recording gaps, although retained power observations support reconstructing some affected historical intervals.
Observed evidence
/api/energy/daily:load_wh: null,pv_wh: null,history_quality: incompletefor 19 October.- Fixed 00:00–14:00 CEST window: 163 of 168 accepted five-minute consumer intervals sum to 26.603 kWh. This is a derived subtotal, not a complete day.
- Missing five-minute intervals begin at 00:50, 02:20, 12:35, 13:30 and 13:35. Invalid buckets do not prove that every source poll in those buckets was lost.
- Updates overlap 00:50 and 13:32. SMA has no saved observations from 02:22:11.923 to 02:24:37.279, with zero power on either side and counter-jump/reset markers in the same interval. EV is unknown in a history aggregate around 12:38; its exact cause remains unverified.
- Current telemetry and storage were healthy at inspection. No database corruption or persistent write failure was established.
Required result
Provide actual historical reconstruction, not only visibility of accepted subtotals. Prepare a reviewed repair plan from explicitly selected retained AC power series, with bounded interpolation, preserved originals, a checked database backup, provenance and atomic application on a working copy. Core must use the durable corrections in historical household daily totals, the household ledger and chart aggregates. Clear stale derived caches, preserve genuine unknown gaps, and never relabel estimates as measured energy or feed them into control/forecast training.
Keep an accepted-interval subtotal and coverage available when unsupported gaps still prevent a complete total. Separate estimated household quality from other missing flows: reconstructing Home use must not make a missing PV measurement known.
Existing work
Issue #1667 and merged PR #1668 addressed brief negative-balance episodes and a separate additive repair for 13–16 October. This new evidence includes source/writer gaps; it is not proof of a regression in their bounded balance case. #1720 keeps estimates out of measured energy; #1741/#1742 provide source-interval history. The new repair must preserve those distinctions and reuse existing additive estimate storage.
PR #1751 implements a copy-only prepare/apply tool and corrected Core reads, with tests for historical before/after totals, restart, portable backup/restore, retention, unchanged originals, atomic rollback, exact-plan validation, idempotency, unsupported gaps, signed balance and API/UI estimate labeling. Physical validation on the affected Pi remains separate. No reconstructed full-day figure or live installation is claimed by this issue.
Activity
[-]Home use loses its accepted subtotal after source or recording gaps[/-][+]Repair historical Home use gaps from retained source measurements[/+]fix(history): forgiving Home use display, strict marker for training
fix(history): count unknown PV as 0 W after sunset
fix(history): count unknown PV as 0 W after sunset
fix(history): keep Home use through device dropouts and restarts (#1753)
fix(history): count unknown PV as 0 W after sunset
fix(history): count unknown PV as 0 W after sunset (#1755)