Document sentence triggers (#27929)

* Document sentence triggers

* Clean up sentence trigger docs
This commit is contained in:
Michael Hansen 2023-06-26 15:46:58 -05:00 committed by GitHub
parent cca3c787df
commit f201c6b473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ An automation can be triggered by an event, a certain entity state, at a given t
- [Geolocation trigger](#geolocation-trigger)
- [Device triggers](#device-triggers)
- [Calendar trigger](#calendar-trigger)
- [Sentence trigger](#sentence-trigger)
- [Multiple triggers](#multiple-triggers)
- [Multiple Entity IDs for the same Trigger](#multiple-entity-ids-for-the-same-trigger)
@ -892,6 +893,30 @@ automation:
See the [Calendar](/integrations/calendar/) integration for more details on event triggers and the
additional event data available for use by an automation.
## Sentence trigger
A sentence trigger fires when [Assist](/voice_control/) matches a sentence from a voice assistant using the default [conversation agent](/integrations/conversation/).
Sentences are allowed to use some basic [template syntax](https://developers.home-assistant.io/docs/voice/intent-recognition/template-sentence-syntax/#sentence-templates-syntax) like optional and alternative words. For example, `[it's ]party time` will match both "party time" and "it's party time".
```yaml
automation:
trigger:
- platform: conversation
command:
- "[it's ]party time"
- "happy (new year|birthday)"
```
The sentences matched by this trigger will be:
- party time
- it's party time
- happy new year
- happy birthday
Punctuation and casing are ignored, so "It's PARTY TIME!!!" will also match.
## Multiple triggers
It is possible to specify multiple triggers for the same rule. To do so just prefix the first line of each trigger with a dash (-) and indent the next lines accordingly. Whenever one of the triggers fires, [processing](#what-are-triggers) of your automation rule begins.