From d02b9106f0a9ccfc0b9023612e7e9ac6f7fbc960 Mon Sep 17 00:00:00 2001 From: Florian Werner Date: Sat, 8 Sep 2018 01:10:31 +0200 Subject: [PATCH] Update statistics sensor (#6034) --- source/_components/sensor.statistics.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/_components/sensor.statistics.markdown b/source/_components/sensor.statistics.markdown index a169c2cc71d..d28f73eabee 100644 --- a/source/_components/sensor.statistics.markdown +++ b/source/_components/sensor.statistics.markdown @@ -14,7 +14,7 @@ ha_release: "0.30" --- -The `statistics` sensor platform consumes the state from other sensors. Besides the maximum and the minimum values, the total, mean, median, variance and the standard deviation are also available as attributes. If it's a binary sensor then only state changes are counted. +The `statistics` sensor platform consumes the state from other sensors. It exports the `mean` value as state and the following values as attributes: `count`, `mean`, `median`, `stdev`, `variance`, `total`, `min`, `max`, `min_age`, `max_age`, `change`, `average_change` and `change_rate`. If it's a binary sensor then only state changes are counted. If you are running the [recorder](/components/recorder/) component, on startup the data is read from the database. So after a restart of the platform, you will immediately have data available. If you're using the [history](/components/history/) component, this will automatically also start the `recorder` component on startup. If you are *not* running the `recorder` component, it can take time till the sensor starts to work because a couple of attributes need more than one value to do the calculation. @@ -43,6 +43,7 @@ Configuration variables: - **name** (*Optional*): Name of the sensor to use in the frontend. Defaults to `Stats`. - **sampling_size** (*Optional*): Size of the sampling. If the limit is reached then the values are rotated. Defaults to `20`. - **max_age** (*Optional*): Maximum age of measurements. Setting this to a time interval will cause older values to be discarded. +- **precision** (*Optional*): Defines the precision of the calculated values, through the argument of round(). Defaults to `2`.