8000
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Home load history: timezone-aware datetimes and additive backfill on manual collection #42
Two issues affect the home load consumption history.
Timezone mismatch. While building the per-device consumption in the optimization loop, the 24h look-back window is created with a naive datetime.now(), but Home Assistant and the persistence layer return timezone-aware (UTC) timestamps. The comparison fails with:
Error getting load history for device '...': can't compare offset-naive and offset-aware datetimes
The same naive/aware mix affects the history purge cut-off.
Manual collection ignores the look-back window. When power points already exist for a device, a manual collection only fetches incrementally from the last stored point, ignoring the requested lookback_hours. Requesting e.g. 30 days returns only the few most recent points and never backfills internal gaps.
Expected
History datetimes are consistently timezone-aware (UTC).
A manual collection honours the requested look-back window and backfills missing data additively, without dropping already-stored points (bounded by Home Assistant's recorder retention).
Notes
The scheduled periodic collection stays incremental for efficiency.
Activity
Merge pull request #43 from markoceri/fix/issue-42-home-load-history-…