Skip to content

Commit def92b9

Browse files
lhovofrenck
authored andcommitted
Allow wait template to run the remainder of the script (home-assistant#5954)
* Adding new proceed variable * Fixing documentation langauage * Updating documentation due to code changes * Changing default to continue to execute after delay
1 parent 9147785 commit def92b9

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

source/_docs/scripts.markdown

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Delays are useful for temporarily suspending your script and start it at a later
8181

8282
### {% linkable_title Wait %}
8383

84-
Wait until some things are complete. We support at the moment `wait_template` for waiting until a condition is `true`, see also on [Template-Trigger](/docs/automation/trigger/#template-trigger). It is possible to set a timeout after which the script will abort its execution if the condition is not satisfied. Timeout has the same syntax as `delay`.
84+
Wait until some things are complete. We support at the moment `wait_template` for waiting until a condition is `true`, see also on [Template-Trigger](/docs/automation/trigger/#template-trigger). It is possible to set a timeout after which the script will continue its execution if the condition is not satisfied. Timeout has the same syntax as `delay`.
8585

8686
{% raw %}
8787
```yaml
@@ -92,9 +92,10 @@ Wait until some things are complete. We support at the moment `wait_template` fo
9292

9393
{% raw %}
9494
```yaml
95-
# wait until a valve is < 10 or abort after 1 minute.
96-
- wait_template: "{{ states.climate.kitchen.attributes.valve|int < 10 }}"
95+
# wait for sensor to trigger or 1 minute before continuing to execute.
96+
- wait_template: "{{ is_state('binary_sensor.entrance', 'on') }}"
9797
timeout: '00:01:00'
98+
continue_on_timeout: 'true'
9899
```
99100
{% endraw %}
100101

@@ -120,6 +121,17 @@ It is also possible to use dummy variables, e.g., in scripts, when using `wait_t
120121
```
121122
{% endraw %}
122123

124+
You can also get the script to abort after the timeout by using `continue_on_timeout`
125+
126+
{% raw %}
127+
```yaml
128+
# wait until a valve is < 10 or continue after 1 minute.
129+
- wait_template: "{{ states.climate.kitchen.attributes.valve|int < 10 }}"
130+
timeout: '00:01:00'
131+
continue_on_timeout: 'false'
132+
```
133+
{% endraw %}
134+
123135
### {% linkable_title Fire an Event %}
124136

125137
This action allows you to fire an event. Events can be used for many things. It could trigger an automation or indicate to another component that something is happening. For instance, in the below example it is used to create an entry in the logbook.

0 commit comments

Comments
 (0)