Allow wait template to run the remainder of the script (#5954)

* Adding new proceed variable

* Fixing documentation langauage

* Updating documentation due to code changes

* Changing default to continue to execute after delay
This commit is contained in:
Hovo (Luke) 2018-08-14 04:24:35 +10:00 committed by Franck Nijhof
parent 91477858fd
commit def92b9b39

View File

@ -81,7 +81,7 @@ Delays are useful for temporarily suspending your script and start it at a later
### {% linkable_title Wait %} ### {% linkable_title Wait %}
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`. 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`.
{% raw %} {% raw %}
```yaml ```yaml
@ -92,9 +92,10 @@ Wait until some things are complete. We support at the moment `wait_template` fo
{% raw %} {% raw %}
```yaml ```yaml
# wait until a valve is < 10 or abort after 1 minute. # wait for sensor to trigger or 1 minute before continuing to execute.
- wait_template: "{{ states.climate.kitchen.attributes.valve|int < 10 }}" - wait_template: "{{ is_state('binary_sensor.entrance', 'on') }}"
timeout: '00:01:00' timeout: '00:01:00'
continue_on_timeout: 'true'
``` ```
{% endraw %} {% endraw %}
@ -120,6 +121,17 @@ It is also possible to use dummy variables, e.g., in scripts, when using `wait_t
``` ```
{% endraw %} {% endraw %}
You can also get the script to abort after the timeout by using `continue_on_timeout`
{% raw %}
```yaml
# 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'
```
{% endraw %}
### {% linkable_title Fire an Event %} ### {% linkable_title Fire an Event %}
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. 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.