Does Google TTS to Google Home require HA to be available off local network?

Hi, I’m new to Home Assistant. It’s been great so far. I’ve been trying to play with TTS to no avail. My installation is only available on my local network and I’m not using SSL. I am unable to use TTS on a chromecast or to any of my google home and mini units. I get no sound. I have tried by going to the relevant media player in the UI and just typing in the text. I get the wakeup ding from home units, but no speech. I can see that the speech files are properly created and play in a web browser when I use the URL to the file I see in the logs. It is using my local IP in the URL. Does Google need it to be externally accessible for this to work. My relevant config:

tts:
  - platform: google
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300

I have not set a base_url in my http: config. Althought I tried that to no avail. From the logs, the right URL seems to be sent… Thank you

1 Like

My Googling leads me to believe that the issue might be gardcoded DNS servers in the google devices. If true, my internal ip will not resolve. Might need to configure my router to force LAN devices to use my DNS. Will give that shot when I get time…

I forced all devices to use my local DNS, and that still didn’t fix the problem. I found a firewall rule on the machine that was blocking the cast devices from receiving the tts file from Home Assistant. Once I get that sorted, all was good.

So, to answer my own question you don’t need to have your files be accessible on the Internet for TTS to Google Home to work.

1 Like

Hey there newlinux. i was wondering if you could give me a hand with this. i am having the same issue. I am not sure what you meant by “the machine that was blocking the cast devices from receiving the tts file from Home Assistant”… Do you have devices filtering traffic in between HA and the cast devices? in my case i have home assistant setup on Rpi, and using google homes and minis for endpoints. I have allowed all internal traffic, and i use internal DNS so my HA locally is accessible via IP or full DNS name. I have a local domain with local DNS services…

I can control the cast devices via the HA frontend… I can power them on, and manually enter text for them to say out loud, but whenever i point to them via script and try to call tts it never works. Not sure what i am doing wrong here…

I had some firewall rules on the machine running HASS that was preventing Google for streaming the file (I have probably overcomplicated my network configs in order to add isolation and protection from IoT devices). What version of HA are you running? For a while, even after I fixed this, I believe Google introduced a change that broke TTS, but was fixed in recent versions of HA.

Thanks for responding. I am not certain. I did apply the fix for google cast python module? Whatever it is it worked, because i have restored manual TTS functionality. (It broke for awhile right after I sent the initial response to your post).

I do have a network divided into vlans for IOT and other services on my home network, so i am not sure if that is a problem. Right now though, i am not filtering or blocking traffic between the vlans. i want it open to make sure everything works before i start locking it back down.

I plan to buy few Google Home Minis for TTS via Chromecast, local only (no port opening outside).
All Google Home Minis will broadcast the TTS message at the same time. Can I do that?

Anyone using this in that way and share the config?

I use Home Assistant’s Google Translate. I don’t think it needs any specific ports to be open (cause I don’t have any).
To send TTS to multiple Google Homes I do something like:

  - service: tts.google_translate_say
    data:
      entity_id:
      - media_player.recroom_google_mini
      - media_player.gym_google_home_mini
      language: en
      message: Insert your text here

I hope this helps.

1 Like

Hello, I have just read your question, maybe that’s interesting for you. I use NodeRED and have installed this add-on. It’s very easy to set up. With this, the volume of the speech output can also be set on every device …

greetings

If using YAML, you can use the service

media_player.volume_set

to modify the volume of the Google homes.