v1.2.13-beta.5
Pre-releaseRelease v1.2.13-beta.5
Release Date: 2026-02-25
Type: Beta release - Fixes cross-midnight timing artifact in self-consumption utility meters.
What's Changed (since v1.2.13-beta.4)
Fixed
-
Cross-midnight timing artifact in
energia_auto_consumata- The sync guard
that prevents oscillation double-counting (introduced in beta.1) would freeze
auto_consumataat its last calculated value when production stops at sunset.
If any residual gap existed betweenauto_consumataandprodotta - immessa
at that point, it persisted overnight and got attributed to the next day when
production resumed. This caused daily utility meters to show
self-consumed = productiondespite exports occurring.Root cause: The "neither changed" branch of the sync guard correctly reset the
unsync counter but did not check whether the calculated value was still aligned
with the current base sensor values.Fix: Added quiescent reconciliation — when both
prodottaandimmessastop
changing (quiescent period), force-alignauto_consumatawithprodotta - immessa.
This is safe because zero sensor activity means zero oscillation risk. The
reconciliation fires within 60 seconds of both sensors going idle (typically at
sunset), giving hours of margin before the midnight utility meter boundary.A tolerance of 0.001 kWh prevents spurious triggers from floating-point rounding.
Bug Fix History (v1.2.13 beta series)
| Beta | Bug | Root Cause |
|---|---|---|
| beta.1 | Over-counting in calculated energy sensors | Desynchronized prodotta - immessa calculation |
| beta.2 | Idle polls poisoned sync counter | else branch didn't distinguish "one fresh" from "neither fresh" |
| beta.3 | Consumed energy freezes at night | energia_consumata locked inside sync guard |
| beta.4 | (no bug fix — ModbusLink 1.5.1 upgrade) | (dependency update) |
| beta.5 | Cross-midnight timing artifact | Sync guard held stale value during quiescent period |
Testing Focus
After deploying this update:
- After sunset: Monitor
sensor.alfa_energy_self_consumed. It should reconcile
to matchproduced - exportedwithin 1-2 polls of both sensors going idle.
Look for the debug log: "Quiescent reconciliation: aligned auto_consumata". - Next morning: Check daily utility meters.
daily_autoconsumptionshould equal
daily_production - daily_export(previously showed autoconsumption = production). - Daytime (regression check): Verify no oscillation in
sensor.alfa_energy_self_consumed
during peak solar hours.
Technical Details
- Files changed:
api.py(+10 lines in sync guard),test_api.py(+8 new tests),
energy-oscillation-fix.md(algorithm docs) - No new constants or instance variables — the reconciliation uses existing tracking state
- CI: All 3 workflows passing (Lint, Tests, Validate)
Full Changelog:
compare/v1.2.13-beta.4...v1.2.13-beta.5