Loopback NAT issue breaks TTS?

I tried testing an automation with a text-to-speech output today, and nothing came out of the speaker but a brief warble. So just to verify that TTS was still working in general, I tried text-to-speech output to that speaker and others from the UI, and discovered that it had stopped working. I swear it worked last week!

Doing a little reading, one of the problems mentioned by others was that TTS had stopped working for them after setting up their external access following the recommended procedure, and in particular it was suggested that the base_url might affect it if wrong. Since I had added a base_url since last testing TTS, I double-checked to make sure it was correct - it was. And then it occurred to me to wonder if the issue might be loopback NAT. I know that some routers will allow you to access their own WAN address from within the LAN (loopback NAT), while others won’t - and I know that mine won’t. Therefore if anything in TTS is trying to use that base_url I specified to access something within my LAN, it ain’t gonna work. And indeed when I removed the base_url, TTS worked again.

I therefore conclude that there may be a problem with Home Assistant not recognizing that the issue of loopback NAT support in the router exists, and can cause a problem if the external url is being used when it shouldn’t be.

Update:
Doing some more research today, I see that there is a known issue relating to this and confirming the problem, although it doesn’t mention the loopback NAT implication:
https://github.com/home-assistant/home-assistant/issues/22252

So for the moment it looks like I have to make a choice between specifying base_url or having TTS work.

Two questions therefore:

  • What in Home Assistant actually uses the base_url?
  • When might the fix mentioned in the issue thread above arrive?

Don’t know if it’ll help in your situation but there’s a separate base URL parameter specifically for tts.

1 Like

Yes! Thank you, that’s what’s needed to solve the problem for the moment, although I’ll have to remember the dependency on the specific LAN IP address

I wonder why TTS needs to use the base_url at all? HA should surely know when an operation doesn’t need to go outside the LAN.