Home Assistant Voice Preview is an unusable mess.

Shawn Wang

Home Assistant Voice 预览版就是一团没法用的烂摊子

原文由 Shawn Wang 于 发布,订阅该博客

我最近刚入手了一个Home Assistant Voice。当时特别兴奋,想把它当成一个可编程的 Alexa 来试试。

第一个问题——HA Voice 不能自己独立运行,它还得依赖另一个 Home Assistant 实例。

图片

好吧,没问题。我多少还算懂点技术,应该能搞定。于是去看HA 的安装说明。

Home Assistant 的问题

一上来它就想卖我一个 Home Assistant Green。行吧,我没兴趣,但你们该赚钱就赚钱吧。

图片

顺便说一下,你们那个购买按钮现在点不了,最好去看一下。

图片

我可不想等树莓派寄过来,于是继续往下翻。我手头有 4 台闲置的 Mac,说不定能用上?啊,有 Mac 版指南!

图片

Home Assistant on Mac

Mac 版页面。

它让我做的第一件事就是下载“合适的镜像”。为什么不是 Docker 镜像?或者别的能直接挂载的东西?结果非要搞什么虚拟机那一套?去他妈的,以后再说吧。(我后来才知道 VirtualBox 是一种特定类型的虚拟机管理器,但当时我根本不知道,也许该加个下载 VirtualBox 的说明……)

图片

这不是开源的吗?不能直接从源码跑吗?看起来还有个叫 Home Assistant Core 的版本,不错。

图片

嗯,新款 Mac 已经没有 apt-get 了。

图片

没事,用 brew 吧。安装倒是成功了,不错。

下一步:Create an account.

图片

什么鬼?这是 Linux 指南吧?到底有没有人为 Mac 定制过这个?

事实上,这些看起来全是 Linux 那一套。

图片

去他妈的。

接着我试了这个:假设你已经装了 uv:

# be in some folder you like
uv venv
uv pip install homeassistant==2025.1.2 --prerelease=allow
uv run hass
我第一次构建这个的时候就遇到了问题。 apparently 你得先运行“sudo softwareupdate --install "Command Line Tools for Xcode-16.2"”,不然就会报这个错
Unable to find configuration. Creating default one in /Users/shawnwang/.homeassistant
2025-01-19 16:33:27.267 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.
2025-01-19 16:33:36.677 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package pyspeex-noise==1.0.2: × Failed to download and build `pyspeex-noise==1.0.2`
  ╰─▶ Build backend failed to build wheel through `build_wheel` (exit status: 1)
      [stdout]
      running bdist_wheel
      running build
      running build_py
      building 'speex_noise_cpp' extension
      clang++ -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 ...
      [stderr]
      /Users/shawnwang/.cache/uv/sdists-v6/pypi/pyspeex-noise/1.0.2/OiKAa5C3V4L1j77Pq6j5d/src/speex/preprocess.cc:921:14: warning: code will never be executed [-Wunreachable-code]
      Compiling with an SDK that doesn't seem to exist: /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk
      Please check your Xcode installation
      clang++: warning: no such sysroot directory: '/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk'
      ld: library 'c++' not found
      clang++: error: linker command failed with exit code 1
      error: command '/usr/bin/clang++' failed with exit code 1
2025-01-19 16:34:07.135 ERROR (MainThread) [homeassistant.setup] Setup failed for 'cloud': Requirements for assist_pipeline not found: ['pyspeex-noise==1.0.2'].
2025-01-19 16:34:19.493 ERROR (MainThread) [homeassistant.setup] Error during setup of component conversation
Traceback (most recent call last):
  File "/Users/shawnwang/Desktop/Work/homeassistant/.venv/lib/python3.12/site-packages/homeassistant/setup.py", line 416, in _async_setup_component
    result = await task
  File "/Users/shawnwang/Desktop/Work/homeassistant/.venv/lib/python3.12/site-packages/homeassistant/components/conversation/__init__.py", line 246, in async_setup
    from homeassistant.components.assist_pipeline import (  # pylint: disable=import-outside-toplevel
  File "/Users/shawnwang/Desktop/Work/homeassistant/.venv/lib/python3.12/site-packages/homeassistant/components/assist_pipeline/pipeline.py", line 55, in <module>
    from .audio_enhancer import AudioEnhancer, EnhancedAudioChunk, MicroVadSpeexEnhancer
  File "/Users/shawnwang/Desktop/Work/homeassistant/.venv/lib/python3.12/site-packages/homeassistant/components/assist_pipeline/audio_enhancer.py", line 8, in <module>
    from pyspeex_noise import AudioProcessor
ModuleNotFoundError: No module named 'pyspeex_noise'
2025-01-19 16:34:19.497 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of 'assist_pipeline'. Setup failed for dependencies: ['conversation']
2025-01-19 16:34:19.497 ERROR (MainThread) [homeassistant.setup] Setup failed for 'assist_pipeline': Could not setup dependencies: conversation
2025-01-19 16:34:19.886 ERROR (MainThread) [homeassistant.setup] Setup failed for 'mobile_app': Requirements for assist_pipeline not found: ['pyspeex-noise==1.0.2'].
2025-01-19 16:34:19.886 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of 'default_config'. Setup failed for dependencies: ['assist_pipeline', 'cloud', 'conversation', 'mobile_app']
2025-01-19 16:34:19.886 ERROR (MainThread) [homeassistant.setup] Setup failed for 'default_config': Could not setup dependencies: assist_pipeline, cloud, conversation, mobile_app
2025-01-19 16:34:19.887 WARNING (MainThread) [homeassistant.bootstrap] Support for the running Python version 3.12.7 is deprecated and will be removed in Home Assistant 2025.2; Please upgrade Python to 3.13

这个方法让我进展了不少。但因为 HA 那些七七八八的依赖,我还是卡住了:

图片

所以我就在这儿停住了。本地安装照例又卡死了,只能回头去试虚拟机那条路了(我原则上拒绝安装 Xcode 那个垃圾玩意儿)。

Oracle VirtualBox

没人去 Oracle 旗下的东西会觉得舒服。装好 VirtualBox 后,双击之前下载的 .vdi 文件,结果……什么反应都没有

图片

当然,HA 页面上的说明

图片

跟 VirtualBox 的设置页面完全对不上

图片

全靠谷歌才找到原来是在这里加载 vdi 文件

图片

图片

还需要设置网络选项

图片

然后总算跑起来了(还得先折腾一遍屏幕控制/权限那套):

图片

然而,访问 http://homeassistant.local:8123/ 毫无反应。我试着关机,结果……当然是转起彩虹球了。

图片

重启。

反正,看起来默认的 vdi 本身就带着一些众所周知的 bug,而且现在还直接缺了它要加载的 \EFI\BOOT\BOOTx64.efi 文件。我在这里找到了一个可下载的,又了解到可以通过共享文件夹把它导进虚拟机。

图片

这倒是取得了一点进展……

图片

但还是死路一条。

又谷歌了一会儿找到了这些:https://community.home-assistant.io/t/unable-to-boot-home-assistant-in-virtual-machine-starup-nsh-error/220267/27?page=2

图片

Home Assistant with Docker

偶然看到一条评论,才发现这破玩意儿居然有 Docker 容器,藏在 Linux 文档里,那就试试吧……

图片

这个终于能用了!!

图片

把手机 App 连上 HA 服务器

https://voice-pe.home-assistant.io/getting-started/ 说你得用手机 App 来找到 HA Voice 设备。

当然,它就默认网络能直接通,但他妈的根本不通

图片

当然,到这里他们就开始向你推销 Nabu Cloud 了。

图片

我试过用 ngrok 建隧道,结果全是 400 Bad Request 错误。我最后注册了 Nabu Cloud,但心里一点也不爽。这更让我想把这整套东西直接扔掉一把火烧了。

图片

等远程访问启用后,再把链接(对,就是界面上那个链接)复制到手机上

图片

如果成功,应该会显示这个

图片

终于到语音了

回到 https://voice-pe.home-assistant.io/getting-started/

好在这一步倒是按宣传的那样正常工作了。

图片

当它要求“authorization”时,其实就是让你按照片里那个按钮

图片

然后就在这里碰到了这个 https://github.com/esphome/home-assistant-voice-pe/issues/265

操。

但那失败了。你得输入设备的 WLAN IP。如果你没有手动指定其他端口,设备的端口会自动是 6052。

我让 Vibhu 去翻路由器日志,找到已连接的那个 HA Voice 小玩意儿的 IP。是个 192.168.x.x 的地址,端口是 6053(不是评论里说的 6052)。把它填进 ESPHome,第二次就成功了。

然后我走了一遍设置向导……当然,这还不是我麻烦的终点。

https://community.home-assistant.io/t/home-assistant-voice-pe-the-voice-assistant-is-unable-to-connect-to-home-assistant/821049

https://github.com/esphome/home-assistant-voice-pe/issues/288

这条说明看起来最直接相关 https://community.home-assistant.io/t/home-assistant-voice-pe-tls-certificate-verification-failed/815768/3

折腾了大概一个小时后,我放弃了。

本文章由 muse-spark-1.2-contributor 进行翻译

评论