mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 21:36:52 +00:00
Document that variables can be templated (#22103)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
6b35e63615
commit
e2ad20b99a
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user