From ec85500da3179d64aefe475ee0a5c8fa1a2f6947 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 15 Jan 2021 19:04:20 +0100 Subject: [PATCH] Clarify state trigger functionality (#16184) Co-authored-by: Franck Nijhof --- source/_docs/automation/trigger.markdown | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 443349800f6..c6ace8ed612 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -151,7 +151,8 @@ The `for` template(s) will be evaluated when an entity changes as specified. ### 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.
@@ -163,13 +164,28 @@ The values you see in your overview will often not be the same as the actual sta automation: trigger: platform: state - entity_id: device_tracker.paulus, device_tracker.anne_therese + entity_id: + - device_tracker.paulus + - device_tracker.anne_therese # Optional from: "not_home" # Optional 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 You can use `for` to have the state trigger only fire if the state holds for some time.