mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 16:27:19 +00:00
Add Statistics config flow (#33427)
* Add Statistics config flow * yaml * Update source/_integrations/statistics.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * tiny tweaks --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
parent
c324575f1f
commit
76b2431174
@ -10,12 +10,13 @@ ha_quality_scale: internal
|
|||||||
ha_codeowners:
|
ha_codeowners:
|
||||||
- '@ThomDietrich'
|
- '@ThomDietrich'
|
||||||
ha_domain: statistics
|
ha_domain: statistics
|
||||||
|
ha_config_flow: true
|
||||||
ha_platforms:
|
ha_platforms:
|
||||||
- sensor
|
- sensor
|
||||||
ha_integration_type: integration
|
ha_integration_type: integration
|
||||||
---
|
---
|
||||||
|
|
||||||
The `statistics` sensor platform observes the state of a source sensor and provides aggregated statistical characteristics about its recent past. This integration can be useful in automations, e.g., to trigger an action when the air humidity in the bathroom settles after a hot shower or when the number of brewed coffee over a day gets too high.
|
The `statistics` integration observes the state of a source sensor and provides aggregated statistical characteristics about its recent past. This integration can be useful in automation, for example, to trigger an action when the air humidity in the bathroom settles after a hot shower or when the number of brewed coffees over a day gets too high.
|
||||||
|
|
||||||
The statistics sensor updates with every update of the source sensor, for which the numeric `sensor` and `binary_sensor` are supported. The time period and/or number of recent state changes, which should be considered, must be given in configuration. Check the configuration section below for details.
|
The statistics sensor updates with every update of the source sensor, for which the numeric `sensor` and `binary_sensor` are supported. The time period and/or number of recent state changes, which should be considered, must be given in configuration. Check the configuration section below for details.
|
||||||
|
|
||||||
@ -27,6 +28,29 @@ The `statistics` integration is different to [Long-term Statistics](https://deve
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% include integrations/config_flow.md %}
|
||||||
|
|
||||||
|
Further information about these configuration options can be found under the [YAML configuration](#yaml-configuration)
|
||||||
|
|
||||||
|
{% configuration_basic %}
|
||||||
|
Name:
|
||||||
|
description: The name the sensor should have.
|
||||||
|
Entity:
|
||||||
|
description: The entity that provides the input. Numeric `sensor` and `binary_sensor` are supported.
|
||||||
|
State_characteristic:
|
||||||
|
description: List of statistical characteristics to choose from.
|
||||||
|
Sampling size:
|
||||||
|
description: Maximum number of source sensor measurements stored.
|
||||||
|
Max age:
|
||||||
|
description: Maximum age of source sensor measurements stored.
|
||||||
|
Keep last sample:
|
||||||
|
description: Defines whether the most recent sampled value should be preserved regardless of the "Max age" setting.
|
||||||
|
Percentile:
|
||||||
|
description: Only relevant in combination with the percentile characteristic. Must be a value between 1 and 99.
|
||||||
|
Precision:
|
||||||
|
description: Defines the number of decimal places of the calculated sensor value.
|
||||||
|
{% endconfiguration_basic %}
|
||||||
|
|
||||||
## Characteristics
|
## Characteristics
|
||||||
|
|
||||||
The following options for the configuration parameter `state_characteristic` are available as staticical characteristics. Pay close attention to the correct configuration of `sampling_size` and/or `max_age`, as most characteristics are directly influenced by these settings.
|
The following options for the configuration parameter `state_characteristic` are available as staticical characteristics. Pay close attention to the correct configuration of `sampling_size` and/or `max_age`, as most characteristics are directly influenced by these settings.
|
||||||
@ -90,7 +114,7 @@ A statistics sensor presents the following attributes for context about its inte
|
|||||||
| `buffer_usage_ratio` | Only when `sampling_size` is defined. Ratio (0.0-1.0) of the configured buffer size used by the stored source sensor measurements. A low number can indicate an unwanted mismatch between the configured limits and the source sensor behavior. The value 1.0 represents a full buffer, value 0 stands for an empty one.
|
| `buffer_usage_ratio` | Only when `sampling_size` is defined. Ratio (0.0-1.0) of the configured buffer size used by the stored source sensor measurements. A low number can indicate an unwanted mismatch between the configured limits and the source sensor behavior. The value 1.0 represents a full buffer, value 0 stands for an empty one.
|
||||||
| `source_value_valid` | True/false indication whether the source sensor supplies valid values to the statistics sensor (judged by the last value received).
|
| `source_value_valid` | True/false indication whether the source sensor supplies valid values to the statistics sensor (judged by the last value received).
|
||||||
|
|
||||||
## Configuration
|
## YAML configuration
|
||||||
|
|
||||||
Define a statistics sensor by adding lines similar to the following examples to your `configuration.yaml`:
|
Define a statistics sensor by adding lines similar to the following examples to your `configuration.yaml`:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user