speech-to-phrase currently fails with the error “Failed to connect” when I select Settings > Devices & services > Devices tab > Add Device > search Wyoming Protocol and add host 192.168.0.13, port 10300.
I just got Home Assistant Voice Preview Edition. I have Home Assistant running in a Docker container, so the official documentation doesn’t give step-by-step instructions for local voice processing. I added Wyoming Protocol for Piper without issue.
Creating network “piper_default” with the default driver
Creating piper_wyoming-piper_1 … done
Adding Piper via the Wyoming Protocol (Settings > Devices & services > Devices tab > Add Device > search Wyoming Protocol and add host 192.168.0.13, port 10200) worked without issue.
i’m also starting with similar setup. However my compose uses rhasspy/wyoming-whisper, not sure yet what the differences are between yours selected and this one, with me integration setup was no issue.
Now i see differences, i might switch to speech to phrase btw
I use hostname to connect containers. so containerhostname:10300
I dont think this is your issue but just a quick sidenote.
I always suggest checking container log first.
Are you sure Speech2phrase container is running properly. First time I launch S2P it was running but failed training so could not allow connections from HA.
compose file look OK.
Portainer make log viewing of containers easy as well as easy command line when needed.
EDIT: i dont use ’ ’ with my api key. that may matter
Thanks for pointing me to the container logs for speech-to-phrase. (I didn’t realize those were a thing. ) It says, “Connection timeout to host ws://192.168.0.13:8123/api/websocket” Visiting “http://192.168.0.13:8123” in the browser loads without issue and I can connect via websocket using the browser dev tools.
I tried removing the single quotes from the API key and reran docker-compose down and up. It gave the same error in the logs. Below is the last portion of the logs from Docker.
Not sure what to try next.
docker logs --since 2m speech-to-phrase
...
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/.venv/lib/python3.11/site-packages/speech_to_phrase/__main__.py", line 191, in <module>
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/src/.venv/lib/python3.11/site-packages/speech_to_phrase/__main__.py", line 96, in main
await _retrain_once(state, force_retrain=True)
File "/usr/src/.venv/lib/python3.11/site-packages/speech_to_phrase/__main__.py", line 131, in _retrain_once
hass_info = await get_hass_info(
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/.venv/lib/python3.11/site-packages/speech_to_phrase/hass_api.py", line 249, in get_hass_info
async with session.ws_connect(uri, max_msg_size=0) as websocket:
File "/usr/src/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 1482, in __aenter__
self._resp: _RetType = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/src/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 1061, in _ws_connect
resp = await self.request(
^^^^^^^^^^^^^^^^^^^
File "/usr/src/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 770, in _request
resp = await handler(req)
^^^^^^^^^^^^^^^^^^
File "/usr/src/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 729, in _connect_and_send_request
raise ConnectionTimeoutError(
aiohttp.client_exceptions.ConnectionTimeoutError: Connection timeout to host ws://192.168.0.13:8123/api/websocket