Skip to content

Pass wake word audio from ESPHome satellites to Assist pipelines - #189485

Merged
balloob merged 24 commits into
devfrom
synesthesiam-20261028-wake-word-audio
Nov 14, 2026
Merged

balloob merged 24 commits into
devfrom
synesthesiam-20261028-wake-word-audio

Conversation

@synesthesiam

@synesthesiam synesthesiam commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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_satellite passes wake_word_audio_ms through to the pipeline.
  • ESPHome satellite:
    • Passes the start request's wake word audio as 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.
    • Maps the pipeline's wake_word-rejected event to VOICE_ASSISTANT_WAKE_WORD_REJECTED, so the device goes back to idle when the wake word is rejected instead of only getting the run end.
    • Runs that start at speech-to-text pick their audio channel once, at the start, because the wake word audio arrives before STT_START. The channel comes from the STT engine's async_get_audio_processing for the pipeline's language, which is what the pipeline asks at STT_START, so cloud STT doesn't switch channels partway through. Runs with a wake word stage still pick at STT_START.
    • Requesting wake word audio from devices is behind _request_wake_word_audio, which is False here. 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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

🤖 Generated with Claude Code

synesthesiam and others added 2 commits October 28, 2026 15:09
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>
@home-assistant

home-assistant Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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 commands

Reply with @home-assistant <command>:

  • update — Re-runs the bot's checks on the issue or pull request.
  • ignore — Waives a dashboard check: ignore "<check name>" "<reason>". (author) — e.g. @home-assistant ignore "Merge conflicts" "Broken rule, no merge conflicts present"
  • unignore — Restores a waived dashboard check: unignore "<check name>". (author) — e.g. @home-assistant unignore "Merge conflicts"
  • unassign — Removes the given integration domain's label and its code owners from the assignees. (author or code owners) — e.g. @home-assistant unassign "opensky"
  • close — Closes the issue or pull request. (code owners)
  • reopen — Reopens the issue or pull request. (code owners)
  • rename — Renames the issue or pull request: rename "<new title>". (code owners) — e.g. @home-assistant rename "A more descriptive title"
  • add-label — Adds a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the issue or pull request. (code owners) — e.g. @home-assistant add-label "needs-more-information"
  • remove-label — Removes a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) from the issue or pull request. (code owners) — e.g. @home-assistant remove-label "needs-more-information"
  • mark-draft — Marks the pull request as draft. (code owners)
  • update-branch — Updates the pull request branch with the base branch. (code owners)

@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @home-assistant/core, @arturpragacz, mind taking a look at this pull request as it has been labeled with an integration (assist_satellite) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of assist_satellite can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign assist_satellite Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @jesserockz, @kbx81, @bdraco, @arturpragacz, mind taking a look at this pull request as it has been labeled with an integration (esphome) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of esphome can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign esphome Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

synesthesiam and others added 2 commits November 13, 2026 14:39
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)
Copilot AI balanced review requested due to automatic review settings November 13, 2026 20:40
@home-assistant

home-assistant Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

👋 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 dashboard

This 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 apply

If you think a check doesn't apply to your PR (or the rule is bugged), comment @home-assistant ignore "<check name>" "<reason>". The check name as shown in the table above. This will mark the check as ignored and let you put your PR in 'Ready for review'; @home-assistant unignore "<check name>" restores the rule.

Bot commands

Reply with @home-assistant <command>. Several commands can be stacked, one per line:

  • update — Re-runs the bot's checks on the issue or pull request.
  • ignore — Waives a dashboard check: ignore "<check name>" "<reason>". (author) — e.g. @home-assistant ignore "Merge conflicts" "Broken rule, no merge conflicts present"
  • unignore — Restores a waived dashboard check: unignore "<check name>". (author) — e.g. @home-assistant unignore "Merge conflicts"
  • unassign — Removes the given integration domain's label and its code owners from the assignees. (author or code owners) — e.g. @home-assistant unassign "opensky"
  • close — Closes the issue or pull request. (code owners)
  • reopen — Reopens the issue or pull request. (code owners)
  • rename — Renames the issue or pull request: rename "<new title>". (code owners) — e.g. @home-assistant rename "A more descriptive title"
  • add-label — Adds a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the issue or pull request. (code owners) — e.g. @home-assistant add-label "needs-more-information"
  • remove-label — Removes a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) from the issue or pull request. (code owners) — e.g. @home-assistant remove-label "needs-more-information"
  • mark-draft — Marks the pull request as draft. (code owners)
  • update-branch — Updates the pull request branch with the base branch. (code owners)

Checks

👀 Waiting on others before this PR can be merged:

Status Check Details
👀 Code owner approval Waiting for ESPHome code owner approval.
5 checks passed (5 skipped)
Status Check Details
✅ Forbidden files No forbidden files.
✅ Merge conflicts No merge conflicts.
✅ Merge target This PR targets dev.
✅ Type of change Type of change: new-feature
✅ CLA Everyone involved has signed the CLA.
➖ New integration validation Not a new-integration PR.
➖ Single new platform No new platforms added.
➖ Documentation Not a new integration or platform — no documentation PR required.
➖ Belongs together No pull requests listed.
➖ Blocking: awaiting-frontend awaiting-frontend label not set — nothing to block.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Review effort: Balanced

@synesthesiam
synesthesiam marked this pull request as ready for review November 13, 2026 20:47
synesthesiam added a commit that referenced this pull request Nov 13, 2026
…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>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:01

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated by quality-scale-reviewer · copilot · auto · 146.9 AIC · ⌖ 5.66 AIC · ⊞ 8.4K

)
is None
):
return False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) patch async_get_pipeline to always return a Mock with stt_engine="stt.test" (never raising PipelineNotFound, never None), so these lines are never exercised.
  • Recommendation: add test cases where async_get_pipeline raises PipelineNotFound and where pipeline.stt_engine is None (or stt.async_get_speech_to_text_engine returns None), asserting _stt_prefers_unprocessed_audio() returns False and channel 0 is kept.
  • Rule: (contributors.homeassistant.io/redacted)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 14, 2026 00:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The entity-platform interface change needs human assessment to confirm that the required architecture approval is in place.

2 open issues

Review effort: Balanced

@balloob
balloob merged commit bedb495 into dev Nov 14, 2026
54 of 55 checks passed
@balloob
balloob deleted the synesthesiam-20261028-wake-word-audio branch November 14, 2026 03:33
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants