utilities/backend
jtricerolph 0b9ac16449 Interpolate period boundaries for historical consumption reports
Reports previously used the raw delta between whichever real readings
happened to fall nearest a period's start/end, un-prorated — accurate
only when readings land close to calendar boundaries. With sparse
readings this misattributes days on either side to the neighbouring
period instead.

getPeriodConsumption() now interpolates the meter's value at each
boundary between the readings bracketing it (linear by day-count),
then diffs those — equivalent to a "daily rate carried forward until
the next reading" spreadsheet approach, generalised across however
many sparse-reading gaps a period spans. Falls back to the old
nearest-reading behaviour when a boundary can't be interpolated (period
starts before the first-ever reading or ends after the latest one).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 13:51:10 +00:00
..
src Interpolate period boundaries for historical consumption reports 2026-07-28 13:51:10 +00:00
Dockerfile Initial commit — utilities app (meter readings, tariffs, cost tracking) 2026-07-26 17:33:42 +00:00
package.json Commit missing MQTT/history/scheduler files referenced by meters.js 2026-07-28 13:32:22 +00:00