mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 13:26:54 +00:00
Add default to self-reference template example (#22624)
This commit is contained in:
parent
6e80c89998
commit
b404a280d1
@ -578,7 +578,7 @@ This example demonstrates how the `this` variable can be used in templates for s
|
||||
template:
|
||||
- sensor:
|
||||
- name: test
|
||||
state: "{{ this.attributes.test }}"
|
||||
state: "{{ this.attributes.test | default('Value when missing') }}"
|
||||
# not: "{{ state_attr('sensor.test', 'test') }}"
|
||||
attributes:
|
||||
test: "{{ now() }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user