Voice control, custom sentences (#28000)

* Voice control, custom sentences

- add procedure on using custom sentences to trigger an automation

* Add final step. Fix typo.

* Tiny tweak
This commit is contained in:
c0ffeeca7 2023-06-28 19:36:51 +02:00 committed by GitHub
parent 7bb56b2afe
commit 6c6753da9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -4,7 +4,33 @@ title: "Assist - Custom Sentences"
You may add your own sentences to the intent recognizer by either extending an [existing intent](https://developers.home-assistant.io/docs/intent_builtin/) or creating a new one. You may also [customize responses](#customizing-responses) for existing intents.
## In configuration.yaml
## Adding a custom sentence to trigger an automation
This is the easiest method to get started with custom sentences for automations.
### Prerequisites
If you have not set up voice control yet, set up the hardware first. For instructions, refer to one of the following tutorials:
- [World's most private voice assistant](/voice_control/worlds-most-private-voice-assistant/): Using a phone.
- [$13 voice remote for Home Assistant](/voice_control/thirteen-usd-voice-remote/): Using a button with speaker and mic.
### To add a custom sentence to trigger an automation
1. Under **{% my automations title="Settings > Automations & Scenes" %}**, in the bottom right corner, select **Create automation**.
1. In the **Trigger** drop-down menu, select **Sentence**.
1. Enter one or more sentences that you would like to trigger an automation.
* Do not use punctuation.
* You can add multiple sentences. They will then all trigger that automation.
![Add a custom sentence](/images/assist/sentence_trigger_01.png)
1. To test the automation, go to **Overview** and in the top right corner, open Assist.
- Enter one of the sentences.
1. If it did not work out, checkout the [troubleshooting](/voice_control/troubleshooting/) section.
- One of the causes could be that the device you're targeting has not been exposed to Assist.
1. Pick up your voice control device and speak the custom sentence.
- Your automation should now be triggered.
## Setting up custom sentences in configuration.yaml
Intents and sentences may be added in the [`conversation`](/integrations/conversation/) config in your `configuration.yaml` file:
@ -43,7 +69,7 @@ intent_script:
Besides a text response, `intent_script` can trigger any `action` available in Home Assistant, such as calling a service or firing an event.
## In config directory
## Setting up sentences in the config directory
More advanced customization can be done in Home Assistant's `config` directory. YAML files in `config/custom_sentences/en`, for example, will be loaded when English sentences (language code `en`) are requested.