diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 0428e9f969b..13dbabb9ffe 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -326,7 +326,7 @@ If for your use case this is undesired, you could consider using the automation ## State trigger 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 at least one of `from` or `to` are given, the trigger will fire on any matching state change, but not if only attributes change. To trigger on all state changes, but not on changed attributes, set at least one of `from` or `to` to `null`. +If at least one of `from`, `to`, `not_from`, or `not_to` are given, the trigger will fire on any matching state change, but not if only attributes change. To trigger on all state changes, but not on changed attributes, set at least one of `from`, `to`, `not_from`, or `not_to` to `null`.
@@ -370,6 +370,21 @@ automation: to: ``` +The `not_from` and `not_to` options are the counter parts of `from` and `to`. They can be used to trigger on state changes that are **not** the specified state. This can be useful to trigger on all state changes, except specific ones. + +```yaml +automation: + trigger: + - platform: state + entity_id: vacuum.test + not_from: + - "unknown" + - "unavailable" + to: "on" +``` + +You cannot use `from` and `not_from` at the same time. The same applies to `to` and `not_to`. + ### Triggering on attribute changes When the `attribute` option is specified, the trigger only fires