From 69a5472c6a9ce984e46cac5b6a11740aec620f63 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 5 Sep 2017 09:59:58 +0200 Subject: [PATCH 1/3] Update binary_sensor.template.markdown --- .../_components/binary_sensor.template.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/_components/binary_sensor.template.markdown b/source/_components/binary_sensor.template.markdown index b09f67aab645..99b7d7ca72f9 100644 --- a/source/_components/binary_sensor.template.markdown +++ b/source/_components/binary_sensor.template.markdown @@ -32,6 +32,8 @@ Configuration variables: - **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. - **entity_id** (*Optional*): Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. + - **on_delay** (*Optional*): The amount of time the template state must be met before this sensor will switch to on. + - **off_delay** (*Optional*): The amount of time the template state must be not met before this sensor will switch to off. ## {% linkable_title Examples %} @@ -110,6 +112,20 @@ sensor: icon_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'{% endraw %} ``` +### {% linkable_title Washing Machine Running %} + +This example creates a washing machine "load running" sensor by monitoring an energy meter connected to the washer. During the washer's operation, the energy meter will fluctuate wildly, hitting zero frequently even before the load is finished. By utilizing `off_delay`, we can have this sensor only turn off if there has been no washer activity for 5 minutes. + +```yaml +# Determine when the washing machine has a load running. +binary_sensor: + - platform: template + name: Washing Machine + value_template: {% raw %}'{{ sensor.washing_machine_power > 0 }}'{% endraw %} + off_delay: + minutes: 5 +``` + ### {% linkable_title Is anyone home? %} This example is determining if anyone is home based on the combination From 503c2096992fe3bcb7b86bbfe919ff39551a96e7 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 5 Sep 2017 10:03:48 +0200 Subject: [PATCH 2/3] Update trigger.markdown --- source/_docs/automation/trigger.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 0a9db0bd5e1d..20701512269d 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -68,6 +68,12 @@ automation: # At least one of the following required above: 17 below: 25 + + # If given, will trigger when state has been the to state for X time. + for: + hours: 1 + minutes: 10 + seconds: 5 ```

From 1bb728569314cc6023444131bfbd471d290fbbc5 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 5 Sep 2017 10:04:50 +0200 Subject: [PATCH 3/3] Update trigger.markdown --- source/_docs/automation/trigger.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 20701512269d..ae3a7faf18ee 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -69,7 +69,7 @@ automation: above: 17 below: 25 - # If given, will trigger when state has been the to state for X time. + # If given, will trigger when condition has been for X time. for: hours: 1 minutes: 10