From fd936fc08225c8a79c2c126cf8b675c0aba14b95 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 6 Mar 2024 07:41:24 +1300 Subject: [PATCH] Add docs for passing the used wake word to the voice_assistant (#3651) --- components/micro_wake_word.rst | 2 ++ components/voice_assistant.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/micro_wake_word.rst b/components/micro_wake_word.rst index d487d9281..5726025ff 100644 --- a/components/micro_wake_word.rst +++ b/components/micro_wake_word.rst @@ -35,6 +35,7 @@ Configuration variables: e.g. ``https://github.com/esphome/micro-wake-word-models/raw/main/models/okay_nabu.json``. - **on_wake_word_detected** (*Optional*, Automation): An automation to perform when the wake word is detected. + The ``wake_word`` phrase from the model manifest is provided as a ``std::string`` to any actions in this automation. The below two options are provided by the JSON file, but can be overridden in YAML. @@ -100,6 +101,7 @@ Example usage on_wake_word_detected: then: - voice_assistant.start: + wake_word: !lambda return wake_word; See Also diff --git a/components/voice_assistant.rst b/components/voice_assistant.rst index b3c487f36..7f9b11655 100644 --- a/components/voice_assistant.rst +++ b/components/voice_assistant.rst @@ -97,6 +97,8 @@ Listens for one voice command then stops. Configuration variables: - **silence_detection** (*Optional*, boolean): Enable silence detection. Defaults to ``true``. +- **wake_word** (*Optional*, string): The wake word that was used to trigger the voice assistant + when using on-device wake word such as :doc:`/components/micro_wake_word`. Call ``voice_assistant.stop`` to signal the end of the voice command if ``silence_detection`` is set to ``false``.