Google Mini TTS Not Working

First of all, I’m using HA version 2020.12.1

I’m trying to set up an automation so that if my front door is opened, my google mini will be used as a speaker to announce “Front door open.” Here is the YAML for this automation:

alias: Front Door Is Open
description: ''
trigger:
  - type: opened
    platform: device
    device_id: 53f6af13cbda70d835701c3b5079ca5d
    entity_id: binary_sensor.front_door_contact
    domain: binary_sensor
condition: []
action:
  - service: tts.google_say
    data:
      entity_id: media_player.bathroom
      message: Front door open
mode: single

No matter how many times I execute this, the google mini doesn’t do anything. So I tried to manually use TTS and that also didn’t do anything. Do I have something set wrong in my configuration files?

homeassistant:
  name: Home
  latitude: mylatitude
  longitude: mylongitude
  unit_system: imperial
  time_zone: America/Denver
  external_url: https://myha.duckdns.org
  internal_url: http://192.168.1.248:8123
  
http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate
    base_url: https://myha.duckdns:8123
    service_name: google_say

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Another thing that may be worth mentioning is that I do not have port 443 forwarded for HA. 443 is being used by my Nextcloud server so I’m just forwarding 8123 to 8123. So I have to specify the port when I try to access HA remotely.

I cannot for the life of me figure out why text to speech won’t work.

Is there any other information that I can provide that may be helpful?

Change service_name: google_say to tts.google_translate_say

I don’t need to include the tts. at the beginning do I? Then the service name will actually be tts.tts.google_translate_say.

I set it to google_translate_say and I changed my automation yaml file accordingly as well. Still no change.

No you don’t need the tts. I know a lot of people have problems with DuckDNS and Google TTS.
Here is mine, but I use Nabu Casa, so I don’t have issues…

tts:
  - platform: google_translate
    service_name: google_translate_say
    language: 'en-au'
    base_url: http://192.168.1.58:8123
1 Like

FYI, that internal_url isn’t ever going to work - you should remove it. HA is either using SSL, or not.

Do you get the expected bloop when you use the TTS service? If so the problem is probably with accessibility of the URL.

Next time you call it, look at the media player entity (in Developer Tools -> States) at the URL in the media_content_id attribute. Copy and paste that into your browser and see what you get.

I think your yaml might be slightly wrong, try this:

action:
  - service: tts.google_say
    entity_id: media_player.bathroom
    data:
    message: "Front door open"

Hi, here is one way to check whether your HA actually got the mp3 file from google translate:

In command line:

curl -X POST -H “Authorization: Bearer [token]” -H “Content-Type:application/json” -d ‘{“message”: “I am speaking now”, “platform”: “google_translate”}’ https://myha.duckdns:8123/api/tts_get_url

And the return result should be:

{“url”: “https://myha.duckdns:8123/api/tts_proxy/[some long alphanumeric string]_[language code, i.e. en]_-_google_translate.mp3”}
You should be able to play this mp3 file in any media player.

If you don’t get return result, you may have to figure out why HA is not getting to google translate.

Hope that helps.

1 Like

I got the bloop once, but never since (unless I’m just turning the media device on).

I entered the media conent id into a URL and got this error: DNS_PROBE_FINISHED_NXDOMAIN
However, the url did not have .org in between .duckdns and :8123. So I added .org and it played the google TTS sound. I am now realizing that in my configuration.yaml file, the base_url does not have .org in it. I’ll try adding that.

It’s working now. Such a simple thing to miss. Thanks!

1 Like