mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
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:
parent
7218029b34
commit
c43ac57f42
@ -67,10 +67,19 @@ Delays are useful for temporarily suspending your script and start it at a later
|
|||||||
```yaml
|
```yaml
|
||||||
# Waits 1 minute
|
# Waits 1 minute
|
||||||
- delay:
|
- delay:
|
||||||
# supports milliseconds, seconds, minutes, hours, days
|
# Supports milliseconds, seconds, minutes, hours, days
|
||||||
minutes: 1
|
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 %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
# Waits however many minutes input_number.minute_delay is set to
|
# 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 %}
|
{% raw %}
|
||||||
```yaml
|
```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') }}"
|
- wait_template: "{{ is_state('media_player.floor', 'stop') }}"
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```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') }}"
|
- wait_template: "{{ is_state('binary_sensor.entrance', 'on') }}"
|
||||||
timeout: '00:01:00'
|
timeout: '00:01:00'
|
||||||
continue_on_timeout: 'true'
|
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 %}
|
{% raw %}
|
||||||
```yaml
|
```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 }}"
|
- wait_template: "{{ states.climate.kitchen.attributes.valve|int < 10 }}"
|
||||||
timeout: '00:01:00'
|
timeout: '00:01:00'
|
||||||
continue_on_timeout: 'false'
|
continue_on_timeout: 'false'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user