Sonos and TTS (Google) fails

@mdok @droopycool you need to install Nginx addon to get a reverse proxy in front of your HA. This will do that yo can work with http inside the LAN (Sonos works ok) and https from outside.
I have configured my duckdns as extenal and internal ip as internal in the http config yaml and it’s working good.

I am having a very similar issue here:

Blockquote* Failed to cast media from external_url ( Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Have obviously tried putting in the nuba casa address in the config yaml, Have not tried any port forwarding yet, but isn’t that the point of paying for the nabu casa cloud?

I added the below to the http section:

Copy to clipboard

use_x_forwarded_for: true

For me the tts or playing an mp3 track is still not working.
I also use duckdns with Let's encrypt. My HA is installled on an Odroid.

I have an Intel NUC with Webserver (Port 80 and 443 forwared) where my various websites run.
If I wanted to install the Nginx reverse proxy I would have to install it on the Intel NUC rather than on the HA Odroid? Correct.

Not sure why you’re replying to me. I don’t use Nabu Casa. I forward a single port and handle my SSL cert outside of HA. Sorry can’t help you.

Sorry, did not mean to imply that I was replying to you, just commenting on the thread in general, as my error message appears to be the same as what is in this thread.

Yes please. I’m having this issue too.

I’ve already tried the

  use_x_forwarded_for: true
    - or paste code here

which didn’t do anything for me:(

For all adding the forward and proxy part in the http config, have you installed the Nginx proxy manager?
Proven steps to solve the issue are:

  1. Install reverse proxy (like Nginx addon) Please follow the links in the previous posts for tutorial
  2. Add the lines to config.yml

The target is to allow your Sonos device to catch the mp3 generated files inside your LAN using http instead of https.

1 Like

Have you tried what Mr.H.99 said?

I haven’t yet, primiary because I wanted to avoid install Nginx to keep services running on HA as lean as possible.

Does anyone know why this problem has occurred all of a sudden? What has changed to break the SONOS TTS feature?

1 Like

I gave up and installed Nginx and added the necessary lines to the http block within the config file. Still didn’t work for me. Will continue researching the problem and try again in a few days.

You and me both. I added the Nginx and added the lines of code into the http section, still nothing. Not sure its coincidence or just the same version had breaking changes to multiple things, but none of my 8 or so alexa devices wont work as well. TTS says use notify.alexa, and notify.alexa brings up an unknown error. Its been over a month now, and I didnt make any changes to any of the automations or scripts that were working before.

Would love a fix.

@scofieldjace and @Sunstarwu - does HomeAssistant report the the same error as before or has it changed?

That’s one of the problems @mdok I’m not seeing errors from HA, I can only see errors within the Sonos app if I have it open on my phone when I try to trigger TTS.

“Unable to play xxx.mp3 - The connection to was lost”

Like others this previously used to work but no longer does.

For all you guys that are still not working AFTER installin NGINX addon.

Installation of NGINX objective is to keep ssl interface with HA from outside your LAN while you keep plain http from inside.

So, after installing the addon you need also to configure your config yaml to get the internal communications without ssl encryption and change the base url of the tts from the external address to the internal one (http://192.168.0.X:8123)

So yours must look like this:

Hope it helps!

1 Like


If you go to “Developer Tools” → “Service” → choose you tts-google service and mediaplayer and add some text. Then hit “Call Service”.

Go to the log and see that HA says.

@Mr.H.99, great post, thx :slight_smile: do you have these port-forwards?
Public port → local port
80 → 80
443 - > 443
8123 → 8123

Hi mdok,

NGINX configuration needs port forwarding in the router.

Mine is

80 → 80
81 → 81
443 → 443

So to acces HA from outside now I not set the port and only like:

1 Like

I got mine working by simply reflashing HA to a new SD and starting again, not restoring any backups/snapshots, rebuild everything from scratch.

@MickW69 do you have installed DuckDNS addon and have added the ssl certificate lines to the configuration.yaml?

This is the key point. DuckDNS includes the option to move to an https interface, and here comes the issue with the dns missmatch handshake error.

If you can access through http to your fresh install this is why you don’t have any issues now.

I had been using Nabu casa before and after the problem, I kinda figured that I wasn’t “supposed to” need DuckDNS or anything to get it working