esphome-satellite is an on-device state supervisor for ESPHome and Home Assistant voice satellites, built with nim-esphome and nim-typestates. It provides production firmware and dedicated hardware drivers for the Seeed Studio ReSpeaker Lite XVF3800, alongside a modular, hardware-agnostic core architecture designed for porting across ESP32 and ESP32-S3 voice satellite hardware.
Standard ESPHome voice setups rely on loose asynchronous network events and C++ callbacks that frequently fall out of sync—causing wake chimes to clip microphones, ambient TV noise to trigger false "stop" commands while idle, volume ducking to get orphaned, or satellites to freeze when the server drops connection.
esphome-satellite moves state coordination directly onto the ESP32 microcontroller, enforcing strict rules so your audio hardware and the Home Assistant server always stay in lockstep:
- Self-Hearing Protection: Discards microphone input until the wake chime has completely finished, eliminating false silence errors caused by the speaker clipping the mic.
- Context-Aware Wake Words: Stop words are strictly ignored when the device is idle, eliminating phantom cancellations from background TV or conversation.
- Fail-Safe Media & State Recovery: If Home Assistant drops connection or a pipeline errors mid-stream, media automatically un-ducks and the device safely resets to idle instead of freezing.
- Compile-Time Verified: Every valid state transition is proven at compile time—dead ends, impossible states, and race conditions are caught before firmware is ever flashed.
- Drop-In Integration: Integrates with standard ESPHome voice assistant pipelines and hardware.
Connect your ESP32 device via USB and flash pre-compiled firmware directly from Chrome or Edge:
If you build firmware with ESPHome CLI or the ESPHome Dashboard, add the remote package to your device configuration:
packages:
satellite: github://axiomantic/esphome-satellite/packages/respeaker_xvf3800.yamlFollow these steps right after flashing to connect the satellite to your network and Home Assistant:
Important
ESP32-S3 Native USB Bootloader Quirk: Devices using the ESP32-S3 native USB-Serial-JTAG controller (such as the Seeed ReSpeaker Lite XVF3800) remain halted in the ROM Bootloader after flashing or erasing via WebSerial. Because native USB lacks hardware RTS/DTR auto-reset circuits, the browser cannot trigger a cold boot.
You must physically unplug and reconnect the USB-C cable (or tap the RST button on the board) right after flashing!
If you attempt to configure Wi-Fi before power-cycling, the installer will report An error occurred. Improv Wi-Fi Serial not detected because the firmware has not booted yet.
Once the board has rebooted into ESPHome, connect using either method:
- Method A: USB Serial (Improv Wi-Fi): On the Web Installer page, click the Configure Wi-Fi button. The browser will discover the device via Improv Serial and prompt you to select your Wi-Fi network and enter your password.
- Method B: Fallback Wi-Fi Hotspot:
On your phone or laptop, open your Wi-Fi settings and connect to the temporary open access point named
Satellite Fallback Hotspot. The captive portal will open automatically athttp://192.168.4.1where you can enter your Wi-Fi credentials.
- In Home Assistant, open Settings > Devices & Services.
- Your satellite will automatically appear highlighted at the top under Discovered as Voice Satellite (e.g.,
Voice Satellite a1b2c3orVoice Satellite d4e5f6). - Click Configure, then click Submit.
- Assign the device to an area.
Tip
No Encryption Key Required & Troubleshooting "Encryption Key" Prompt:
- Zero Encryption Key:
esphome-satelliteconnects via standard ESPHome API without requiring an encryption key (noise_psk: ""). - Why Home Assistant might ask for an "Encryption key":
Brand-new Seeed ReSpeaker boards ship with Seeed's proprietary encrypted ESPHome firmware pre-installed. If Home Assistant discovered the board before it was erased and flashed, Home Assistant created an in-memory discovery session marked with
noise_required: true. In Home Assistant's schema, this makes the Encryption Key field mandatory—submitting a blank field is rejected with "not all required fields are filled in". - How to Solve in 10 Seconds (Direct Manual Add):
- Cancel or close the prompt.
- In Home Assistant, go to Settings > Devices & Services > Add Integration > ESPHome.
- In Host, enter the device IP (or
esphome-satellite-<mac>.local) and port6053. - Click Submit—Home Assistant connects immediately with zero prompts for an encryption key!
- Clear Stale Discovery Cache: Alternatively, click Ignore on the discovered card and restart Home Assistant Core (Developer Tools > YAML > Restart) to flush the cached discovery session.
- Clean Factory Erase: When flashing a brand-new board from Seeed for the first time, always select "Erase device" in the Web Installer so all factory NVS encryption tokens and partitions are completely wiped.
- In Home Assistant, navigate to Settings > Voice Assistants.
- Create or verify your voice assistant pipelines (for example, a general smart home pipeline, a local Ollama LLM persona like Mark Twain, or a specialized assistant like Jarvis).
- Navigate to Settings > Devices & Services > ESPHome and click on your satellite device:
- Assistant (Slot 1): Select your primary pipeline (e.g., Mark Twain).
- Wake word (Slot 1): Select which wake word triggers Slot 1 (e.g., Mr. Clemens).
- Assistant 2 (Slot 2): Select your secondary pipeline (e.g., Home Assistant or Jarvis).
- Wake word 2 (Slot 2): Select which wake word triggers Slot 2 (e.g., Bumblebee, Hey Gizmo, Hey Chief, Oh Captain, OK Computer, Little Wizard, or your uploaded custom model).
- On the device card, customize your audio feedback across 17 pre-compiled acoustic themes:
- Wake Chime: Bell Ping, Modern Chime, Crystal Glass, Warm Kalimba, Meditation Bell, Marimba, Subtle Beep, Bamboo Chime, Tibetan Bowl, Acoustic Harp, Woodblock, Ceramic Bell, Neon Shimmer, Prism Ping, Cyber Bloom, Quantum Beep, Aero Chime, or Silent.
- Processing Sound: Spinner, Pulse, Sonar, Tick, Typewriter, Clockwork (seamless zero-gap loop), Water Droplets, Raindrops, Forest Stream, Campfire Ember, Shishi-Odoshi, Soft Footsteps, Radar Ping, Data Crunch, Telemetry Blip, Quantum Flux, Retro Terminal, or Silent.
- Cancel Sound: Match Wake Chime, any of the 17 themed cancel resolves, or Silent.
- Wake Word Sensitivity: Slightly sensitive, Moderately sensitive, or Very sensitive.
Manual / Source Builds: See the full Integration Guide for ESPHome below for custom YAML overrides, external component configuration, and C ABI bridge bindings.
- Quick Install
- Post-Installation Setup
- Multi-Wake-Word to Multi-Assistant Pipeline Mapping
- Acoustic Tuning & Female Voice Equalization
- Real-Time Audio DSP & Speech Optimization
- Discrete Partition Flashing & NVS State Preservation
- The Voice Satellite Race Condition Problem
- How Compile-Time Typestates Solve It
- State Machine Architecture
- Granular Error Handling
- Extended Lifecycle States
- Audio Feedback, Processing Loops & Cancel Sounds
- In-Browser Audio Transcoding & WebSerial Diagnostics
- Synthetic Wake Word Corpus Generator & Trainer
- Home Assistant Surface Controls & Entities
- Integration Guide for ESPHome
- Supported Hardware
- Local Host Testing
- Project Layout
- Changelog
In modern Home Assistant voice environments, a single satellite device often needs to address multiple distinct personas, languages, or language models. For instance:
- "Mr. Clemens" can invoke a specialized, literary Mark Twain Ollama LLM persona.
- "OK Computer" or "Bumblebee" can invoke the fast local Home Assistant pipeline for home automation commands.
- "Hey Gizmo", "Hey Chief", "Oh Captain", or "Little Wizard" can invoke specialized cloud conversational or smart-home agents.
esphome-satellite harnesses the ESP32-S3 vector instructions and hardware neural network accelerator to evaluate up to 3 wake word models concurrently in real time.
- Model Advertisement: When the satellite connects to Home Assistant over the encrypted Native API, the firmware exposes all available on-device models (Mr. Clemens, Bumblebee, Hey Gizmo, Hey Chief, Oh Captain, OK Computer, Little Wizard, plus any custom models loaded from dedicated flash partitions).
- Dual-Assistant Configuration: In the Home Assistant device panel, Home Assistant maps these models into dual-assistant slots:
- Assistant (Slot 1): Maps your primary pipeline (e.g. Mark Twain) to its trigger wake word (e.g. Mr. Clemens).
- Assistant 2 (Slot 2): Maps your secondary pipeline (e.g. Home Assistant or Jarvis) to its trigger wake word (e.g. Bumblebee or OK Computer).
- Zero-Latency Routing: When speech is detected, the on-device microWakeWord engine identifies which specific wake word was matched and transmits the recognized phrase (
wake_word_phrase) directly inside theVoiceAssistantRequestpacket. - Deterministic Server Dispatch: Home Assistant inspects the incoming phrase and automatically dispatches the audio stream to the exact pipeline bound to that wake word slot. No complex automations, blueprint scripts, or server-side audio rerouting required.
Each assistant slot operates as a fully independent profile with its own acoustic identity:
- Dedicated Volume Levels: Set independent volume controls for Slot 1 (
Slot 1: Volume) and Slot 2 (Slot 2: Volume), enabling quiet, unobtrusive volume for administrative commands while preserving full fidelity for literary or conversational assistants. - Independent Acoustic Themes: Select distinct Wake Chimes, Processing Loops, and Cancel Sounds per slot. For instance, Slot 1 can play a warm acoustic kalimba chime with a vintage typewriter processing loop, while Slot 2 plays a crisp digital bell ping with a subtle spinner loop.
- Per-Slot Wake Word Selectors: Home Assistant device configuration panels restrict wake word selection to a single active wake word per device.
esphome-satellitebypasses this limitation with native on-device template selectors (Slot 1: Wake WordandSlot 2: Wake Word), allowing you to assign any built-in or custom partition model to either slot independently. - Slot 2 Disable Option: Setting Slot 2's wake word to
Disabledsafely reverts the satellite to dedicated single-assistant mode with zero overhead.
Voice interactions often span multi-turn dialogue where context should persist across pauses:
- Extended Conversation Memory (300 Seconds):
conversation_timeoutis set to300s(5 minutes), perfectly aligning with Home Assistant Core'schat_session.pygarbage collection window. You can issue a command, pause for several minutes, trigger the wake word again, and ask contextual follow-up questions (such as "repeat what you just did and undo it"). - Slot-Level Context Isolation: To prevent personas from bleeding context into each other, the satellite tracks the active assistant slot. When a wake word activates a different slot than the preceding turn, the satellite immediately invokes
id(va).reset_conversation_id(). This forces Home Assistant to spin up a clean conversation context for the new assistant. - Spoken Conversation Reset: Saying "forget our conversation", "clear history", "reset conversation", "new conversation", or "forget everything" is intercepted directly in
on_stt_end. The satellite wipes the Home Assistant conversation ID, dismisses the turn, and plays the cancel sound as an audible confirmation cue without sending unnecessary LLM prompts. - Manual Reset Button: The dashboard exposes
Voice: Reset Conversation Historyfor one-tap memory clearing.
Using src/wake_partition_loader.nim, users can flash up to 3 custom microWakeWord .tflite models into dedicated flash partitions (wake_model, wake_model_2, wake_model_3 at 0x510000, 0x550000, 0x590000). At boot time, the partition loader validates 64-byte WAKE headers, extracts tensor arena sizes and probability cutoffs, memory-maps the weights directly from SPI flash (avoiding heap allocation), and dynamically registers them into the active detection pool.
In far-field acoustic environments, television dialogue, background chatter, or momentary acoustic spikes can cause false wake events. Traditional voice systems attempt rigid on-device string matching against the Speech-to-Text (STT) transcript. However, rigid string matching frequently drops valid voice commands because:
- Whisper STT phonetic drift: Fast speech or accents cause Whisper to transcribe phonetically rather than orthographically (e.g., "Mr. Clemens" commonly transcribes as "Mr. Clement", "Mister Clements", "Mr. Clemence", or "Mister Clemens").
- Buffer boundary jitter: The audio buffer may capture leading breath, conversational fillers like "uh" or "well", or clip the very first phoneme.
To achieve effortless acoustic wake-up with zero false triggers, esphome-satellite implements a two-tier gatekeeper architecture:
sequenceDiagram
autonumber
actor Speaker as Household Speaker
participant Sat as ESPHome Satellite
participant HA as Home Assistant Core (Assist Pipeline)
participant Gate as Gatekeeper (custom_components/esphome_satellite)
participant Sys1 as System 1 Server (/v1/systemone)
participant Down as Downstream Agent (LLM / Assist)
Speaker->>Sat: Ambient speech (e.g. TV dialogue mentioning Clemens)
Note over Sat: microWakeWord edge trigger<br/>Satellite stays dark & silent (v0.7.0)
Sat->>HA: Start Pipeline (Audio Stream + 2.0s Pre-roll)
HA->>HA: Whisper STT transcribes utterance
HA->>Gate: async_process(user_input)
Note over Gate: Resolves satellite slot & wake phrase<br/>Queries System 1 classifier
Gate->>Sys1: POST /v1/systemone
Sys1-->>Gate: {"ambient_conversation": 0.88, "addressed": 0.12}
Note over Gate: 0.88 >= threshold (0.60)<br/>Decision: AMBIENT CONVERSATION
Gate-->>HA: ConversationResult(response.speech="")
Note over HA: pipeline.py line 1803:<br/>if not speech: skip TTS
HA->>Sat: on_end (no TTS stream)
Note over Sat: Satellite returns to Idle<br/>Zero chimes, zero LEDs, zero tokens burned
esphome-satellite eliminates clipped audio by maintaining a continuous 2.0-second circular audio buffer in PSRAM while idle. When an on-device microWakeWord model triggers:
- The firmware automatically prepends the 2.0 seconds of pre-roll audio containing the spoken wake word into the stream sent to Home Assistant's STT engine.
- Whisper receives and transcribes both the wake word phrase and the subsequent user command in full.
In firmware v0.7.0, hardware cues adhere strictly to Rule 5 (Deterministic Hardware / LED Binding):
- Pre-Verification Silence & Darkness: During
ListeningandVerifying, the satellite emits zero sound and zero light. False edge triggers from TV chatter or room conversation never blink LEDs or ring wake chimes. - Physical Verification Acknowledgment: When Gatekeeper verifies that speech was addressed to the satellite, it invokes the native
esphome.<device>_wake_word_verifiedaction. The satellite transitions fromVerifying -> Thinking, rings the wake chime (if enabled), starts the typewriter processing sound, and animates the Thinking LED spinner.
The canonical companion integration is maintained directly in custom_components/esphome_satellite. It provides the sub-200ms System 1 neural addressing gatekeeper and speculative streaming STT proxy.
- In Home Assistant, open HACS > Integrations.
- Click the three dots menu in the top right corner and select Custom repositories.
- Enter the repository URL:
Set Category to Integration, then click Add.
https://github.com/axiomantic/esphome-satellite - Search for ESPHome Satellite Gatekeeper in HACS, click Download, and confirm.
- Restart Home Assistant Core via Developer Tools > YAML > Restart (or
ha core restart).
- Copy the
custom_components/esphome_satellitedirectory into your Home Assistant/config/custom_components/directory:cp -r custom_components/esphome_satellite /config/custom_components/
- Restart Home Assistant Core via Developer Tools > YAML > Restart.
- Add Integration:
- Navigate to Settings > Devices & Services > Add Integration.
- Search for ESPHome Satellite Gatekeeper.
- Enter your System 1 endpoint URL (e.g.
http://laya.lan/v1/systemoneorhttp://10.0.0.10:8000/v1/systemone), optional Bearer Token, and select your downstream Conversation Agent.
- Wire Assist Pipeline:
- Navigate to Settings > Voice Assistants.
- Select your desired voice assistant pipeline (e.g. Mark Twain or Assist).
- Set Conversation Agent to ESPHome Satellite Gatekeeper.
- (Optional) Set Speech-to-Text to Speculative STT Proxy to enable sub-500ms early wake word acknowledgment over streaming audio.
- Runtime Tuning via Options Flow:
- In Settings > Devices & Services, click Configure on the ESPHome Satellite Gatekeeper card.
- Adjust per-slot sensitivity thresholds (calibrated default:
0.50), toggle slot gating, configure custom wake word patterns, or select fallback behavior (dropfail-closed orallowfail-open). All wake words are dynamically resolved from the satellite entity attributes with zero hardcoded constraints.
For standalone installations without a local System 1 / Laya classifier, you can bypass the custom component and delegate addressing verification directly to your downstream LLM conversation agent by appending this standard 38-Word Prompt Rider to the system prompt in Settings > Voice Assistants > Assist > Conversation Agent:
WAKE VERIFICATION: Input includes 2s pre-roll audio. The opening words must roughly match or phonetically approximate "<WAKE_PHRASE>" (speech-to-text often mishears spoken names, e.g. "clement", filler like "uh", or mid-phrase clips). If matched, strip it and respond; otherwise (e.g. TV dialogue, bystander talk, unaddressed commands with no wake word), you must execute no tools and output strictly nothing (0 characters).
(Replace <WAKE_PHRASE> with your slot's trigger phrase, e.g., Mr. Clemens, OK Computer, or Hey Jarvis.)
When an accidental trigger or background conversation reaches the pipeline under the prompt rider, the LLM outputs strictly 0 characters ("") with zero tool calls. Home Assistant recognizes the empty response, suppresses TTS, and returns the satellite cleanly to rsIdle.
Far-field microWakeWord neural networks frequently exhibit acoustic bias toward male voices. Female speech generally exhibits:
- Higher fundamental frequencies (
$F_0 \approx 200-260 \text{ Hz}$ vs.$100-140 \text{ Hz}$ for adult males). - Shorter vowel durations and faster formant transitions across consonants.
- Lower acoustic energy in the lower register where small voice satellite microphones have the highest SNR.
esphome-satellite provides three runtime acoustic equalization controls to eliminate gender bias and maximize detection reliability across all household members:
- Entity:
Voice: Mic Pre-Gain Boost(number.voice_mic_pre_gain_boost) - Range:
0 dBto+12 dB(step1 dB, default3 dB) - Implementation: Written in Nim (
src/audio_dsp.nim), applying 64-bit precision linear gain scaling directly to 32-bit microphone samples in the I2S capture loop before microWakeWord 40-band Mel-frequency spectrogram extraction. - Tuning: A
+3 dBto+6 dBboost brings female vocal energy up to parity with male speech without clipping the XVF3800 beamformed microphone stream.
- Entity:
Voice: Wake Window Size(number.voice_wake_window_size) - Range:
2to5frames (default3frames, where 1 frame = ~100 ms) - Implementation: Dynamically resizes the sliding probability window in the microWakeWord
StreamingModelneural network runtime. - Tuning: Standard wake word engines require 4 to 5 consecutive frames above threshold to trigger. Because female speech often articulates syllables more briskly, a 5-frame window can reject valid wake words during fast cadence. Lowering the window to
2or3frames captures shorter syllable bursts cleanly.
- Entities:
Slot 1: SensitivityandSlot 2: Sensitivity - Options:
Slightly sensitive(1.35x cutoff),Moderately sensitive(1.0x cutoff),Very sensitive(0.70x cutoff),Extreme sensitivity(0.45x cutoff). - Implementation: Scales the neural network's activation threshold cutoff dynamically in SPI flash memory structures. Selecting
Extreme sensitivitydrops the required activation barrier by 55%, enabling effortless far-field triggers across quiet voices, soft accents, or high ambient noise environments.
Small voice satellites typically operate on compact 1W to 2W onboard speakers driven by miniature Class-D amplifiers. These drivers have narrow dynamic ranges and clip aggressively when driven with uncompressed text-to-speech audio.
esphome-satellite implements a real-time, zero-allocation audio DSP pipeline written in Nim (src/audio_dsp.nim) that runs on the ESP32 CPU directly on audio buffers before I2S DMA transmission:
- Threshold:
-14.0 dBFS - Compression Ratio:
3:1 - Envelope Follower: Smooth ballistic tracking with a
5msattack time and a100msrelease time.
Signals above -14 dBFS undergo smooth gain reduction, preventing loud passages and transient voice bursts from overpowering the amplifier or driving the speaker cone into physical distortion.
- Makeup Gain:
+5.0 dB
Speech synthesis often includes subtle whispers, breath sounds, and soft cadence drops. A static +5.0 dB makeup boost raises quiet vocal passages, ensuring clarity and intelligibility across the room even at lower overall volume levels.
A rational transfer limiter clamps any remaining peak overshoots above -1.0 dBFS using a smooth non-linear knee:
limiter(x) = x / (1.0 + |x|)
This guarantees that digital audio values never wrap or hard-clip, providing warm, distortion-free playback even when driving the speaker at maximum volume.
Standard ESPHome web installations flash a single merged firmware.factory.bin starting at flash address 0x0 and extending across ~1.88 MB. Because this contiguous binary covers the Non-Volatile Storage (NVS) address space (0x9000 to 0xE000) with blank 0xFF padding bytes, flashing a firmware update traditionally wiped all saved device state—forcing users to re-enter Wi-Fi credentials, re-select wake words, and reconfigure volume levels after every release.
esphome-satellite implements discrete partition flashing:
| Binary Component | Flash Offset | Size | Purpose |
|---|---|---|---|
bootloader.bin |
0x00000 (0) |
~21 KB | ESP-IDF 2nd-stage bootloader |
partitions.bin |
0x08000 (32768) |
3 KB | Partition table layout |
| NVS Storage | 0x09000 - 0x0E000 |
20 KB | Untouched / Preserved (Wi-Fi, volumes, preferences) |
ota_data_initial.bin |
0x0E000 (57344) |
8 KB | OTA boot selection metadata |
firmware-ota.bin |
0x10000 (65536) |
~1.82 MB | Core firmware application (app0 slot) |
When updating an existing satellite via the Web Installer, leaving "Erase device" unchecked preserves all stored Wi-Fi credentials, volume preferences, wake word assignments, and sound theme selections across flashes.
In conventional ESPHome voice satellites, state is distributed across asynchronous Home Assistant server events, network callbacks, and C++ lambdas. Under real-world acoustic and network conditions, this causes severe UX bugs:
- Stop Word Clobbering: Ambient noise or TV audio false-triggers the
Stopwake word when the satellite is already idle, causing confusing audio stops and state corruption. - Premature Chime & VAD Clipping: If the microphone opens while the wake chime is still playing, the VAD algorithm hears the satellite's own speaker and immediately triggers
stt-no-text-recognized. - Double Wake / Rapid Re-triggering: A wake word detected while already processing speech can corrupt audio buffers or cause duplicate requests.
- Offline Phantom Triggers: On-device micro wake word models continuing to trigger while the WiFi or Home Assistant API connection is dropped.
- Ducking Clobbering: Music streaming volume is not properly ducked or fails to un-duck when conversations finish or fail.
With nim-typestates, the state of the satellite is encoded directly in the Nim type system:
- Strict Transitions: You cannot call
onSpeechEnded()on anIdleor aThinkingstate. The compiler rejects it with a type mismatch error. - Barge-in Safety: The
Stopwake word is only valid duringListening,Thinking,Replying, or activeAlerting. InIdle,onStopWord()does not exist on the type. - Strict Serialization: Transitioning to
Listeningrequires a completed chime event (onChimeFinished()). The microphone cannot capture audio during playback. - Offline Suppression: When the satellite enters
ConnectionError, wake word transitions are eliminated from the state type. - Privacy Enforcement: When
Muted, wake word detection and microphone capture cannot compile or execute.
stateDiagram-v2
[*] --> Idle
Idle --> Woken: onWakeWord(word, angle)
Idle --> ConnectionError: onDisconnect()
Idle --> Muted: onMute()
Idle --> PlayingMedia: onMediaPlay()
Idle --> Alerting: onAlertStart()
Idle --> Announcing: onAnnouncementStart()
Idle --> Updating: onOtaStart()
state Woken {
[*] --> PlayingChime
}
Woken --> Listening: onChimeFinished()
Woken --> SilentDismiss: onChimeFailed()
Woken --> ConnectionError: onDisconnect()
state Listening {
[*] --> StreamingMic
}
Listening --> Thinking: onSpeechEnded() [VAD speech done]
Listening --> SilentDismiss: onSilenceTimeout() [stt-no-text-rec]
Listening --> PipelineError: onPipelineError(code)
Listening --> ConnectionError: onDisconnect()
Listening --> Idle: onStopWord()
state Thinking {
[*] --> ProcessingIntent
}
Thinking --> Replying: onTtsStarted()
Thinking --> PipelineError: onPipelineError(code)
Thinking --> ConnectionError: onDisconnect()
Thinking --> Idle: onStopWord()
state Replying {
[*] --> PlayingTTS
}
Replying --> Idle: onTtsFinished()
Replying --> FollowUp: onFollowUpRequested()
Replying --> Idle: onStopWord() [Barge-in]
Replying --> PipelineError: onPipelineError(code)
Replying --> ConnectionError: onDisconnect()
state FollowUp {
[*] --> ContinuousDialogue
}
FollowUp --> Listening: onFollowUpReadyToListen()
FollowUp --> Idle: onFollowUpTimeout()
FollowUp --> ConnectionError: onDisconnect()
state PlayingMedia {
[*] --> StreamingAudio
}
PlayingMedia --> Woken: onWakeWord() [Ducks volume]
PlayingMedia --> Idle: onMediaStop()
PlayingMedia --> Alerting: onAlertFromMedia()
PlayingMedia --> Announcing: onAnnouncementFromMedia()
PlayingMedia --> Updating: onOtaFromMedia()
PlayingMedia --> ConnectionError: onDisconnect()
state Alerting {
[*] --> RingingTimerAlarm
}
Alerting --> Idle: onAlertDismiss() [Tap / Stop word]
Alerting --> Woken: onWakeWordDuringAlert()
Alerting --> ConnectionError: onDisconnect()
state Muted {
[*] --> PrivacyHardwareMute
}
Muted --> Idle: onUnmute()
Muted --> ConnectionError: onDisconnect()
Muted --> Updating: onOtaFromMuted()
state Announcing {
[*] --> ServerBroadcast
}
Announcing --> Idle: onAnnouncementEnd()
Announcing --> ConnectionError: onDisconnect()
state Updating {
[*] --> FirmwareFlash
}
Updating --> Idle: onOtaComplete()
state SilentDismiss {
[*] --> SilentReset
}
SilentDismiss --> Idle: onDismiss()
SilentDismiss --> PlayingMedia: onDismissToMedia()
state PipelineError {
[*] --> ErrorToneAndLED
}
PipelineError --> Idle: onResetPipelineError()
PipelineError --> PlayingMedia: onResetPipelineErrorToMedia()
state ConnectionError {
[*] --> OfflineSuppression
}
ConnectionError --> Idle: onConnected() [HA reconnected]
ConnectionError --> Muted: onConnectedMuted()
Conventional voice implementations dump all failures into a generic error handler that plays loud error tones. nim-esphome-satellite partitions errors into three distinct typestates:
| Typestate | Typical Triggers | Satellite Behavior |
|---|---|---|
SilentDismiss |
Silence timeout (stt-no-text-recognized), duplicate wake word. |
Completely silent instant reset. No error buzzer, no blinking red LEDs. Unlocks the audio beam, restores media if ducked, and returns cleanly to Idle. |
PipelineError |
Intent parsing error, TTS streaming network error, STT failure. | Plays the standard error sound, pulses red LEDs, unlocks the microphone beam, restores media if ducked, and resets safely to Idle. |
ConnectionError |
Home Assistant API disconnect, WiFi dropped. | Indicates offline status via LEDs. Wake word triggers are rejected/suppressed until reconnect. |
| State | Hook / Trigger | Behavior & Compile-Time Guarantees |
|---|---|---|
Muted |
call_nim_set_muted(true) |
Privacy lock. Wake word detection and mic capture are statically disallowed on the type. |
FollowUp |
call_nim_follow_up() |
Continuous conversation without requiring wake words between dialogue turns. |
PlayingMedia |
call_nim_media_play() |
Background music / radio streaming. Audio ducks on wake word and auto-restores when dialogue ends. |
Alerting |
call_nim_alert_start() |
Active timer / alarm buzzer. Interrupted via touch tap, stop word, or new command. |
Announcing |
call_nim_announcement_start() |
Unprompted server broadcasts (intercom, doorbell, security announcements). |
Updating |
call_nim_ota_start() |
Firmware flash in progress. All audio tasks and DSP inference are halted to prevent brownouts. |
In your ESPHome device configuration YAML:
external_components:
- source:
type: git
url: https://github.com/axiomantic/nim-esphome
components: [nim]
nim:
source: /path/to/esphome-satellite/src/nim_esphome_satellite.nim
requires:
- https://github.com/elijahr/nim-typestatesInclude nim_satellite_bridge.h in your ESPHome includes: section:
esphome:
name: my-voice-satellite
includes:
- nim_satellite_bridge.hNote: All bridge functions use
__attribute__((weak))and safecall_nim_*wrappers. If the Nim component is ever omitted or disabled, your firmware still compiles cleanly without linker errors.
# Wake Word Detection
micro_wake_word:
on_wake_word_detected:
- lambda: |-
call_nim_wake_word(wake_word.c_str(), 0);
# Voice Assistant Pipeline
voice_assistant:
on_start:
- lambda: |-
call_nim_chime_done(true);
on_stt_vad_end:
- lambda: |-
call_nim_speech_ended();
on_tts_start:
- lambda: |-
call_nim_tts_start();
on_tts_end:
- lambda: |-
call_nim_tts_end();
on_error:
- lambda: |-
call_nim_error(code.c_str());
on_client_connected:
- lambda: |-
call_nim_connected();
on_client_disconnected:
- lambda: |-
call_nim_disconnected();
# Hardware / Software Privacy Mute
switch:
- platform: template
id: mic_mute_switch
name: "Mic Mute"
on_turn_on:
- lambda: |-
call_nim_set_muted(true);
on_turn_off:
- lambda: |-
call_nim_set_muted(false);
# Active Alarm / Timer Ringing
switch:
- platform: template
id: timer_ringing
name: "Timer Ringing"
on_turn_on:
- lambda: |-
call_nim_alert_start();
on_turn_off:
- lambda: |-
call_nim_alert_stop();
# OTA Firmware Updates
ota:
- platform: esphome
on_begin:
- lambda: |-
call_nim_ota_start();esphome-satellite provides ready-to-flash package profiles for supported hardware:
| Profile Package | Target Hardware | Default Audio Feedback | Use Case |
|---|---|---|---|
packages/respeaker_xvf3800_twain.yaml |
Seeed ReSpeaker XVF3800 | Spinner (Active loop enabled) | Continuous audio spinner feedback during cloud STT/LLM inference. |
packages/respeaker_xvf3800_silent.yaml |
Seeed ReSpeaker XVF3800 | Silent (No-op) | Discreet satellite operation with no intermediate processing audio. |
packages/respeaker_xvf3800.yaml |
Seeed ReSpeaker XVF3800 | Base Template | Base configuration component for custom inheritance. |
Import the package directly into your ESPHome configuration:
packages:
satellite:
url: https://github.com/axiomantic/esphome-satellite
ref: main
files: [packages/respeaker_xvf3800_twain.yaml]
refresh: 1dWhen a user finishes speaking, voice assistants often experience variable cloud latencies (1-5 seconds) while Speech-to-Text (STT) and Large Language Models (LLM) synthesize a response. Without feedback, users wonder if their command was received.
esphome-satellite implements a non-blocking, zero-allocation audio processing engine:
- 17 Pre-compiled Acoustic Themes: Includes 17 matching sets of Wake Chimes, Processing Loops, and Cancel Sounds encoded as compact high-fidelity IMA-ADPCM in flash.
- Seamless Zero-Gap Processing Loops: The clockwork, spinner, pulse, and stream loops are mathematically tuned for continuous, seamless looping without rhythm stutter.
- Dedicated Cancel Sounds: Playing when a cancellation word ("stop", "cancel", "nevermind") is spoken or voice interaction times out.
- Custom Wake Word Flash-at-Install: Upload any microWakeWord
.tflitemodel directly in the browser installer. Pre-compiled firmware detects the partition header at boot, loads the model, and exposes it in Home Assistant.
The esphome-satellite Web Installer includes built-in browser-based audio tooling and serial diagnostics powered by the Web Audio API and WebSerial:
- Client-Side Audio Transcoder: Users can drag and drop custom audio files (
.wav,.mp3,.ogg,.flac,.m4a) directly in Chrome or Edge. The browser's nativeOfflineAudioContextdecodes the audio, resamples it to 16,000 Hz mono 16-bit PCM, peak-normalizes it to-1.0 dBFS, and flashes it directly into dedicated flash partitions (chime_data,sound_data, orcancel_data). - Interactive Sound Showcase: Listen to high-fidelity MP3 previews of all 17 pre-compiled acoustic themes directly in the browser before flashing.
- WebSerial Terminal & Hardware Reset: Connect to the device at 115,200 baud directly from the browser window. View live boot logs and send DTR/RTS hardware reset pulses to cycle the ESP32-S3 without physical unplugging.
The repository includes a self-contained, high-performance synthetic speech dataset generator and microWakeWord preparation script: scripts/generate_wakeword_corpus.py.
High recall in edge neural wake word models requires acoustic variety across speech speed, pitch, accents, and phonetic permutations. generate_wakeword_corpus.py automates positive dataset creation with zero manual recording required.
- ElevenLabs API (
--backend elevenlabs): Cloud neural synthesis using high-fidelity production voices and Instant Voice Cloning (IVC). Employs curated voice registries spanning female, male, adolescent, and accented speakers, plus dynamic on-the-fly cloning of custom household member voice clips viaPOST /v1/voices/add. - macOS
say(--backend macos_say): Built-in zero-dependency local macOS speech synthesizer. Uses dynamically discovered system voices (Samantha,Victoria,Alex,Daniel,Oliver,Junior, etc.) without requiring external network access or API tokens. - F5-TTS (
--backend f5_tts): Local zero-shot flow-matching non-autoregressive speech synthesizer. Clones reference voices with rich prosody and natural cadence usingf5-tts_infer-clior Python bindings (pip install f5-tts torch torchaudio).
To prevent acoustic overfitting and address gender/age detection disparities, the corpus generator draws from a balanced demographic distribution:
- Female (40%): Voices with higher pitch and faster formant transitions (
Rachel,Sarah,Freya,Nicole,Charlotte,Samantha,Victoria). - Male (40%): Deep and mid-range baritone voices (
Adam,Antoni,Josh,Arnold,George,Alex,Daniel). - Adolescent / Youth (10%): Higher vocal tracts and faster cadence (
Mimi,Liam,Fin,Junior). - Accents (10%): British, Irish, Australian, Transatlantic, and Swedish-English intonations (
Dorothy,Alice,Charlie,Matilda,Moira).
esphome-satellite comes with 7 built-in wake words, each featuring an extensive list of curated phonetic variations, acoustic respellings, and conversational prefixes for training microWakeWord models with maximum generalization:
- Mr. Clemens (
mister_clemens) — 35 phonetic variations:- Primary: mister clemens, hey mister clemens, ok mister clemens, okay mister clemens, hi mister clemens, mr clemens
- Phonetic respellings: mistah clemens, mistuh clemens, mister clemons, misterclemens, mistr clemens, meester clemens, missed her clemens, miss tur cleh muns, mis ter clem ens, mstr clemens, mister klemens, mrclemens, meahster clemens, etc.
- Bumblebee (
bumblebee) — 29 phonetic variations:- Primary: bumblebee, hey bumblebee, ok bumblebee, okay bumblebee, hi bumblebee
- Phonetic respellings: bum bull bee, bumbulbee, bummle bee, bammel bee, hey bumbelbee, bum bl bee, bumbolbee, ok bummlebee, hi bummbellbee, bahmble bee, bomblebee, bumbalbee, bumblbee, bummbell bee, etc.
- Hey Gizmo (
hey_gizmo) — 30 phonetic variations:- Primary: hey gizmo, gizmo, ok gizmo, okay gizmo, hi gizmo
- Phonetic respellings: hey giz mo, heygizmo, hay gizmo, hey gizz mo, ok gizzmo, hi gizz moe, heygeezmo, haygismo, gismo, hey jizmo, okay gizz moe, hey guizmo, heygezmo, giz moe, hey gihz mo, hay gihzmoh, hey gismoe, etc.
- Hey Chief (
hey_chief) — 31 phonetic variations:- Primary: hey chief, chief, ok chief, okay chief, hi chief
- Phonetic respellings: heychief, hay chief, hey cheef, a chief, ey chief, ay cheef, hay cheef, hey cheaf, hey chafe, ok cheef, hi cheef, hey chif, hay chif, ok chif, hey tchief, hey sheef, hey chee eff, hey cheeve, etc.
- Oh Captain (
oh_captain) — 32 phonetic variations:- Primary: oh captain, captain, hey captain, ok captain, okay captain, hi captain, o captain
- Phonetic respellings: oh cap ten, oh cap in, oh capn, oh cap tin, ocapn, ohcapn, o captin, oh capitan, ohcaptain, hey capn, hey cap tin, oh kep ten, o keptin, oh cap ton, cap ton, oh cappin, oak happen, oh cap den, etc.
- OK Computer (
ok_computer) — 34 phonetic variations:- Primary: ok computer, okay computer, computer, hey computer, hi computer
- Phonetic respellings: oh kay computer, o k computer, okcomputer, okaycomputer, oh kay com pyoo ter, o kay com pu ter, ok compyooter, ok puter, kay puter, o kay kahm pyoo ter, oak a computer, ok cumputer, ok compudrr, ok compooter, okay compooder, ok computr, etc.
- Little Wizard (
little_wizard) — 35 phonetic variations:- Primary: little wizard, hey little wizard, ok little wizard, okay little wizard, hi little wizard, lil wizard
- Phonetic respellings: littlewizard, hey lil wizard, liddle wizard, liddl wizzard, lit tull wiz urd, lih tull wiz ard, hey liddle wizard, ok lil wizard, hi liddo wizzard, okay liddl wizard, hey litl wizrd, litl wizrd, liddle whizz urd, lee tul wee zard, lituhl wizard, lid ul wiz erd, litul wizerd, liddo wizard, lit uhl wizz urd, etc.
To eliminate acoustic bias and maximize detection reliability for specific family members without sacrificing generalization:
- Reference Sample Ingestion:
- Supply single reference clips (
--voice-sample audio.wav --voice-name "Alice" [--voice-transcript "Sample text"]) or point to an entire folder of household samples (--household-dir data/household_voices/). - The directory can contain subdirectories per member (
data/household_voices/partner/sample.wavandtranscript.txt) or flat audio files (data/household_voices/partner.wav).
- Supply single reference clips (
- Instant Voice Cloning (Cloud or Local):
- ElevenLabs IVC: Uploads reference audio via
POST /v1/voices/addto create custom voice profiles on your account, reusing existing cloned voices on subsequent runs. - F5-TTS: Clones reference audio locally via flow matching without external API keys or cloud dependencies.
- ElevenLabs IVC: Uploads reference audio via
- Additive Multi-Voice Composition (
--household-ratio):- The generator composes the synthetic dataset using an additive ratio (default: 50% household member voices, 50% balanced baseline demographics: 40% female, 40% male, 10% kids, 10% accents).
- This hybrid strategy ensures the neural network attains maximum sensitivity to the specific household's resonant frequencies while preserving acoustic generalization across varying voice conditions (morning voice, fatigue) and guests.
Generated audio clips are cached in .cache/mww_corpus/<sha256>.wav based on the hash of phrase, voice, engine, and acoustic parameters. Subsequent runs with identical parameters complete instantly without incurring duplicate API costs or re-synthesis delay.
Run the interactive terminal wizard:
python3 scripts/generate_wakeword_corpus.py --wizardThe wizard prompts for:
- Model target (Mr. Clemens, Bumblebee, Hey Gizmo, Hey Chief, Oh Captain, OK Computer, Little Wizard, or Custom phrase)
- Synthesis backend (ElevenLabs API, macOS say, or F5-TTS)
- Household voice sample ingestion and dataset allocation ratio
- Sample count (e.g. 50, 500, or 2,000)
- Output directory
Run in headless CLI mode for scripted automation:
# Generate 100 samples of Mr. Clemens using macOS say
python3 scripts/generate_wakeword_corpus.py \
--model mister_clemens \
--backend macos_say \
--count 100 \
--output data/mister_clemens/positive
# Generate 500 samples using ElevenLabs API with 50% household voice cloning
export ELEVENLABS_API_KEY="your-api-key"
python3 scripts/generate_wakeword_corpus.py \
--model ok_computer \
--backend elevenlabs \
--household-dir data/household_voices \
--household-ratio 0.50 \
--count 500 \
--output data/ok_computer/positive
# Generate using local F5-TTS zero-shot voice cloning
python3 scripts/generate_wakeword_corpus.py \
--model mister_clemens \
--backend f5_tts \
--voice-sample /path/to/partner_sample.wav \
--voice-name "Partner" \
--voice-transcript "This is a reference voice sample for wake word training." \
--count 100 \
--output data/mister_clemens/positive
# Generate custom phrase
python3 scripts/generate_wakeword_corpus.py \
--model custom \
--phrase "computer activate" \
--backend macos_say \
--count 50 \
--output data/custom/positiveEvery synthesized audio file is automatically normalized, trimmed of leading/trailing silence, and transcoded to 16,000 Hz 16-bit mono PCM matching microWakeWord input requirements:
- Feed generated
.wavfiles into the microWakeWord feature generator:python3 -m microwakeword.feature_generator \ --dataset_dir data/mister_clemens \ --output_dir trained_models/mister_clemens/features
- Train the streaming neural network model:
python3 -m microwakeword.train \ --feature_dir trained_models/mister_clemens/features \ --output_dir trained_models/mister_clemens/model
- Convert to INT8 quantized
.tflitemodel and flash directly to partition0x510000(wake_model) via the Web Installer.
esphome-satellite exposes native Home Assistant entities generated via nim-esphome's declarative controls DSL, enabling full runtime configuration and automation from your dashboards:
| Entity ID | Domain | Type / Options | Description |
|---|---|---|---|
select.slot_1_wake_word |
select |
Built-in (Mr. Clemens, Bumblebee, Hey Gizmo, Hey Chief, Oh Captain, OK Computer, Little Wizard), Custom |
Wake word model assigned to Assistant 1 (Slot 1). |
select.slot_2_wake_word |
select |
Disabled, Built-in (Mr. Clemens, Bumblebee, Hey Gizmo, Hey Chief, Oh Captain, OK Computer, Little Wizard), Custom |
Wake word model assigned to Assistant 2 (Slot 2). |
select.slot_1_sensitivity |
select |
Slightly, Moderately, Very, Extreme sensitivity | Sensitivity preset for Slot 1 detection. |
select.slot_2_sensitivity |
select |
Slightly, Moderately, Very, Extreme sensitivity | Sensitivity preset for Slot 2 detection. |
number.slot_1_probability_cutoff |
number |
0.01 – 0.99 (step 0.01, default 0.50) |
Precise numeric probability cutoff threshold for Slot 1 detection. |
number.slot_2_probability_cutoff |
number |
0.01 – 0.99 (step 0.01, default 0.50) |
Precise numeric probability cutoff threshold for Slot 2 detection. |
number.voice_wake_window_size |
number |
2 – 5 frames (default 3) |
Detection window length; lower values catch fast female syllables. |
number.voice_mic_pre_gain_boost |
number |
0 dB – +12 dB (step 1 dB, default 3 dB) |
Digital pre-gain applied to raw microphone samples before DSP inference. |
text.voice_cancellation_words |
text |
Comma-separated strings | Phrases that immediately abort active listening (stop, nevermind, cancel). |
button.voice_reset_conversation_history |
button |
Action | Clears conversational memory context on Home Assistant. |
select.slot_1_wake_chime |
select |
17 Acoustic Themes, Silent, Custom |
Acknowledgement chime played for Slot 1 wake word. |
switch.slot_1_wake_chime_enabled |
switch |
on / off |
Master toggle for Slot 1 wake chime playback. |
number.slot_1_volume |
number |
0% – 100% (step 5%) |
Master playback and chime volume level for Slot 1. |
select.slot_1_processing_sound |
select |
17 Acoustic Themes, Silent, Custom |
Continuous audio loop played during Slot 1 cloud processing. |
select.slot_1_cancel_sound |
select |
Match Wake Chime, 17 Themes, Silent |
Resolve cue played when Slot 1 interaction is cancelled. |
switch.slot_1_cancel_sound_enabled |
switch |
on / off |
Master toggle for Slot 1 cancel sound playback. |
select.slot_2_wake_chime |
select |
17 Acoustic Themes, Silent, Custom |
Acknowledgement chime played for Slot 2 wake word. |
switch.slot_2_wake_chime_enabled |
switch |
on / off |
Master toggle for Slot 2 wake chime playback. |
number.slot_2_volume |
number |
0% – 100% (step 5%) |
Master playback and chime volume level for Slot 2. |
select.slot_2_processing_sound |
select |
17 Acoustic Themes, Silent, Custom |
Continuous audio loop played during Slot 2 cloud processing. |
select.slot_2_cancel_sound |
select |
Match Wake Chime, 17 Themes, Silent |
Resolve cue played when Slot 2 interaction is cancelled. |
switch.slot_2_cancel_sound_enabled |
switch |
on / off |
Master toggle for Slot 2 cancel sound playback. |
number.hardware_headphone_volume |
number |
0% – 100% (step 5%) |
Dedicated analog headphone/lineout volume control on TLV320AIC3104 with zero-volume mute power-down. |
select.hardware_led_idle_pattern |
select |
Off, Breathe, Rainbow, Spinner |
Ambient idle animation mode for the 12-LED addressable ring. |
number.hardware_led_brightness |
number |
5% – 100% (step 5%) |
Brightness scaling for all LED animations. |
switch.hardware_microphone_mute |
switch |
on / off |
Hardware/firmware microphone privacy mute toggle. |
sensor.status_satellite_state |
sensor |
14 Typestates | Real-time state machine telemetry (Idle, Woken, Listening, Thinking, Replying). |
button.hardware_reset_audio_hardware |
button |
Action | Hardware codec re-initialization and XMOS SoC reboot pulse. |
button.system_restart_satellite |
button |
Action | Soft reboot of the satellite microcontroller. |
All control settings are saved to on-device NVS flash memory and persist across power cycles and firmware updates.
On the Home Assistant Device page (/config/devices/device/<id>), entities are organized across three distinct cards with visual divider headers:
- Controls Card: Daily interactive controls including Slot 1/2 volumes, Headphone Volume, LED Brightness and Idle Pattern, Microphone Mute, Cancellation Words, Voice Wake Window, and Mic Pre-Gain Boost.
- Configuration Card: Acoustic profile selections for Slot 1 and Slot 2 (Wake Chimes, Processing Loops, Cancel Sounds, and Sensitivity tiers) separated by visual divider headers.
- Diagnostic Card: System maintenance actions (Reboot, Codec Reset, Firmware Channel, OTA Update, Probability Cutoffs, and Satellite State telemetry).
You can add this sectioned card to any Home Assistant dashboard for a unified satellite control center:
type: entities
title: Voice Satellite Control Center
show_header_toggle: false
entities:
- type: section
label: Device & Audio Controls
- entity: media_player.voice_satellite_speaker
name: Satellite Speaker
- entity: number.voice_satellite_slot_1_volume
name: Slot 1 Volume
- entity: number.voice_satellite_slot_2_volume
name: Slot 2 Volume
- entity: number.voice_satellite_hardware_headphone_volume
name: Headphone Output Volume
- entity: switch.voice_satellite_hardware_microphone_mute
name: Microphone Privacy Mute
- entity: number.voice_satellite_hardware_led_brightness
name: LED Ring Brightness
- entity: select.voice_satellite_hardware_led_idle_pattern
name: LED Idle Animation
- type: section
label: Slot 1 Persona
- entity: select.voice_satellite_slot_1_wake_chime
name: Wake Chime
- entity: switch.voice_satellite_slot_1_wake_chime_enabled
name: Wake Chime Enabled
- entity: select.voice_satellite_slot_1_processing_sound
name: Processing Loop
- entity: select.voice_satellite_slot_1_cancel_sound
name: Cancel Sound
- entity: switch.voice_satellite_slot_1_cancel_sound_enabled
name: Cancel Sound Enabled
- entity: select.voice_satellite_slot_1_sensitivity
name: Sensitivity
- type: section
label: Slot 2 Persona
- entity: select.voice_satellite_slot_2_wake_chime
name: Wake Chime
- entity: switch.voice_satellite_slot_2_wake_chime_enabled
name: Wake Chime Enabled
- entity: select.voice_satellite_slot_2_processing_sound
name: Processing Loop
- entity: select.voice_satellite_slot_2_cancel_sound
name: Cancel Sound
- entity: switch.voice_satellite_slot_2_cancel_sound_enabled
name: Cancel Sound Enabled
- entity: select.voice_satellite_slot_2_sensitivity
name: Sensitivity
- type: section
label: Voice Assistant Pipeline
- entity: text.voice_satellite_voice_cancellation_words
name: Cancellation Words
- entity: button.voice_satellite_voice_reset_conversation_history
name: Reset Conversation Context
- entity: number.voice_satellite_voice_mic_pre_gain_boost
name: Mic Pre-Gain Boost (dB)
- entity: number.voice_satellite_voice_wake_window_size
name: Sliding Window Size
- type: section
label: System Maintenance
- entity: sensor.voice_satellite_status_satellite_state
name: Satellite State
- entity: update.voice_satellite_firmware
name: Firmware Status
- entity: button.voice_satellite_hardware_reset_audio_hardware
name: Reset Codec & XMOS
- entity: button.voice_satellite_system_restart_satellite
name: Reboot Satellite| Hardware Platform | Support Status | Package / Target | Notes |
|---|---|---|---|
| Seeed Studio ReSpeaker Lite XVF3800 | Full Support (Primary Target) | packages/respeaker_xvf3800.yaml |
Dedicated XMOS XVF3800 DSP driver, TI AIC3104 codec, 12-LED ring animations, factory web installer binaries, and custom wake word partition loader. |
| Home Assistant Voice PE | Architecture Compatible | Community Contribution Welcome | Core Nim FSM, DSP compression, and sound player ready; needs dedicated board GPIO mapping and audio codec package. |
| ESP32-S3-BOX / S3-BOX-3 | Architecture Compatible | Community Contribution Welcome | Core supervisor ready; needs ES8311/ES7210 codec package, 16MB partition map, and display/LED integration. |
| M5Stack CoreS3 / Atom Echo | Architecture Compatible | Community Contribution Welcome | Core supervisor ready; needs board pinouts, audio codec/DAC drivers, and flash memory layout. |
| Generic ESP32-S3 + I2S Audio | Architecture Compatible | packages/satellite_nim_fsm.yaml (Base Package) |
Integrates directly with standard ESPHome i2s_audio components and the reusable Nim state supervisor. |
Contributions of any kind are welcome, especially adding support for additional voice satellite hardware boards!
The architecture of esphome-satellite is cleanly separated into two distinct layers:
-
Hardware-Agnostic Core Supervisor (Nim):
- 14-state verified typestate state machine (
packages/satellite_nim_fsm.yaml,src/nim_esphome_satellite.nim) - Real-time audio DSP compression, dialogue boost, and soft limiting (
src/audio_dsp.nim) - Zero-heap IMA-ADPCM sound playback across 17 acoustic themes (
src/pcm_sound_player.nim) - Mid-utterance cancellation and stop phrase matching (
src/cancellation_matcher.nim) - Dynamic microWakeWord partition loader and header validator (
src/wake_partition_loader.nim)
This entire layer runs identically on any ESP32 or ESP32-S3 microcontroller.
- 14-state verified typestate state machine (
-
Board-Specific Hardware Integration (ESPHome YAML + C ABI Bridges):
- Physical pinout definitions (I2S, I2C, SPI, GPIO)
- Audio DAC, ADC, and codec initialization (e.g. AIC3104, ES8311, ES7210, ES8388, MAX98357A)
- Visual indicators (addressable NeoPixels, onboard displays via LVGL, or co-processor LEDs)
- Flash partition table (
partitions_<board>.csv) sized for the board's flash chip (4MB, 8MB, or 16MB)
To add support for a new hardware platform (for example, esp32_s3_box_3 or atom_echo):
Create a new YAML package in packages/<board_name>.yaml that imports the core supervisor:
packages:
fsm: !include satellite_nim_fsm.yaml
substitutions:
name: "esphome-satellite-<board_name>"
friendly_name: "Voice Satellite (<Board Name>)"
version: "0.6.1"
esp32:
board: <board_identifier>
framework:
type: esp-idf
partitions: ../partitions_<board_name>.csv
# Define board-specific I2S/I2C audio hardware
...Map the onboard microphone (ADC) and speaker (DAC/amplifier) components:
- For boards with integrated codecs (such as Everest ES8388 or ES8311/ES7210), configure standard ESPHome audio codec platforms.
- Wire the speaker output to
id(board_speaker)so the core PCM sound player and real-time DSP hooks attach automatically.
Connect visual states (LEDs or display) to the satellite state machine:
- Query the current typestate using
get_satellite_state_name(). - Map the states (
Idle,Listening,Thinking,Replying,Muted,Error) to your board's hardware (e.g. onboard RGB LEDs via ESPHome'slightcomponent, or display graphics).
Create partitions_<board_name>.csv tailored to your board's flash size:
- Allocate dual OTA partitions (
ota_0,ota_1) sized to accommodate the compiled binary. - Allocate
wake_modeldata partitions (e.g. 224 KB each) for microWakeWord models. - Preserve standard NVS and PHY calibration storage.
Run the invariant test suite and validate configuration syntax:
# Run local host invariant tests
./scripts/test.sh
# Validate ESPHome YAML configuration
uv run --python 3.11 --with esphome esphome -s version "0.6.1" config packages/<board_name>.yamlWhen submitting PRs or contributing code:
- Strict Nim-First Architecture: All state machines, peripheral drivers, DSP algorithms, and business logic must be authored in Nim. C++ is strictly reserved for thin C ABI adapter bridges and upstream ESPHome component shims.
- Automated Header Bindings: When wrapping third-party C or ESP-IDF libraries, generate Nim FFI bindings using
headerkitrather than hand-writing raw externs. - Single Translation Unit via Include: All Nim submodules integrated into the firmware build must be included via
include <module>insidesrc/nim_esphome_satellite.nimto guarantee clean symbol resolution during PlatformIO link steps. - Strict Test-Driven Development (TDD): Every Nim module and Python script must have accompanying unit tests in
tests/. Always perform anti-green-mirage verification before code changes. - Zero Emojis: Keep all documentation, commit messages, code comments, and PR descriptions clear, technical, human, and completely free of emojis.
Continuous integration runs automatically on every push and pull request via GitHub Actions (.github/workflows/ci.yml). Matrix builds validate Nim 2.2.10 and Nim 2.2.8 across all test suites and verify ESP32 cross-compilation syntax.
You do not need an ESP32 connected to run the test suite. All state machine logic and compile-time invariants run locally on macOS or Linux:
# Run complete test suite and ESP32 syntax check
./scripts/test.sh
# Or run individual test suites directly
nim c -r tests/test_fsm.nimThe test suite validates:
- Core Happy Path:
Idle -> Woken -> Listening -> Thinking -> Replying -> Idle - Barge-in Interruptions:
Stopcommand duringListening,Thinking,Replying, andAlerting - Granular Errors:
SilentDismiss,PipelineError,ConnectionError - Extended Lifecycle:
Muted,FollowUp,PlayingMedia,Alerting,Announcing,Updating - Compile-Time Invariant Enforcement: Verified using
not compiles(...)(e.g. verifying that callingonWakeWordwhileMutedorUpdatingis rejected by the compiler). - Embedded C++ Transpilation: Verifies cross-compilation for ESP32 with
-d:danger, ARC memory management, and C++ ABI bridging.
esphome-satellite/
├── src/
│ ├── nim_esphome_satellite.nim # 14-state verified FSM & exported C ABI
│ ├── satellite_fsm.nim # Re-export entrypoint
│ └── nim_satellite_bridge.h # C/C++ weak symbol bridge header
├── packages/
│ ├── respeaker_xvf3800.yaml # Seeed ReSpeaker XVF3800 hardware configuration
│ └── satellite_nim_fsm.yaml # ESPHome reusable package for drop-in integration
├── tests/
│ ├── test_audio_dsp.nim # Speech compression, makeup gain & limiter tests
│ ├── test_cancellation.nim # Mid-utterance cancellation matcher tests
│ ├── test_fsm.nim # 14-state verified FSM typestate tests
│ ├── test_pcm_player.nim # IMA-ADPCM zero-heap decoder tests
│ ├── test_version_sync.nim # Version consistency invariant test suite
│ ├── test_wake_loader.nim # Dynamic microWakeWord partition loader tests
│ └── test_xvf3800.nim # XVF3800 GPO & LED ring animation tests
├── scripts/
│ ├── build_factory_binary.sh # Automated factory flashing binary builder
│ ├── bump_version.sh # Synchronized semver bumper
│ ├── generate_wakeword_corpus.py # Synthetic speech corpus generator & trainer
│ ├── generate_web.nim # Web installer HTML generator
│ ├── process_audio.py # Audio normalization & ADPCM sound bank pipeline
│ ├── test.sh # Invariant test execution runner
│ └── transcode_sounds.nim # Nim sound bank transcoder
└── esphome_satellite.nimble # Package specification & dependencies
All notable changes are documented in CHANGELOG.md in Keep a Changelog format.
All 51 acoustic assets (17 Wake Chimes, 17 Processing Loops, and 17 Cancel Sounds) are royalty-free under permissive licenses (Creative Commons CC0 1.0 Universal Public Domain Dedication and Creative Commons Attribution CC-BY 3.0). Complete per-sound author credits, origins, and license terms are documented in ATTRIBUTION.md.
MIT © Axiomantic / Elijah Rust