home-assistant.io/source/_components/sensor.min_max.markdown
2016-11-27 21:13:44 -08:00

1.7 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 Min/max Sensor Instructions how to integrate min/max sensors into Home Assistant. 2016-10-13 12:00 true false true true home-assistant.png Sensor Local Polling 0.31

The min_max sensor platform is consuming the state from other sensors and determine the minimum, maximum, and the mean of the collected states. The sensor will always show you the highest/lowest value which was received from your all monitored sensors. If you have spikes in your values, it's recommended filter/equalize your values with a statistics sensor first.

It's an alternative to the template sensor's value_template: to get the average of multiple sensors.

{% raw %}{{ ((float(states.sensor.kitchen_temperature.state) + 
     float(states.sensor.living_room_temperature.state) +
     float(states.sensor.office_temperature.state)) / 3) | round(2)
}}{% endraw %}

To enable the minimum/maximum sensor, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
sensor:
  - platform: min_max
    entity_ids:
      - sensor.kitchen_temperature
      - sensor.living_room_temperature
      - sensor.office_temperature

Configuration variables:

  • entity_ids (Required): At least two entities to monitor
  • type (Optional): The type of sensor: min, max or mean. Defaults to max.
  • name (Optional): Name of the sensor to use in the frontend.
  • round_digits (Optional): Round mean value to specified number of digits. Defaults to 2.