ai-startup-skills
AI 제품을 만드는 스타트업을 위한 7단계 에이전트 스킬: 검증 → 비즈플랜 → 정책 → 로드쇼 → 고객 확보 → 가격 책정 → 등록
ESPHome 프로토콜을 이용한 Home Assistant용 음성 위성
Voice satellite for Home Assistant using the ESPHome protocol
기타Python · ShellGitHub @OHF-Voice직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗An experimental voice satellite software for Home Assistant remote voice control and interaction.
This project enables you to build a Linux-based voice assistant designed to use Assist for Home Assistant. It allows you to create your own smart speaker that runs on any x64 or ARM64 hardware capable of handling local audio processing (using PulseAudio).
Unlike simpler voice satellites that run on microcontrollers with very limited compute power, this setup can perform local wake word detection (OWW/MWW) and process some data on-device.
Because it runs on a full Linux system and offers access significantly more local computing resources for additional features and other integrations on the same satellite, this approach also provides greater flexibility for customization (such as for example experiment with using PipeWire).
Planning for future features is discussed in Discussion #495.
A more extensive list for possible compatible hardware can be found in the PiCompose documentation but basically any microphone that works with PipeWire (multimedia framework for Linux) can in theory be used for voice input with the prebuild image from there, you should however preferably use a far-field microphone-array solution if want better result.
Two solutions recommended for setups today is:
Those mic-boards have microphone-array designed for far-field voice capture with the added benefit of using an onboard XMOS DSP microcontroller with custom firmware which does advanced audio pre-processing for microphone cleanup that result in very good voice recognition capabilities (as it runs algorithms for Noise Suppression, Acoustic Echo Cancellation, Interference Cancellation, and Automatic Gain Control).
Alternatively if on a lower budget then suggest could use other microphone-array boards like for example the reSpeaker 2-Mics Pi HAT V2.0 (which uses a much more basic audio codec chip).
Assist Satellite app for Home Assistant OS
For HA OS, we provide a finished Assist Satellite app (formerly add-on), which uses the Linux Voice Assistant runtime to turn your HA host into a voice satellite.
[!NOTE] For now you first have to add the OHF-Voice apps repo manually to the App Store repository inside Home Assistant before you can install it.
Later you will be able to install it directly from the official add-on repository (but it is not yet published publicly there):
Once installed, the satellite is automatically discovered by Home Assistant via the ESPHome integration.
Raspberry Pi prebuilt image
For Raspberry Pi users, we provide a prebuild image that can be flashed to a SD card. See PiCompose.
Docker / bare metal
For all other users, we have different installation methods available (Docker, systemd), each with its own dedicated instructions. See Linux-Voice-Assistant - Installation.
💡 Note: There is an environment variable for each parameter if you use docker or systemd based setup.
usage: __main__.py [-h] [--name NAME] [--audio-input-device AUDIO_INPUT_DEVICE] [--list-input-devices] [--audio-input-block-size AUDIO_INPUT_BLOCK_SIZE] [--audio-output-device AUDIO_OUTPUT_DEVICE] [--music-output-device MUSIC_OUTPUT_DEVICE] [--list-output-devices] [--wake-word-dir WAKE_WORD_DIR] [--mic-auto-gain] [--mic-noise-suppression]
[--wake-model WAKE_MODEL] [--stop-model STOP_MODEL] [--download-dir DOWNLOAD_DIR] [--refractory-seconds REFRACTORY_SECONDS] [--wakeup-sound WAKEUP_SOUND] [--timer-finished-sound TIMER_FINISHED_SOUND] [--processing-sound PROCESSING_SOUND]
[--mute-sound MUTE_SOUND] [--unmute-sound UNMUTE_SOUND] [--preferences-file PREFERENCES_FILE] [--host HOST] [--network-interface NETWORK_INTERFACE] [--mac-address MAC_ADDRESS] [--port PORT] [--enable-thinking-sound] [--listen-during-wake-sound] [--debug]
| Parameter | Description | Default |
|---|---|---|
--name | Name of the voice assistant device (required) | Autogenerated (lva-MAC-ADDRESS) |
--audio-input-device | Soundcard name for input device | Autodetected |
--audio-input-block-size | Audio input block size in samples | 1024 |
--audio-output-device | mpv name for output device, use a pulse/... name from --list-output-devices | pulse |
--music-output-device | mpv name for the music/media output device | --audio-output-device |
--mic-volume | Control microphone volume | 100 |
--mic-auto-gain | Add WebRTC Gain to Mic | 0 |
--mic-noise-suppression | Add WebRTC Noise Suppression to Mic | 0 |
--audio-input-channels | Number of microphone audio channels to stream | 2 |
--wake-word-dir | Directory with wake word models (.tflite) and configs (.json) | wakewords/ |
--wake-model | ID of active wake word model | okay_nabu |
--stop-model | ID of stop model | stop |
--download-dir | Directory to download custom wake word models, etc. | local/ |
--refractory-seconds | Seconds before wake word can be activated again | 2.0 |
--continue-conversation-delay | Delay before mic opens for continued conversation | 0.5 |
--timer-max-ring-seconds | Seconds after which the timer stops ringing | 900.0 |
--wakeup-sound | Sound file played when wake word is detected | sounds/wake_word_triggered.flac |
💡 Note: There are detailed explanations on the controlled entities from device page in the configuration file.
💡 Note: How the assistant behaves in everyday situations (music ducking during conversations, announcements, timers, stop word, mute, volume) is described in the behavior guide.
Image builds can be tracked in this repository's Actions tab, and utilize artifact attestation to certify provenance.
The Docker images are built using GitHub Actions, which provides:
The documentation for the build process can be found in the GitHub Actions Workflows file.
System packages (Linux):
sudo apt install libmpv-dev)sudo apt install pulseaudio pipewire)sudo apt install alsa-utils)Python:
python3 --version should show 3.11+)sudo apt install python3.11 python3.11-venv python3.11-devVS Code development uses a local Python virtual environment (.venv/):
ms-python.python - Python language supportms-python.vscode-pylance - Python language serverkilo.kilocode - Kilo AI assistantCtrl+`) - Opens integrated terminal (uses .venv when available)./script/setup --dev to create .venv and install dev dependencies.venv/bin/python as the Python interpreterAvailable VS Code Tasks:
Ctrl+Shift+B - Run Setup or LinterCtrl+Shift+T - Run TestsCtrl+Shift+P → "Tasks: Run Task" - Show all tasks (Setup, Linter, Tests, Run App)The project uses the following tools to ensure code quality:
Docstrings are mandatory in Sphinx style with :param: (and :raises: where relevant). Google-style (Args:) and bullet-style docstrings are not accepted:
def my_function(param1: str, param2: int) -> str:
"""
Brief one-line description of the function.
:param param1: Description of what param1 is used for.
:param param2: Description of what param2 is used for.
"""
To use the development tools (linting, testing, etc.), you need to install the required dependencies:
./script/setup --dev
source .venv/bin/activate
./script/lint...
| Script | Description | Auto-fix Available? |
|---|---|---|
./script/lint_black | Checks Python code formatting with Black | Yes, use--auto flag |
./script/lint_flake8 | Runs style and syntax checks with flake8 | No |
./script/lint_isort | Checks import sorting with isort | Yes, use--auto flag |
./script/lint_mypy | Runs static type analysis with mypy | No |
./script/lint_pylint | Runs code quality checks with pylint | Yes, use--auto flag |
Run a specific lint check:
./script/lint_black
Auto-fix formatting issues (Black + isort):
./script/lint_black --auto
./script/lint_isort --auto
Run the test suite:
./script/tests
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
--start-listening-sound | Sound file played when button is pressed to start listening | sounds/start_listening_button.flac |
--timer-finished-sound | Sound file played when timer finishes | sounds/timer_finished.flac |
--processing-sound | Sound played while assistant is processing | sounds/processing.wav |
--mute-sound | Sound played when muting the assistant | sounds/mute_switch_on.flac |
--unmute-sound | Sound played when unmuting the assistant | sounds/mute_switch_off.flac |
--button-double-press-sound | Sound played on button double press | sounds/button_double_press.flac |
--button-triple-press-sound | Sound played on button triple press | sounds/button_triple_press.flac |
--button-long-press-sound | Sound played on button long press | sounds/button_long_press.flac |
--pipeline-ended-sound | Sound played when the voice pipeline ends without a response (e.g. no speech detected) | sounds/pipeline_ended_low.flac |
--preferences-file | Path to preferences JSON file | preferences.json |
--host | IP-Address for ESPHome server, use 0.0.0.0 for all | Autodetected |
--network-interface | Network interface for ESPHome server | Autodetected |
--mac-address | MAC address the device is known by in Home Assistant (e.g. 02:00:00:00:00:01) | The network interface's |
--port | Port for ESPHome server | 6053 |
--enable-thinking-sound | Enable thinking sound on startup | False |
--listen-during-wake-sound | Start listening while the wake sound is still playing | False |
--peripheral-host | Bind address for the peripheral WebSocket API | 0.0.0.0 |
--peripheral-port | Port for the peripheral WebSocket API | 6055 |
--peripheral-volume-step | Volume change per button press, 0.0–1.0 | %(default)s |
--peripheral-startup-wait | Seconds to wait for peripherals to register entities | 2.0 |
--disable-peripheral-api | Disable the peripheral WebSocket API entirely | False |
--debug | Print DEBUG messages to console | False |
--colored-debug | Print colored DEBUG messages to console | False |
--output-only | Enable output only mode | False |