Deprecate automation trigger "state" (#2665)

Also elaborate on the meaning of a state change when no filters are present.

Also make it clear that "from" and "to" are both optional.
This commit is contained in:
Anders Melchiorsen 2017-05-22 16:30:13 +02:00 committed by Fredrik Lindqvist
parent b871b2b999
commit ab9950f2d1

View File

@ -72,7 +72,7 @@ automation:
### {% linkable_title State trigger %} ### {% linkable_title State trigger %}
Triggers when the state of tracked entities change. If only entity_id given will match all state changes. Triggers when the state of tracked entities change. If only entity_id given will match all state changes, even if only state attributes change.
```yaml ```yaml
automation: automation:
@ -81,11 +81,9 @@ automation:
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
to: 'home' to: 'home'
# Alias for 'to'
state: 'home'
# If given, will trigger when state has been the to state for X time. # If given, will trigger when state has been the to state for X time.
for: for:
hours: 1 hours: 1
@ -96,6 +94,9 @@ automation:
<p class='note warning'> <p class='note warning'>
Use quotes around your values for `from` and `to` to avoid the YAML parser interpreting values as booleans. Use quotes around your values for `from` and `to` to avoid the YAML parser interpreting values as booleans.
</p> </p>
<p class='note warning'>
Using `state` as an alias for `to` is deprecated.
</p>
### {% linkable_title Sun trigger %} ### {% linkable_title Sun trigger %}
Trigger when the sun is setting or rising. An optional time offset can be given to have it trigger for example 45 minutes before sunset, when dusk is setting in. Trigger when the sun is setting or rising. An optional time offset can be given to have it trigger for example 45 minutes before sunset, when dusk is setting in.