Help needed with getting TTS to work

Hi,

I’ve been trying to get TTS to work, in hassio, but all I get from the Google speaker when I send a message is a plink. I thought it was maybe because my connection is SSL, so I’ve added the base_url to configuration, but still get only a plink when testing through Developer Tools.

Configuration:

tts:
  - platform: google_translate
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300
    base_url: https://192.168.1.137:8123
    service_name: google_say

Screenshot from 2019-12-17 19-50-36

Base url goes in your http component and should be an externally accessible url

I have base_url in http too, but this says that because it is SSL, Google Cast devices need the server IP address in the TTS section: https://www.home-assistant.io/integrations/tts/


http:
  base_url: https://******.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

Whether it is in the TTS or not makes no difference anyway, I get a ‘plink’ either way.

With ya, so you need to remove the s from https in the base_url for the tts component.

If I do that then the server isn’t accessible, as it is SSL, i.e. to access it on my computer I need to enter HTTPS, HTTP alone will not work.

This is my configuration for http and tts:

http:
  base_url: https://******.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  # Text to speech
tts:
  - platform: google_translate
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300
    base_url: https://192.168.1.137:8123
    service_name: google_say

Yeah, that’s not going to work. The tts needs to play from a url that it can access, so if it’s SSL then the certificate needs to be validated. SSL certificates validate to names not ip addresses.

Ok, thanks, but I don’t know how to set the local IP to HTTP, whilst maintaining the external access as SSL

You’ll need to use a reverse proxy. If you’re on hassio there is a really easy to use addon…

1 Like

Thanks, but disabling SSL still results in ‘plink’ from the Google Cast device.

You’re going to need to monitor the system logs and see what url is being passed and work out how to make it the correct one for the file that is created.

I would be nice to have TTS, but not essential and it appears to be a lot of hassle to get it working. Thanks for all your help anyway.

1 Like

I’ve fixed it by doing the following:

I’m not sure if both these changes were required, but I know the second one definitely was.

  • I added the add-on Google Assistant SDK (I don’t think this was needed)

  • I commented out the http entries in configuration.yaml. I suspect this is where the problem was, as for a time I was using DuckDNS, which uses a Let’s Encrypt certificate, therefore making local access https and I think it is the SSL that was causing the problem. I no longer use DuckDNS, as I have Home Assistant Cloud.

1 Like

I know this is very old but i got around this issue by setting cache to false.

tts:
  - platform: google_translate
    cache: false
1 Like