v1.2.13-beta.3
Pre-releaseRelease v1.2.13-beta.3
Release Date: 2026-02-24
Type: Beta release - Fixes consumed energy sensor freezing when production stops.
What's Changed (since v1.2.13-beta.2)
Fixed
-
energia_consumatafreezes when production stops - The consumed energy sensor
(energia_consumata = auto_consumata + prelevata) was locked inside the sync guard
alongsideenergia_auto_consumata. When PV production stops (evening/night),
energia_prodottaandenergia_immessastop changing, so the sync guard stays closed.
Butenergia_prelevata(import from grid) keeps growing every poll. The consumed sensor
froze because it was never recalculated, even though one of its inputs kept changing.Fix: Move
energia_consumatacalculation outside the sync guard so it is always
recalculated on every poll.energia_auto_consumatastays inside the guard (it needs
oscillation protection since it depends onprodotta - immessa). This is safe for
TOTAL_INCREASINGbecause both addends (auto_consumataandprelevata) are
monotonically non-decreasing, so their sum can never dip. -
Debug log spam during nighttime - The "waiting for sync" debug message fired on every
idle poll (neither sensor fresh), producing unnecessary log entries outside production hours.
Now it only fires when one sensor is actually fresh and we're waiting for the other.
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 |
Testing Focus
After deploying this update:
- Overnight test (critical): Monitor
sensor.alfa_energy_consumedafter sunset.
It should keep increasing as grid import (sensor.alfa_energy_imported) grows. - Energy Dashboard: Verify consumption = self-consumed + imported throughout the day.
- Daytime (regression check): Verify
sensor.alfa_energy_self_consumedstill shows
smooth monotonic increase with no sawtooth dips.
Technical Details
- Files changed:
api.py(sync logic + docstring),test_api.py(+5 new tests,
1 updated),energy-oscillation-fix.md(algorithm docs) - Test coverage: 98%
- CI: All 3 workflows passing (Lint, Tests, Validate)
Full Changelog:
compare/v1.2.13-beta.2...v1.2.13-beta.3