From 22a3c87dd6a904f08c6ba256c89d236c2c5e1078 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 22 Mar 2022 12:05:40 +0100 Subject: [PATCH] Add config flow for Threshold (#22071) --- source/_integrations/threshold.markdown | 33 +++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/source/_integrations/threshold.markdown b/source/_integrations/threshold.markdown index 617b4a796d0..7c56cca9a69 100644 --- a/source/_integrations/threshold.markdown +++ b/source/_integrations/threshold.markdown @@ -10,27 +10,34 @@ ha_quality_scale: internal ha_codeowners: - '@fabaff' ha_domain: threshold +ha_config_flow: true ha_platforms: - binary_sensor --- -The `threshold` binary sensor platform observes the state of another sensor. If the value is below (`lower`) or higher (`upper`) than the given threshold then state of the threshold sensor is changed. It support also a range if `lower` and `upper` are given. +The threshold integration observes the state of another sensor. If the value is below or higher than the given threshold then state of the threshold sensor is changed. It support also a range both the upper and lower limits are given. -If the sensor is configured with no hysteresis and the sensor value is equal to the threshold, the sensor is turned off since it is not `lower` or `upper` with respect to the threshold. +If the sensor is configured with no hysteresis and the sensor value is equal to the threshold, the sensor is turned off since it is not upper or lower with respect to the threshold. -It's an alternative to the template binary sensor's `value_template:` to get the abnormal/too high/too low states. +{% include integrations/config_flow.md %} +{% configuration_basic %} +Name: + description: The name the sensor should have. You can change it again later. +Input sensor: + description: The entity providing numeric readings to apply the threshold on. +Hysteresis: + description: The distance the observed value must be from the threshold before the state is changed. +Lower limit: + description: The lower threshold which the observed value is compared against. +Upper limit: + description: The upper threshold which the observed value is compared against. +{% endconfiguration_basic %} -{% raw %} +## YAML Configuration -```yaml -{{ states('sensor.furnace') > 2.5 }} -``` - -{% endraw %} - -## Configuration - -To enable the threshold sensor, add the following lines to your `configuration.yaml`: +Alternatively, this integration can be configured and set up manually via YAML +instead. To enable the Integration sensor in your installation, add the +following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry