Voice Assistant¶
ESPHome devices with a microphone are able to stream the audio to Home Assistant and be processed there by assist.
Note
Voice Assistant requires Home Assistant 2023.5 or later.
Configuration:¶
microphone:
- platform: ...
id: mic_id
voice_assistant:
microphone: mic_id
microphone (Required, ID): The microphone to use for input.
speaker (Optional, ID): The speaker to use to output the response.
on_start (Optional, Automation): An automation to perform when the voice assistant starts listening.
on_end (Optional, Automation): An automation to perform when the voice assistant is finished all tasks.
on_stt_end (Optional, Automation): An automation to perform when the voice assistant has finished speech-to-text. The resulting text is available to automations as the variable
x
.on_tts_start (Optional, Automation): An automation to perform when the voice assistant has started text-to-speech. The text to be spoken is available to automations as the variable
x
.on_tts_end (Optional, Automation): An automation to perform when the voice assistant has finished text-to-speech. A URL containing the audio response is available to automations as the variable
x
.on_error (Optional, Automation): An automation to perform when the voice assistant has encountered an error. The error code and message are available to automations as the variables
code
andmessage
.
Voice Assistant Actions¶
The following actions are available for use in automations:
voice_assistant.start
- Start listening for voice commands.voice_assistant.stop
- Stop listening for voice commands.
Push to Talk¶
Here is an example offering Push to Talk with a Binary Sensor Component.
voice_assistant:
microphone: mic_id
binary_sensor:
- platform: gpio
pin: ...
on_press:
- voice_assistant.start:
on_release:
- voice_assistant.stop: