mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 04:16:29 +00:00
Clarify energy sensor statistics calculation (#1165)
This commit is contained in:
parent
9e156bab3b
commit
e466749837
@ -103,6 +103,10 @@ zero-point. When `last_reset` changes, the zero-point will be set to 0.
|
||||
If last_reset is not set, the sensor's value when it was first added is used as the
|
||||
zero-point when calculating `sum` statistics.
|
||||
|
||||
To put it in another way: the logic when updating the statistics is to update
|
||||
the sum column with the difference between the current state and the previous state
|
||||
unless `last_reset` has been changed, in which case don't add anything.
|
||||
|
||||
Example of state class `total` without last_reset:
|
||||
|
||||
| t | state | sum | sum_increase | sum_decrease |
|
||||
@ -145,6 +149,10 @@ cycle. This state class is useful for gas meters, electricity meters, water mete
|
||||
The value when the sensor reading decreases will not be used as zero-point when calculating
|
||||
`sum` statistics, instead the zero-point will be set to 0.
|
||||
|
||||
To put it in another way: the logic when updating the statistics is to update
|
||||
the sum column with the difference between the current state and the previous state
|
||||
unless the difference is negative, in which case don't add anything.
|
||||
|
||||
Example of state class `total_increasing`:
|
||||
|
||||
| t | state | sum |
|
||||
|
Loading…
x
Reference in New Issue
Block a user