Skip to content

v1.2.13-beta.2

Pre-release
Pre-release

Choose a tag to compare

@alexdelprete alexdelprete released this 24 Feb 14:20
v1.2.13-beta.2
90869cf

Release v1.2.13-beta.2

GitHub Downloads

Release Date: 2026-02-24

Type: Beta release - Fixes sync mechanism that failed to prevent energy oscillation.

What's Changed (since v1.2.13-beta.1)

Fixed

  • Sync timeout counter poisoned by idle polls - The beta.1 sync mechanism's timeout counter
    incremented on every poll, including idle polls where neither energia_prodotta nor
    energia_immessa changed. During the ~14 minutes between Alfa firmware register updates
    (when both values are static), the counter cycled through 0-1-2(timeout)-0-1-2... When the
    firmware finally updated one sensor, the counter could already be near the timeout threshold,
    causing it to fire immediately and calculate prodotta - immessa with desynchronized values.

    Root cause: The else branch in _calculate_derived_values() treated "one sensor changed"
    and "neither changed" identically — both incremented the timeout counter.

    Fix: Split into two branches:

    • Exactly one changed — increment counter, wait for the other (with timeout fallback)
    • Neither changed — reset counter to 0 (no new data to act on)

    This ensures the counter is always at 0 when the first actual firmware update arrives,
    giving the second sensor a full timeout window to catch up.

Testing Focus

After deploying this update:

  1. Monitor sensor.alfa_energy_self_consumed during peak solar production hours
  2. The history graph should show smooth monotonic increase — NO sawtooth dips
  3. Utility meters tracking autoconsumption should not show sudden jumps

Technical Details

  • Files changed: api.py (sync logic), test_api.py (updated + regression test)
  • Test coverage: 98%
  • CI: All 3 workflows passing (Lint, Tests, Validate)

Full Changelog:
compare/v1.2.13-beta.1...v1.2.13-beta.2