home-assistant.io/source/_components/sensor.statistics.markdown
Matt N 2b5d3c0c10 Fix over 100 typos/spelling mistakes :P (#1483)
* Fix a bunch of typos/spelling mistakes
* Removed extra spaces from emulated_hue
* Correct device type. of binary_sensor.enocean.markdown
2016-11-23 10:23:23 +01:00

1.4 KiB

layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_iot_class, ha_release
layout title description date sidebar comments sharing footer logo ha_category ha_iot_class ha_release
page Statistics Sensor Instructions how to integrate statistical sensors into Home Assistant. 2016-09-28 12:10 true false true true home-assistant.png Sensor Local Polling 0.30

The statistics sensor platform is consuming the state from other sensors. Beside the maximal and the minimal value also the total, the mean, the median, the variance, and the standard deviation are as attributes available. If it's a binary sensor then only the state changes are counted.

It can take time till the sensor starts to work because a couple of attributes need more than one value to do the calculation.

To enable the statistics sensor, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
sensor:
  - platform: statistics
    entity_id: sensor.cpu
  - platform: statistics
    entity_id: binary_sensor.movement

Configuration variables:

  • entity_id (Required): The entity to monitor. Only sensors and binary sensor.
  • 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.