Document that variables can be templated (#22103)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Pieter Rautenbach 2022-03-21 16:25:53 +02:00 committed by GitHub
parent 6b35e63615
commit e2ad20b99a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,22 @@ The variables action allows you to set/override variables that will be accessibl
{% endraw %}
Variables can be templated.
{% raw %}
```yaml
- alias: "Set a templated variable"
variables:
blind_state_message: "The blind is {{ states('cover.blind') }}."
- alias: "Notify about the state of the blind"
service: notify.mobile_app_iphone
data:
message: "{{ blind_state_message }}"
```
{% endraw %}
### Scope of Variables
Variables have local scope. This means that if a variable is changed in a nested sequence block, that change will not be visible in an outer sequence block.