voice_assistant: option for a maximum listening time (and a graceful end of the recording) #3943
Unanswered
Nasdero
asked this question in
Component enhancements
Replies: 1 comment
|
🏷️ I've automatically added the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Component name
voice_assistant
Link to component documentation on our website
https://esphome.io/components/voice_assistant/
Describe the enhancement
This discussion was drafted by Claude (an AI assistant) on behalf of Nasdero, based on measurements from his own setup. He reviewed it before it was posted.
How it works today: After the wake word, the device streams audio to Home Assistant until Home Assistant decides the speech has ended (silence detection; the device only sets
VOICE_ASSISTANT_REQUEST_USE_VAD). There is no option invoice_assistant:(or in the Home Assistant Voice PE package) to limit how long the device keeps listening.Problem: With constant background audio (radio/TV) the silence never comes. Recordings of 57 s were observed; the STT then transcribes the radio and the conversation agent can execute phantom commands.
What I'd like: a built-in option, for example
max_listening_time: 6sforvoice_assistant:(and ideally a number entity in the Voice PE package, so it can be changed from Home Assistant), and a defined behaviour when it triggers - ideally a graceful end of the audio stream, so that what has been recorded so far is still transcribed and processed.Use cases
Voice PE (ESPHome 2026.10.2, stock
home-assistant-voice.yamlpackage, Home Assistant 2026.10, local faster-whisper) in a living room with a radio/TV that is on most of the day. A hard limit of 5-7 s fits typical commands (ours take 2-4 s) and prevents long garbage recordings and wrong commands. Others run into the same: several threads on the Home Assistant forum report that the satellite "keeps listening" with background noise.Anything else?
Workaround that works for us (template number + a script started in
on_listeningthat callsvoice_assistant.stopafter N seconds, stopped again on normal end):Observation / question about
voice_assistant.stop: when it is called while the microphone is streaming, the pipeline run ends withoutstt-end(pipeline debug events:stt-start08:52:29.8 ->run-end08:52:34.9, nostt-end, no intent), although the STT service received the 5.05 s of audio and returned a text. The text is discarded and nothing is executed. For our use that is acceptable (it prevents phantom commands), but is this intended? Is there a way to end the audio stream gracefully so that the recording so far is still processed?Related: the same problem is discussed on the Home Assistant forum ("Help your Assist Voice Satellite handle background noise"), where a similar timer in YAML is used as a workaround.
All reactions