Repository navigation
Pass wake word audio from ESPHome satellites to Assist pipelines - #189485
Conversation
Devices that support it can send the audio they buffered before a wake word detected on the device, ahead of the live audio. The satellite keeps that audio for each channel apart from the live audio. Once it has arrived, the satellite accepts the wake word (WAKE_WORD_END) and runs the pipeline from STT, or rejects it (WAKE_WORD_REJECTED). When to request wake word audio is not decided yet, so it stays off. Verification is a placeholder that accepts every detection. Requires an aioesphomeapi release with wake word audio support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Instead of holding the audio from before the wake word in the ESPHome satellite, stream it to the pipeline with the rest of the audio. The satellite passes the wake word the device detected as a DetectionResult, whose timestamp is the length of that audio in ms on the channel being sent. The channel is chosen from the pipeline's speech-to-text preferences when the run starts, since this audio arrives before STT_START. The pipeline removes that audio before speech-to-text and accepts the wake word with WAKE_WORD_END, or rejects it with the new WAKE_WORD_REJECTED event if another satellite just woke up with it. The satellite forwards the rejection to the device and ends the audio stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hey there, mind taking a look at this pull request as it has been labeled with integrations you are listed as a code owner for? Thanks!
Code owner commandsReply with
|
|
Hey there @home-assistant/core, @arturpragacz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Hey there @jesserockz, @kbx81, @bdraco, @arturpragacz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
🟡 Changes recommended
The rejection path bypasses cleanup, leaving a prepared TTS ResultStream registered until cache expiry; it needs cleanup and a rejection test with end_stage=TTS.
1 open issue
What changed in this PR
Adds plumbing to pass ESPHome satellite wake-word audio into Assist pipelines, preparing for future wake-word verification. Detection is currently accepted unless it is a duplicate wake-up; requesting this audio remains disabled by default.
Changes:
- Passes satellite wake-word detection metadata through the pipeline APIs.
- Adds rejection events and removes accepted wake-word audio before speech-to-text.
- Adds ESPHome channel selection, rejection handling, and tests.
| File | Description |
|---|---|
tests/components/esphome/test_assist_satellite.py |
Tests audio subscriptions, channel selection, and rejection handling. |
tests/components/esphome/conftest.py |
Records wake-word audio subscription requests in mocks. |
tests/components/assist_pipeline/test_wake_word_audio.py |
Tests audio trimming and duplicate detection rejection. |
homeassistant/components/esphome/assist_satellite.py |
Maps device detections, selects audio channels, and handles rejection. |
homeassistant/components/assist_satellite/entity.py |
Forwards detection metadata to pipelines. |
homeassistant/components/assist_pipeline/run.py |
Carries detection metadata in pipeline inputs and requests. |
homeassistant/components/assist_pipeline/models.py |
Defines the wake-word rejection event. |
homeassistant/components/assist_pipeline/default_pipeline.py |
Accepts or rejects detections and trims wake-word audio. |
homeassistant/components/assist_pipeline/__init__.py |
Exposes detection metadata in the audio-stream API. |
Review effort: Balanced
A rejected wake word ends the run without an error, so the text-to-speech stream prepared for it was left registered until the cache expired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The declared aioesphomeapi dependency prevents module loading, and acceptance checks can reprocess already accepted wake words, incorrectly rejecting them and skipping transcription.
2 open issues
1 resolved since last review
Review effort: Balanced
Verification can now reject a wake word, so the device gets VOICE_ASSISTANT_WAKE_WORD_REJECTED and runs on_wake_word_rejected instead of only seeing the run end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit eb9638b)
…text Audio, wake word audio included, arrives before STT_START, so a run that starts at speech-to-text picks its channel when it starts and keeps it. The pick asks the engine per request, as the pipeline does: cloud's preference depends on the language and its property says otherwise, so STT_START could switch channels mid-stream. After a wake word stage, STT_START still picks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit ac0c127)
|
👋 Hi! Thanks for contributing to Home Assistant. This is your PR dashboard which flags anything you need to address before your PR can be reviewed. Once everything is green, you can press the 'Ready for review' button at the bottom of the page to notify reviewers to take a look. More information about this dashboardThis dashboard automatically updates on every change to this PR and reevaluates the rules as you go. Until everything has been addressed, the bot will keep the PR in draft. Skip a check that doesn't applyIf you think a check doesn't apply to your PR (or the rule is bugged), comment Bot commandsReply with
Checks👀 Waiting on others before this PR can be merged:
5 checks passed (5 skipped)
|
There was a problem hiding this comment.
🟡 Changes recommended
ID-only wake words are not resolved to their configured pipeline, so a secondary assistant’s wake-word ID can select the wrong assistant and potentially the wrong audio channel.
5 open issues
Resolve ID-only wake words to the configured pipeline · New Upgrade aioesphomeapi before merging feature Select the detected model's pipeline when the wake phrase is missing Select the initial audio channel using resolved STT metadata Align the PR description with the implemented wake-up error behavior
Review effort: Balanced
…m-20261110-wake-word-audio-wanted The ESPHome changes now live in #189485 on top of dev. Turning the preview feature off also tells satellites the wake words changed, next to dev's removal of the app's entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wake word selects hold phrases, so a device that sent only the model ID always got the first assistant and its speech-to-text preferences for the audio channel. Look up the phrase first. The STT language for the channel choice also falls back to the configured language, as the pipeline's does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Generated by quality-scale-reviewer · copilot · auto · 146.9 AIC · ⌖ 5.66 AIC · ⊞ 8.4K
| ) | ||
| is None | ||
| ): | ||
| return False |
There was a problem hiding this comment.
test-coverage (done) The new _stt_prefers_unprocessed_audio helper has two branches with no covering test: the PipelineNotFound path (line 665) and the pipeline.stt_engine is None / unknown-engine path (lines 668-676).
Evidence and fix
- Evidence:
homeassistant/components/esphome/assist_satellite.py:663-676. Both added tests (test_multichannel_audio_picked_at_start,test_wake_word_audio) patchasync_get_pipelineto always return aMockwithstt_engine="stt.test"(never raisingPipelineNotFound, neverNone), so these lines are never exercised. - Recommendation: add test cases where
async_get_pipelineraisesPipelineNotFoundand wherepipeline.stt_engineisNone(orstt.async_get_speech_to_text_enginereturnsNone), asserting_stt_prefers_unprocessed_audio()returnsFalseand channel 0 is kept. - Rule: (contributors.homeassistant.io/redacted)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Breaking change
Proposed change
ESPHome satellites can now stream the audio from before a microWakeWord detection (esphome/esphome#21885, esphome/aioesphomeapi#1980). The Assist pipeline takes that audio as
wake_word_audio_ms(#190436) and, with the Voice app, verifies the wake word (#192364). This PR connects ESPHome satellites to it.assist_satellite:async_accept_pipeline_from_satellitepasseswake_word_audio_msthrough to the pipeline.wake_word_audio_ms, from the buffered byte count of the channel being streamed. The channels are offset independently. When the device sends no phrase, its model ID is looked up in the device's wake words to get the phrase, which also picks the assistant; an unknown ID is passed on as is.wake_word-rejectedevent toVOICE_ASSISTANT_WAKE_WORD_REJECTED, so the device goes back to idle when the wake word is rejected instead of only getting the run end.STT_START. The channel comes from the STT engine'sasync_get_audio_processingfor the pipeline's language, which is what the pipeline asks atSTT_START, so cloud STT doesn't switch channels partway through. Runs with a wake word stage still pick atSTT_START._request_wake_word_audio, which isFalsehere. Ask for wake word audio only when something will verify it #191921 replaces it with asking only when something will verify the wake word.Tested end to end on a Voice PE with the Voice app and #191921: real wake words were accepted, near misses were rejected and the device went back to idle, and speech-to-text got the audio from the end of the wake word on. Firmware: esphome/home-assistant-voice-pe#653.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests:
🤖 Generated with Claude Code