-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support for energy counter being reset
Energy counters like `sensor.ferroamp_external_energy_consumed` may be reset in Energy Hub leading to lower values than previously known being received from Ferroamp. Current code ignores all lower values since these sensors should be `TOTAL_INCREASING`. However, the total increasing concept in HA has support for counters being reset, so it's ok to provide a lower value. For more info please see: https://developers.home-assistant.io/docs/core/entity/sensor/#state-class-total_increasing This fix will accept lower value if they are "much lower". If a value is only 10 % lower it will still be ignored, since users have reported that invalid values sometimes comes from Ferroamp. However, if values are lower than this we noe will accept them. The statistics functionality in HA will handle this. However the sensor itself will get the newer lower value.
- Loading branch information
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters