mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Clarify state trigger functionality (#16184)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
fd5a1be163
commit
ec85500da3
@ -151,7 +151,8 @@ The `for` template(s) will be evaluated when an entity changes as specified.
|
|||||||
|
|
||||||
### State trigger
|
### State trigger
|
||||||
|
|
||||||
Fires when the state of any of given entities changes. If only `entity_id` is given trigger will fire for all state changes, even if only state attributes change.
|
Fires when the state of any of given entities changes. If only `entity_id` is given, the trigger will fire for all state changes, even if only state attributes change.
|
||||||
|
If only one of `from_state` or `to_state` are given, the trigger will fire on any matching state change, but not if only attributes change.
|
||||||
|
|
||||||
<div class='note'>
|
<div class='note'>
|
||||||
|
|
||||||
@ -163,13 +164,28 @@ The values you see in your overview will often not be the same as the actual sta
|
|||||||
automation:
|
automation:
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.paulus, device_tracker.anne_therese
|
entity_id:
|
||||||
|
- device_tracker.paulus
|
||||||
|
- device_tracker.anne_therese
|
||||||
# Optional
|
# Optional
|
||||||
from: "not_home"
|
from: "not_home"
|
||||||
# Optional
|
# Optional
|
||||||
to: "home"
|
to: "home"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
It's possible to give a list of from_states or to_states:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
automation:
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: vacuum.test
|
||||||
|
from:
|
||||||
|
- "cleaning"
|
||||||
|
- "returning"
|
||||||
|
to: "error"
|
||||||
|
```
|
||||||
|
|
||||||
#### Holding a state
|
#### Holding a state
|
||||||
|
|
||||||
You can use `for` to have the state trigger only fire if the state holds for some time.
|
You can use `for` to have the state trigger only fire if the state holds for some time.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user