重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
ha-voice by nodnarbnitram/claude-code-extensions
npx skills add https://github.com/nodnarbnitram/claude-code-extensions --skill ha-voice配置用于本地语音控制的 Assist 流水线、自定义意图、唤醒词、语音处理和语音卫星。
# configuration.yaml
assist_pipeline:
pipelines:
- language: en
name: Default Pipeline
stt_engine: faster_whisper # 本地 STT
tts_engine: tts.piper # 本地 TTS
conversation_engine: conversation.home_assistant
wake_word_entity: binary_sensor.wake_word
为何重要: 流水线将所有组件(STT、TTS、意图、对话代理)连接成一个单一的语音工作流。
# custom_sentences/en/turn_on.yaml
language: en
version: 1
intents:
TurnOn:
data:
- sentences:
- "turn on the [area] {name:list}"
- "turn on {name:list}"
- "[please] activate {name:list}"
lists:
name: light_names
lists:
light_names:
- "bedroom light"
- "kitchen overhead"
- "living room"
为何重要: 自定义句子模式支持针对您家庭定制的自然语音命令。
本地选项 - Piper:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
tts:
- platform: piper
language: en_GB
voice: jenny_dioco
云端选项 - OpenAI:
tts:
- platform: tts
service: google_translate_say # 或 openai, google cloud
language: en
为何重要: TTS 提供语音反馈;本地选项无需依赖云端。
本地选项 - Faster Whisper:
stt:
- platform: faster_whisper
language: en
云端选项 - Google Cloud Speech:
stt:
- platform: google_cloud
language_code: en-US
为何重要: STT 将语音命令转换为文本;本地选项提供隐私保护。
custom_sentences/ 目录进行意图配置(而非已弃用的 sentences/){name:list} 语法进行基于槽位的实体匹配version: 1sentences/ 目录和新的 custom_sentences/(仅使用 custom_sentences/){query}(会使意图变得模糊)❌ 错误 - 硬编码实体 ID:
intents:
TurnOn:
data:
- sentences:
- "turn on light.bedroom"
- "turn on light.kitchen"
✅ 正确 - 使用槽位列表:
intents:
TurnOn:
data:
- sentences:
- "turn on [the] {name:list}"
lists:
name: light_names
lists:
light_names:
- "bedroom"
- "kitchen"
原因: 列表是动态的,可以通过编程方式从 Home Assistant 实体生成。
命名槽位 匹配列表值:
sentences:
- "turn on {name:list}" # 匹配列表值,捕获为 'name' 槽位
列表匹配 提供槽位值:
lists:
room:
- "bedroom"
- "kitchen"
- "living room"
方括号 使单词可选:
sentences:
- "[please] turn on the {name:list}"
- "activate [the] {device:list}"
通配符槽位 捕获任意文本:
sentences:
- "remind me {reminder:text}" # 捕获任意文本作为 'reminder'
- "set a timer for {duration:text}"
intents:
TurnOn:
data:
- sentences:
- "[please] [turn on | switch on | activate] [the] {area} {name:list}"
- "[please] turn on {name:list}"
- "activate {name:list} [in the] {room:list}"
lists:
name: light_names
room: room_names
Reminder:
data:
- sentences:
- "remind me {reminder:text}"
- "[please] [create | set] a reminder [for me] [to] {reminder:text}"
lists:
light_names:
- "bedroom light"
- "kitchen overhead"
- "living room lamps"
room_names:
- "bedroom"
- "kitchen"
- "living room"
为何重要: 灵活的模式支持自然的表达方式,同时保持意图识别的准确性。
Home Assistant 提供默认意图:
HassTurnOn / HassTurnOff - 控制设备HassToggle - 切换开关/灯光HassOpenCover / HassCloseCover - 控制窗帘HassSetClimate - 控制气候(加热/制冷)HassGetState - 获取实体状态HassGetHistory - 查询自动化历史HassArmAlarm / HassDisarmAlarm - 布防/撤防警报HassLockDoor / HassUnlockDoor - 控制门锁您可以在 custom_sentences/ 中通过定义新的意图块来创建额外的意图:
intents:
CustomIntentName:
data:
- sentences: [...]
conversation:
engine: openai
# 启用 openWakeWord
binary_sensor:
- platform: openwakeword
models:
- alexa # "Alexa, help"
- hey_google # "Hey Google, ..."
- hey_siri
binary_sensor:
- platform: porcupine
access_key: !secret porcupine_key
keywords:
- hey_home_assistant
# ESPHome 设备
packages:
voice_assistant: !include packages/voice_assistant.yaml
# 或内联配置:
i2s_audio:
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO34
i2s_mclk_pin: GPIO32
microphone:
- platform: i2s_audio
id: mic
adc_type: external
i2s_din_pin: GPIO35
pdm: false
speaker:
- platform: i2s_audio
id: speaker
dac_type: external
i2s_dout_pin: GPIO36
mode: mono
voice_assistant:
microphone: mic
speaker: speaker
noise_suppression_level: 2
auto_gain: 80dB
volume_multiplier: 0.8
为何重要: 语音卫星通过本地处理将 Assist 扩展到多个房间。
完全支持 (20+ 种语言): en, de, fr, it, es, nl, pl, pt, ru, sv, tr, uk, zh, ja, ko 等
部分支持 (40+ 种语言): 地区变体和具有不同 STT/TTS 可用性的其他语言
社区支持 (80+ 种语言): 社区贡献的句子模板
语言配置:
assist_pipeline:
pipelines:
- language: de # 德语
name: Deutsche Pipeline
tts_engine: tts.piper # 按语言设置语音
STT (Faster Whisper):
stt:
- platform: faster_whisper
language: en
model: base # tiny, base, small, medium, large
acceleration: gpu # CPU 或 GPU
TTS (Piper):
tts:
- platform: piper
voice: en_GB-jenny
rate: 11025 # 音频采样率
volume_normalize: true
内置代理:
conversation:
engine: home_assistant
OpenAI 代理:
conversation:
engine: openai
api_key: !secret openai_api_key
model: gpt-4
自定义对话代理:
conversation:
engine: custom
module: custom_components.my_agent
intents:
TurnOn:
data:
- sentences:
- "turn on [the] {name:list}"
- "[please] activate {name:list}"
lists:
name: light_names
intents:
SetClimate:
data:
- sentences:
- "set [the] {room:list} [thermostat] to {temp:number} degrees"
- "make it {temp:number} in [the] {room:list}"
lists:
room: room_names
intents:
GetState:
data:
- sentences:
- "what is the temperature [in the] {room:list}"
- "is [the] {name:list} on"
lists:
room: room_names
name: device_names
症状: 语音命令未匹配任何意图
解决方案:
# 检查 custom_sentences 目录结构
ls -R config/custom_sentences/
# 验证 YAML 语法
cat config/custom_sentences/en/custom.yaml
# 在 Assist 开发者工具中使用确切短语测试
# 调整句子模式以匹配预期表达方式
症状: Assist 中出现 "Engine not available" 错误
解决方案:
# 验证引擎已配置
service: tts.piper # 必须存在
# 检查依赖项是否已安装
pip install piper-tts # 用于 Piper
pip install faster-whisper # 用于 Whisper
# 重启 Home Assistant 以加载引擎
症状: 尽管有噪音,二进制传感器仍保持关闭状态
解决方案:
# 验证 entity_id 是否正确
service: homeassistant.update_entity
target:
entity_id: binary_sensor.wake_word
# 检查二进制传感器配置
# 检查噪音水平和模型灵敏度
# 单独测试麦克风
症状: ESP32 断开 WiFi 或 Assist 流水线连接
解决方案:
# 检查 ESPHome 日志中的 WiFi 信号强度
# 减少 WiFi 距离或添加接入点
# 更新 ESPHome 固件
esphome run voice_assistant.yaml --upload-speed 115200
| 组件 | 版本 | 用途 |
|---|---|---|
| Home Assistant | 2024.1+ | Assist 平台 |
| Faster Whisper | 0.5+ | 本地 STT 引擎 |
| Piper TTS | 1.0+ | 本地 TTS 引擎 |
| 组件 | 版本 | 用途 |
|---|---|---|
| OpenWakeWord | 0.3+ | 唤醒词检测 |
| Porcupine | 最新 | 高级唤醒词 |
| ESPHome | 2024.1+ | 语音卫星设备 |
在使用语音命令前,请验证:
custom_sentences/en/ 目录已创建并包含意图定义每周安装数
65
仓库
GitHub 星标数
5
首次出现
Jan 24, 2026
安全审计
安装于
opencode59
gemini-cli57
codex56
github-copilot55
cursor54
cline53
Configure Assist pipelines, custom intents, wake words, speech processing, and voice satellites for local voice control.
# configuration.yaml
assist_pipeline:
pipelines:
- language: en
name: Default Pipeline
stt_engine: faster_whisper # Local STT
tts_engine: tts.piper # Local TTS
conversation_engine: conversation.home_assistant
wake_word_entity: binary_sensor.wake_word
Why this matters: The pipeline connects all components (STT, TTS, intent, conversation agent) into a single voice workflow.
# custom_sentences/en/turn_on.yaml
language: en
version: 1
intents:
TurnOn:
data:
- sentences:
- "turn on the [area] {name:list}"
- "turn on {name:list}"
- "[please] activate {name:list}"
lists:
name: light_names
lists:
light_names:
- "bedroom light"
- "kitchen overhead"
- "living room"
Why this matters: Custom sentence patterns enable natural voice commands tailored to your home.
Local Option - Piper:
tts:
- platform: piper
language: en_GB
voice: jenny_dioco
Cloud Option - OpenAI:
tts:
- platform: tts
service: google_translate_say # or openai, google cloud
language: en
Why this matters: TTS gives voice feedback; local options require no cloud dependencies.
Local Option - Faster Whisper:
stt:
- platform: faster_whisper
language: en
Cloud Option - Google Cloud Speech:
stt:
- platform: google_cloud
language_code: en-US
Why this matters: STT converts spoken commands to text; local options provide privacy.
custom_sentences/ directory for intent configuration (not deprecated sentences/){name:list} syntax for slot-based entity matchingversion: 1 in custom_sentences YAML filessentences/ directory with new custom_sentences/ (use custom_sentences/ only){query} for every slot (makes intents ambiguous)❌ Wrong - Hardcoded entity IDs:
intents:
TurnOn:
data:
- sentences:
- "turn on light.bedroom"
- "turn on light.kitchen"
✅ Correct - Using slot lists:
intents:
TurnOn:
data:
- sentences:
- "turn on [the] {name:list}"
lists:
name: light_names
lists:
light_names:
- "bedroom"
- "kitchen"
Why: Lists are dynamic and can be generated from Home Assistant entities programmatically.
Named slots match list values:
sentences:
- "turn on {name:list}" # Matches list value, captures as 'name' slot
List matching provides slot values:
lists:
room:
- "bedroom"
- "kitchen"
- "living room"
Square brackets make words optional:
sentences:
- "[please] turn on the {name:list}"
- "activate [the] {device:list}"
Wildcard slots capture any text:
sentences:
- "remind me {reminder:text}" # Captures any text as 'reminder'
- "set a timer for {duration:text}"
intents:
TurnOn:
data:
- sentences:
- "[please] [turn on | switch on | activate] [the] {area} {name:list}"
- "[please] turn on {name:list}"
- "activate {name:list} [in the] {room:list}"
lists:
name: light_names
room: room_names
Reminder:
data:
- sentences:
- "remind me {reminder:text}"
- "[please] [create | set] a reminder [for me] [to] {reminder:text}"
lists:
light_names:
- "bedroom light"
- "kitchen overhead"
- "living room lamps"
room_names:
- "bedroom"
- "kitchen"
- "living room"
Why this matters: Flexible patterns enable natural phrasing while maintaining intent recognition accuracy.
Home Assistant provides default intents:
HassTurnOn / HassTurnOff - Control devicesHassToggle - Toggle switches/lightsHassOpenCover / HassCloseCover - Control coversHassSetClimate - Control climate (heat/cool)HassGetState - Get entity stateHassGetHistory - Query automation historyHassArmAlarm / HassDisarmAlarm - Arm/disarm alarmsHassLockDoor / HassUnlockDoor - Control locksYou create additional intents in custom_sentences/ by defining new intent blocks:
intents:
CustomIntentName:
data:
- sentences: [...]
conversation:
engine: openai
# Enable openWakeWord
binary_sensor:
- platform: openwakeword
models:
- alexa # "Alexa, help"
- hey_google # "Hey Google, ..."
- hey_siri
binary_sensor:
- platform: porcupine
access_key: !secret porcupine_key
keywords:
- hey_home_assistant
# ESPHome device
packages:
voice_assistant: !include packages/voice_assistant.yaml
# Or inline configuration:
i2s_audio:
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO34
i2s_mclk_pin: GPIO32
microphone:
- platform: i2s_audio
id: mic
adc_type: external
i2s_din_pin: GPIO35
pdm: false
speaker:
- platform: i2s_audio
id: speaker
dac_type: external
i2s_dout_pin: GPIO36
mode: mono
voice_assistant:
microphone: mic
speaker: speaker
noise_suppression_level: 2
auto_gain: 80dB
volume_multiplier: 0.8
Why this matters: Voice satellites extend Assist to multiple rooms with local processing.
Full Support (20+ languages): en, de, fr, it, es, nl, pl, pt, ru, sv, tr, uk, zh, ja, ko, and more
Partial Support (40+ languages): Regional variants and additional languages with varying STT/TTS availability
Community Support (80+ languages): Community-contributed sentence templates
Language Config:
assist_pipeline:
pipelines:
- language: de # German
name: Deutsche Pipeline
tts_engine: tts.piper # Set voice per language
STT (Faster Whisper):
stt:
- platform: faster_whisper
language: en
model: base # tiny, base, small, medium, large
acceleration: gpu # CPU or GPU
TTS (Piper):
tts:
- platform: piper
voice: en_GB-jenny
rate: 11025 # Audio sample rate
volume_normalize: true
Built-in Agent:
conversation:
engine: home_assistant
OpenAI Agent:
conversation:
engine: openai
api_key: !secret openai_api_key
model: gpt-4
Custom Conversation Agent:
conversation:
engine: custom
module: custom_components.my_agent
intents:
TurnOn:
data:
- sentences:
- "turn on [the] {name:list}"
- "[please] activate {name:list}"
lists:
name: light_names
intents:
SetClimate:
data:
- sentences:
- "set [the] {room:list} [thermostat] to {temp:number} degrees"
- "make it {temp:number} in [the] {room:list}"
lists:
room: room_names
intents:
GetState:
data:
- sentences:
- "what is the temperature [in the] {room:list}"
- "is [the] {name:list} on"
lists:
room: room_names
name: device_names
Symptoms: Voice command doesn't match any intent
Solution:
# Check custom_sentences directory structure
ls -R config/custom_sentences/
# Verify YAML syntax
cat config/custom_sentences/en/custom.yaml
# Test in Assist Developer Tools with exact phrase
# Adjust sentence patterns to match expected phrasing
Symptoms: "Engine not available" error in Assist
Solution:
# Verify engine is configured
service: tts.piper # Must exist
# Check dependencies installed
pip install piper-tts # for Piper
pip install faster-whisper # for Whisper
# Restart Home Assistant to load engines
Symptoms: Binary sensor stays off despite noise
Solution:
# Verify entity_id is correct
service: homeassistant.update_entity
target:
entity_id: binary_sensor.wake_word
# Check binary sensor configuration
# Review noise levels and model sensitivity
# Test microphone separately
Symptoms: ESP32 disconnects from WiFi or Assist pipeline
Solution:
# Check WiFi signal strength in ESPHome logs
# Reduce WiFi distance or add access point
# Update ESPHome firmware
esphome run voice_assistant.yaml --upload-speed 115200
| Component | Version | Purpose |
|---|---|---|
| Home Assistant | 2024.1+ | Assist platform |
| Faster Whisper | 0.5+ | Local STT engine |
| Piper TTS | 1.0+ | Local TTS engine |
| Component | Version | Purpose |
|---|---|---|
| OpenWakeWord | 0.3+ | Wake word detection |
| Porcupine | Latest | Premium wake word |
| ESPHome | 2024.1+ | Voice satellite devices |
Before using voice commands, verify:
custom_sentences/en/ directory created with intent definitionsWeekly Installs
65
Repository
GitHub Stars
5
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode59
gemini-cli57
codex56
github-copilot55
cursor54
cline53
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
46,900 周安装