mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
* Added "Trigger State Object" section (#3863)
This commit is contained in:
parent
1b65feb073
commit
1d6c309d4d
@ -51,6 +51,14 @@ There are a few very important rules to remember when writing automation templat
|
||||
|
||||
Remembering these simple rules will help save you from many headaches and endless hours of frustration when using automation templates.
|
||||
|
||||
## {% linkable_title Trigger State Object %}
|
||||
|
||||
Knowing how to access the [state object](/docs/configuration/state_object/) of a trigger entity could be one of the more common questions. Here are a few ways for the [`state`](#state), [`numeric_state`](#numeric_state) and [`template`](#template) triggers:
|
||||
|
||||
* `trigger.from_state` will return the **previous** [state object](/docs/configuration/state_object/) of the entity.
|
||||
* `trigger.to_state` will return the **new** [state object](/docs/configuration/state_object/) that triggered trigger.
|
||||
* `states[trigger.to_state.domain][trigger.to_state.object_id]` will return the **current** [state object](/docs/configuration/state_object/) of the entity.
|
||||
|
||||
## {% linkable_title Available Trigger Data %}
|
||||
|
||||
The following tables show the available trigger data per platform.
|
||||
|
Loading…
x
Reference in New Issue
Block a user