mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Clarify this
in templates (#35658)
This commit is contained in:
parent
affcd69646
commit
71e1e66221
@ -106,6 +106,10 @@ Extensions allow templates to access all of the Home Assistant specific states a
|
||||
|
||||
Templates for some [triggers](/docs/automation/trigger/) as well as `trigger_variables` only support a subset of the Home Assistant template extensions. This subset is referred to as "Limited Templates".
|
||||
|
||||
### This
|
||||
|
||||
State-based and trigger-based template entities have the special template variable `this` available in their templates and actions. See more details and examples in the [Template integration documentation](/integrations/template).
|
||||
|
||||
### States
|
||||
|
||||
Not supported in [limited templates](#limited-templates).
|
||||
|
@ -441,7 +441,11 @@ This video tutorial explains how to set up a Trigger based template that makes u
|
||||
|
||||
### Template and action variables
|
||||
|
||||
State-based and trigger-based template entities have the special template variable `this` available in their templates and actions. The `this` variable is the [state object](/docs/configuration/state_object) of the entity and aids [self-referencing](#self-referencing) of an entity's state and attribute in templates and actions. Trigger-based entities also provide [the trigger data](/docs/automation/templating/).
|
||||
State-based and trigger-based template entities have the special template variable `this` available in their templates and actions. The `this` variable is the current [state object](/docs/configuration/state_object) of the entity and aids [self-referencing](#self-referencing) of an entity's state and attribute in templates and actions. Trigger-based entities also provide [the trigger data](/docs/automation/templating/).
|
||||
|
||||
{% note %}
|
||||
Self-referecing using `this` provides the current state for the entity. To access the new state, use the `value` variable.
|
||||
{% endnote %}
|
||||
|
||||
### Rate limiting updates
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user