mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
Add config flow for Min/Max (#22116)
This commit is contained in:
parent
9ffe9913d6
commit
68c19b9073
@ -10,30 +10,34 @@ ha_quality_scale: internal
|
|||||||
ha_codeowners:
|
ha_codeowners:
|
||||||
- '@fabaff'
|
- '@fabaff'
|
||||||
ha_domain: min_max
|
ha_domain: min_max
|
||||||
|
ha_config_flow: true
|
||||||
ha_platforms:
|
ha_platforms:
|
||||||
- sensor
|
- sensor
|
||||||
---
|
---
|
||||||
|
|
||||||
The `min_max` sensor platform consumes the state from other sensors to determine the minimum, maximum, latest (last), mean and median of the collected states. The sensor will always show you the lowest/highest/latest value which was received from all monitored sensors. If you have spikes in your values, it's recommended to filter/equalize your values with a [statistics sensor](/integrations/statistics) first.
|
The Min/Max integration consumes the state from other sensors to determine the minimum, maximum, latest (last), mean and median of the collected states.
|
||||||
|
|
||||||
This sensor is an alternative to the [template sensor](/integrations/template)'s `value_template:` to get the average or the median of multiple sensors.
|
The sensor provided by this integration will always show you the lowest/highest/latest value which was received from all monitored sensors. If you have spikes in your values, it's recommended to filter/equalize your values with a [statistics sensor](/integrations/statistics) first.
|
||||||
|
|
||||||
{% raw %}
|
If the source sensor provides an unknown state, it will be ignored in the calculation. If the unit of measurement of the sensors differs, the Min/Max sensor will go to an error state where the value is `UNKNOWN` and unit of measurement is `ERR`.
|
||||||
|
|
||||||
```yaml
|
{% include integrations/config_flow.md %}
|
||||||
{{ ((float(states('sensor.kitchen_temperature')) +
|
{% configuration_basic %}
|
||||||
float(states('sensor.living_room_temperature')) +
|
Name:
|
||||||
float(states('sensor.office_temperature'))) / 3) | round(2)
|
description: The name the sensor should have. You can change it again later.
|
||||||
}}
|
Input entities:
|
||||||
```
|
description: At least two entities to monitor. All entities must use the same unit of measurement.
|
||||||
|
Type:
|
||||||
|
description: The type of the sensor, this can be either "last", "max", "mean", "mean", or "median".
|
||||||
|
Precision:
|
||||||
|
description: Round the calculated mean or median value to at most N decimal places.
|
||||||
|
{% endconfiguration_basic %}
|
||||||
|
|
||||||
{% endraw %}
|
## YAML Configuration
|
||||||
|
|
||||||
Sensors with an unknown state will be ignored in the calculation. If the unit of measurement of the sensors differs, the `min_max` sensor will go to an error state where the value is `UNKNOWN` and unit of measurement is `ERR`.
|
Alternatlively, this integration can be configured and set up manually via YAML
|
||||||
|
instead. To enable the Integration sensor in your installation, add the
|
||||||
## Configuration
|
following to your `configuration.yaml` file:
|
||||||
|
|
||||||
To enable the `min_max` sensor, add the following lines to your `configuration.yaml`:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user