mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Add template support to template trigger's for option (#9714)
This commit is contained in:
parent
76fb9e7fdf
commit
8b83098a77
@ -201,6 +201,21 @@ automation:
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
|
You can also use templates in the `for` option.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
automation:
|
||||||
|
trigger:
|
||||||
|
platform: template
|
||||||
|
value_template: "{{ is_state('device_tracker.paulus', 'home') }}"
|
||||||
|
for:
|
||||||
|
minutes: "{{ states('input_number.minutes')|int(0) }}"
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
The `for` template(s) will be evaluated when the `value_template` becomes `true`.
|
||||||
|
|
||||||
<p class='note warning'>
|
<p class='note warning'>
|
||||||
Rendering templates with time (`now()`) is dangerous as trigger templates only update based on entity state changes.
|
Rendering templates with time (`now()`) is dangerous as trigger templates only update based on entity state changes.
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user