mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
Add state object detail to numeric state (#31809)
* Add state object detail to numeric state The numeric state trigger populates an object called `state` but this was not in the documentation previously. This change makes it explicit and also provides a link to the relevant state object documentation. * Update trigger.markdown User more concise explanation of the state object in the numeric trigger, and added an example using `state.state` * Update trigger.markdown Added explanation to examples that use `state`
This commit is contained in:
parent
5d4cc78296
commit
184b19d109
@ -257,7 +257,24 @@ automation:
|
||||
|
||||
{% endraw %}
|
||||
|
||||
More dynamic and complex calculations can be done with `value_template`.
|
||||
More dynamic and complex calculations can be done with `value_template`. The variable 'state' is the [state object](/docs/configuration/state_object) of the entity specified by `entity_id`.
|
||||
|
||||
The state of the entity can be referenced like this:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
trigger:
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.temperature
|
||||
value_template: "{{ state.state | float * 9 / 5 + 32 }}"
|
||||
above: 70
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
Attributes of the entity can be referenced like this:
|
||||
|
||||
{% raw %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user