Google Home TTS not working DuckDNS & Lets Encrypt

Hi

Since I have setup DuckDNS and Lets Encrypt that is https://something.duckdns.org/states and port forwarding for example -> 9999 to 8123 the Google Home TTS does not work either directly through the UI Google Home media player on the states screen ‘Text to Speak’ or automation. Everything was working fine before, I have 3 Google Homes, I have tried each one separately same outcome.

Anyone know why this has happened?

I am currently running 0.58.1 HASSIO inside docker.
Edit: I upgraded to 0.60 to see if this would fix but still the same no text to speech !!

I can successfully access https://something.duckdns.org/states from my internal network 192.168.1.x and also from external via https://something.duckdns.org:9999 all good but Google Home not doing text to speech.

I have noticed that the actual text I typed into ‘Text to Speak’ is saved as .mp3 in the tts folder so not sure why Google Home cannot just say it ??

Everything else works via the UI Google Home Media Player on States screen increase / decrease volume, play / stream music to Google home no problem just not text to speech.

My config.yaml below:

# Text to speech
tts:
  - platform: google
    language: 'en-uk'
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300
1 Like

Having the same issue after recently switching over to Docker and securing it behind a nginx reverse proxy… If anyone has suggestions to try, happy to test them out.

check your base_url in http platform

in your base_url has to specific the port as well.
base_url: https://domain.duckdns.org:9999 <=== has to put port you use for your HA because tts read from base_url. After you put like this you can tts from internal and external.

I tried that and still no luck. I can see the .mp3 files stored in the /tts folder but there’s no tts function actually working on any of the Google Home devices.

I’m not doing anything with automation or templates to keep things simple and just trying to send TTS directly through the HA front end.

I’ve tried a number of configurations for the base_url and restarted HA after each attempt:

https://example.duckdns.org
https://example.duckdns.org:xxxx
example.duckdns.org:xxxx

HA logs don’t reveal any errors.

What do you use for your TTS? Can you show your config.

One thing I just had to do was ensure that I had public 8123 port forwarding to my hassio 8123 since it was in the base URL. Without that my google home was making a chime but not saying the message.

2 Likes

Trying to use Google TTS.

config.yaml:

http:
  base_url: example.duckdns.org

tts:
  - platform: google

I can use. Thanks for reply.

Hey Sunonline, did you have any success with this? I’ve tried everything I’ve read and know of and still no luck…

Yes. I can use tts google.

my config is as on post #3

tts:
  - platform: google
    cache: true
    language: 'en-uk'  <=== google support many languages, you can check the language you want and put here.
    cache_dir: /tmp/tts
    time_memory: 300

by putting like this I can text to speech from outside network to inside network

http:
  base_url: https://domainname.duckdns.org:8123  <=== google tts work with or without let's encrypt. but if you have let's encrypt your base url will be start with https and need ssl_cert, ssk_key clarify
  api_password: YOUR_PASSWORD
  ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem
  ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem

thanks gureyes, I tried that but the docker container doesn’t seem to be working on Intel NUC. From what I’ve read, I think the error is related to incompatibility with architecture

standard_init_linux.go:195: exec user process caused "exec format error"

have same problem, anyone have solution for this.
Tried @Sunonline suggestion with no luck

what do you use for your media_player?

I use vlc as media_player. after install vlc. I also ssh to allow homeassistant(username_for_homeassistant) to be able to use audio “sudo usermod -a -G audio homeassistant
3.5 mm jack to rpi3.

setting this under media_player platform

  - platform: vlc
    name: HA Speaker
    arguments: '--alsa-audio-device=hw:0,0'  <=== use ssh type "aplay -L" to see the hw use and subdevice use

setting this under tts platform

  - platform: google
    language: 'en-uk'  <== you can use language you want. check from google
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300

setting this under http platform

  base_url: https://domain.duckdns.org:8123 <== a must with homeassitant port
  api_password: homeassistant_password
  ssl_certificate: where_ever/your/sslcert/located/fullchain.pem
  ssl_key: where_ever/your/sslcert/located/privkey.pem

if you don’t use let’s encrypt

  base_url: http://domain.duckdns.org:8123 <== a must with homeassitant port
  api_password: homeassistant_password

Thank you @Sunonline
I use VLC as media_player. Tested it with other audio source and it worked.
Also added “sudo usermod -a -G audio homeassistant”
When I run systemctl status homeassistant. It said “serving …mp3 file to <my external ip> (Auth: false)” instead of my https://domain.duckdns.org
My current setup forwarded port 443 to 8123, also tried forward 8123 to 8123, nothing works

did you use ssl? if yes you have to provide with ssl_certificate and key.

Forward port at your router 443 to 8123 and 8123 to 8123 as well.

at http you don’t need server_port: because you already put port at the back of base_url

If possilble please show the config of http and tts google

regarding the ssh sudo usermod -a -G audio homeassistant <== the homeassistant is the username you run homeassistant. some people use pi or other name so put the right username for homeassistant as tts run from user that run homeassistant.

for tts google setting.

  - platform: google
    language: 'en-uk'  <== you can use language you want. check from google
    cache: true
    cache_dir: /tmp/tts  <== you have to create folder name tts inside homeassistant config folder. It won't create by themself.
    time_memory: 300
 http:
  # Secrets are defined in the file secrets.yaml
  api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  base_url: https://xxxhome.duckdns.org:8123
  ssl_certificate: /etc/letsencrypt/live/xxxhome.duckdns.org/fullchain.pem
  ssl_key: /etc/letsencrypt/live/xxxhome.duckdns.org/privkey.pem
# Text to speech
tts:
  - platform: google
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300

Here it is. homeassistant is username used to run HA

Can you try put the language inside your tts google and also create a folder name tts in homeassitant config folder.

list of support language
‘af’, ‘sq’, ‘ar’, ‘hy’, ‘bn’, ‘ca’, ‘zh’, ‘zh-cn’, ‘zh-tw’, ‘zh-yue’,
‘hr’, ‘cs’, ‘da’, ‘nl’, ‘en’, ‘en-au’, ‘en-uk’, ‘en-us’, ‘eo’, ‘fi’,
‘fr’, ‘de’, ‘el’, ‘hi’, ‘hu’, ‘is’, ‘id’, ‘it’, ‘ja’, ‘ko’, ‘la’, ‘lv’,
‘mk’, ‘no’, ‘pl’, ‘pt’, ‘pt-br’, ‘ro’, ‘ru’, ‘sr’, ‘sk’, ‘es’, ‘es-es’,
‘es-us’, ‘sw’, ‘sv’, ‘ta’, ‘th’, ‘tr’, ‘vi’, ‘cy’, ‘uk’,

Don’t forget to check config and restart homeassistant

tts folder already existed. I can found mp3 there and play it. But not in VLC

when you test vlc to run mp3. what user are you using?
You mention from above post Tested it with other audio source and it worked. <== you mean also cannot run mp3?