v4.3.3 - Fix Negative Statistics Spikes
Pre-release
Pre-release
Bug Fix
Fixes massive negative spikes (~-25,000 kWh) on Energy Dashboard
Root Cause
Blocking database call in sync callback context was failing silently in Python 3.13+ / HA 2024.x+, causing statistics to reset to sum=0.
Changes
- Move get_last_statistics() from sync callback to async Coordinator
- Use pre-fetched stats to avoid blocking calls
- Implement backward calculation from anchor
- Add data_updater.py with clean architecture
After Update
Clear statistics and re-import history:
- Integration Options → Clear Stats
- Integration Options → Fetch History (5+ days)