Demonstrate that complex templates can be used for script delays (#6224)

* Demonstrate that complex templates can be used for script delays

* Fix escaping

* Start comments with a capital letter
This commit is contained in:
Rohan Kapoor 2018-09-08 06:56:44 -07:00 committed by Fabian Affolter
parent 7218029b34
commit c43ac57f42

View File

@ -67,10 +67,19 @@ Delays are useful for temporarily suspending your script and start it at a later
```yaml
# Waits 1 minute
- delay:
# supports milliseconds, seconds, minutes, hours, days
# Supports milliseconds, seconds, minutes, hours, days
minutes: 1
```
{% raw %}
```yaml
# Waits however many seconds input_number.second_delay is set to
- delay:
# Supports milliseconds, seconds, minutes, hours, days
seconds: "{{ states('input_number.second_delay') }}"
```
{% endraw %}
{% raw %}
```yaml
# Waits however many minutes input_number.minute_delay is set to
@ -85,14 +94,14 @@ Wait until some things are complete. We support at the moment `wait_template` fo
{% raw %}
```yaml
# wait until media player have stop the playing
# Wait until media player have stop the playing
- wait_template: "{{ is_state('media_player.floor', 'stop') }}"
```
{% endraw %}
{% raw %}
```yaml
# wait for sensor to trigger or 1 minute before continuing to execute.
# Wait for sensor to trigger or 1 minute before continuing to execute.
- wait_template: "{{ is_state('binary_sensor.entrance', 'on') }}"
timeout: '00:01:00'
continue_on_timeout: 'true'
@ -125,7 +134,7 @@ You can also get the script to abort after the timeout by using `continue_on_tim
{% raw %}
```yaml
# wait until a valve is < 10 or continue after 1 minute.
# Wait until a valve is < 10 or continue after 1 minute.
- wait_template: "{{ states.climate.kitchen.attributes.valve|int < 10 }}"
timeout: '00:01:00'
continue_on_timeout: 'false'