Conversation
|
Ready for maintainer review/merge. Current status:
@frahlg Could you please review/merge when ready? |
|
Problem found I my database by ChatGPT during a clean-up. I believe that this problem was caused by a combination of a less successful migration back from duck base to sqlite and that the pixii identifier changed from the Mac-address during the time duck base was in use. Not likely to happen to anyone else, not anymore! |
|
Thanks @segran2, and thanks for tracing it down. Closing this one: as you say, the cause was the DuckDB→SQLite migration in your own database, and that path is gone. A general fix would also need a different shape. Here the cursor seed runs inside 🤖 Generated with Claude Code |
Problem
When a device is first known by MAC and later reports a hardware serial,
ResolveDeviceIDupgradesmac:...tomake:serial. Energy ledger cursors are keyed by asset/device ID, so the stronger identity starts withcounter_baselineand loses counter-gap recovery across an outage.This was reproduced on Pixii: the same MAC/endpoint changed from
mac:b827ebf83119topixii:235101100376; the old counters stopped on Sep 8 and the serial asset received a fresh baseline on Sep 25. SMA/Easee, whose identities stayed stable, recovered the same outage viacounter_gap.Fix
Test
Adds a regression test that seeds a MAC counter, refines identity to Pixii serial, and verifies the serial asset recovers the 600 Wh gap instead of creating a zero baseline.
Regression area introduced/hardened around #1186 (
fix(core): confirm live device identity before recording energy counters).