Piper "TRY VOICE" `Unable to load example. Response error: 500` error

Hi Guys;

I am having trouble with Installing a local Assist pipeline - Home Assistant

More specifically, the part that “Under Text-to-speech, select piper.”

I have follow through installed all the addons (Whisper, Piper, openWakeWord, Wyoming) and everything was fine.

But at the “Settings > Voice assistants”, every time when I click “TRY VOICE” and “PLAY”, it got Unable to load example. Response error: 500 error

have already tried “save and then retry”, “reboot, retry”… etc.

also I have noticed the Piper addon config default voice is “en_US-lessac-medium”
so I tried setting the same voice in settings and/or changing the Piper config

but same result :crying_cat_face:


After many attempt… I have noticed there are some errors in the log, which I assume it was triggered by the “fail”

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: █████ (1 occurrences)
Last logged: █████
Error handling request

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 1017, in post
    base = get_url(self.tts.hass)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 208, in get_url
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

Was wondering if anyone got this issue as well?
Or is it me only?

P.S.:
I am using Home Assistant OS on Yellow

I have had this on occasion when trying the voices while away from home (so not on same network).

Sadly, in my case… I am on the same local network.

And I just cannot get it to work. :crying_cat_face:

I’m having the same problem, supervised setup on a mini PC (installed/upgraded from a pi3 yesterday).

The error 500 comes up if I select Piper or Google translate.

OMG… guys.

I think I have solved this myself (sort of). :scream:


Short version (TL;DR)

from: https://www.home-assistant.io/integrations/tts/#troubleshooting (troubleshooting)

  • external_url

Full version

I have noticed the above error that I quoted (from the log) is NoURLAvailableError,
and from base = get_url(self.tts.hass)

So, I have searched and searched online, source code… etc. for where does that tts come from.

And finally, I found the troubleshooting section in integrations/tts

did actually mentioned “Depending on your setup, you might need to set an external URL (external_url) inside the configuration.”
 

I have tried to add external_url to the configuration.yaml (in the front-end UI should also work), restart…
And bam! Piper is talking to me now. :heart_eyes_cat:


Thing is… I want everything to be local.

Which means, I do not want anyone knowing my actual domain for the Yellow (assume ha, esp32… will phone home :imp:)

I tried to put in different things as the external_url

and… final solution (for now), this is what I use for the external_url

external_url: "https://homeassistant.local:8123"

I basically reference the internal_url from the Setup basic information - Home Assistant tutorial

  • https is important
  • .local domain (ref.: https://en.wikipedia.org/wiki/.local)

This way will not cause the error (original post),
and also (in theory), even device know the external_url, it should just work locally.

 
P.S.:

  • ( I have only tested saying “testing” :stuck_out_tongue: )

  • TRY VOICE is working :white_check_mark:

  • my newly setup ATOM Echo is working :white_check_mark:
    (just a bit slow… but that should be something else)

  • Android app voice assistant is tested… working (both local network & external) :white_check_mark:

  • not sure what else to try for now… :question:

1 Like

I faced this problem as well. The user experience is not good. One should not have to figure out that a URL is required. In my case, I’m using the local network only, so I didn’t want to set an external_url . I was able to set the internal URL, however. I went to Settings / Network and unchecked “Automatic” for local network.

I don’t understand why this is required to play sound on the local device (mobile phone in the app, browser otherwise). I have 13 add-ons, 32 integrations, 246 devices, and 1,392 entities. All worked fine without the local URL.

The warning about Google Cast devices not supported self-signed certificates is a bit odd also. Home Assistant has been able to play audio to my Cast devices for a long time. More recently, so has Music Assistant.

I need to run HA with SSL for Z-Wave JS to be able to support Smart start. And of course, I’m not using publicly signed certs.

IMO, this URL requirement should be lifted, if at all possible, at least in the case of local network use only.

If it can’t be removed, this requirement should be documented in the setup instructions for Assist. And there should be a more detailed error shown to the user than just “error 500”. And preferably a link to go to the settings / network page.

Now I have to figure out why the wake word also does not work. The speech to text does work, if triggered manually. Even though the text is correct, none of the queries I tried are understood by Assist so far.

Thanks, I had the same issue. I wonder if it’s a side effect of installing a private/self signed SSL certificate? I notice @madbrain has an https URL, and I did too.

For me I had to sign out of the cloud connection (which I didn’t purchase) so that the Internet URL could be disabled. It would appear to be disabled, and there was no error if I clicked “save”, but if I refreshed the screen it would be back to Automatic. Then I disabled the Automatic Local URL and typed in the https URL by hand including the :8123/ part, and Saved. After that the voice test worked without issue.