Skip to content

v1.2.12

Choose a tag to compare

@alexdelprete alexdelprete released this 18 Feb 09:06
v1.2.12
c898aab

Release v1.2.12

GitHub Downloads

Release Date: 2026-02-18

Type: Patch release - Protects cumulative energy sensors from device reboot zeroed readings.

What's Changed

Bug Fixes

  • Fixed energy dashboard corruption from device reboots
    (Fixes #196)

    When the Alfa device reboots (e.g., due to blocked internet access on the firewall), it briefly
    returns 0 for all Modbus registers while the TCP port remains responsive. Since the cumulative
    energy sensors (energia_prelevata, energia_immessa, energia_prodotta) use
    SensorStateClass.TOTAL_INCREASING, Home Assistant interprets a sudden drop to 0 as a meter
    reset, corrupting the energy dashboard statistics.

    Root cause: The Alfa device periodically reboots when it cannot reach its cloud services.
    During the reboot window, the Modbus TCP port (502) stays open but all registers return zeroed
    values. The integration accepted these as valid readings.

    Fix: The integration now validates cumulative energy sensors (lifetime meter totals) and
    rejects any value that decreases below the previous reading. The last valid value is preserved
    until the device returns correct data. A warning is logged when a value is rejected, providing
    visibility into device reboot events.

    This protection applies only to the 3 base cumulative sensors. The 12 daily energy sensors
    (F1-F6) are not protected because they legitimately reset to 0 at midnight. The 2 calculated
    sensors (energia_consumata, energia_auto_consumata) are automatically protected since they
    derive from the protected base sensors.

Acknowledgments

Thanks to @M4v3r1cK87 for reporting the issue and providing
detailed debug logs that helped diagnose the root cause! Their real-time capture of the device
rebooting with zeroed registers was instrumental in identifying the problem.

Full Changelog

Full Changelog: v1.2.11...v1.2.12