TTS.Google_Say - Can't Hear Any Announcement

Hi Guys

I have an action which reads as follows:

action:
      - service: tts.google_say
        entity_id: media_player.whole_house_doorbell
        data:
          message: 'Motion Detected At The Front Door'

This was part of my “alarm” where if the front door motion sensor tripped, it would turn on my bedroom lamp and make the announcement.

Lately I’ve seen my light go on but never heard anything, and put it down to me missing the announcement.

I’ve just sat down at the PC and gone into the front end and into the automation and manually hit the “Trigger”. I get the Google Mini beeping as if it’s about to make the announcement but nothing is said.

I’ve then gone into the actual mini on the front end and went to the TTS section and typed something and once again, can’t hear anything. Volume is turned up.

Is there a current issue with TTS?

Thanks in advance.

1 Like

Hmm! Just checked and I have the same issue.

Solution here:

1 Like

Have any of you experiencing this problem recently set your ‘base_url’ parameter in configuration.yaml to set up webhooks or IFTTT integration? I had this issue when I did that. I had to set the ‘base_url’ option under the TTS config to point back to my internal IP since the media has to be accessible to the cast devices.

It’s all described here: https://www.home-assistant.io/components/tts/

2 Likes

Nope. That wasn’t my problem.

In this same vein, can you look in your $/config/tts folder, and find the cached TTS media files? Then use one of those file names in a browser and see if you can successfully load this URL:

[Home Assistant Instance]/api/tts_proxy/[TTS Media File name]

If you can’t hit it from the same network your cast devices are on, then there’s your problem.

In my case, it was working and no modifications were made to my yaml file (I don’t know anything about base_url) so I don’t know why it suddenly stopped working.

The mp3 file plays fine or if I copy and paste the path and filename into Chrome browser.

eg

file://hassbian/homeassistant/tts/8e17028ed0713ce84f2cc06fe9cde75e169f981e_en_-_google.mp3

It will cast using HTTP though. You need to try it from http://hass.local:8123/api/tts_proxy/blah blah blah.

1 Like

I used:

https://192.168.178.122:8123/api/tts_proxy/8e17028ed0713ce84f2cc06fe9cde75e169f981e_en_-_google.mp3

and it plays.

Is this the path you meant?

Yeah. That’s what I meant. If that’s not working, then I got nothing. Seems like it’s generating the speech MP3. I guess the next step is seeing if you can cast that mp3 to your media_player.

Hit the dev services page and try this:

1 Like

In case others stumble across this posting - note that if your base_url is https, you cannot use an IP address since the SSL certificate isn’t good for the IP address. You’ll need to figure out how to enable hairpin NAT on your router.

This is all over my head as I’m not a programmer. All I know is back when I originally added in the automation script, it worked and worked fine for weeks but now it doesn’t and I haven’t made any changes to that part of the configuration.yaml file (automation)

Do you mean the address I have my web front end pointing to? Currently it’s https://192.168.178.122:8123/states

Not sure where the IP addresses are that you are talking about. My automation script reads as follows:

automation: 
  - alias: 'Someone At The Front Door Daytime'
    trigger:
      platform: template
      value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'
    # The Condition Syntax from https://www.home-assistant.io/docs/scripts/conditions/
    condition:
      condition: time
      # At least one of the following is required.
      after: '08:00:00'
      before: '20:00:00'
      # Text to Speech
    action:
      - service: tts.google_say
        entity_id: media_player.whole_house_doorbell
        data:
          message: 'Motion Detected At The Front Door' 

If I go to the web front end, click on the 3 dot menu for “Whole House Doorbell” and enter some test text, the Google Home and Minis chime, but then nothing is heard. I’ve even tried this on my “Office Speaker” in case it was an issue with the “group” of GH/GHM’s. Once again, it chimes once as it becomes the active speaker but nothing.

I’ve also just upgraded to 0.82.0 but it hasn’t made any difference. I did notice that in my PuTTY window it said

You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

When I type “pip install --upgrade pip” at the command line it says “-bash: pip: command not found”

Cheers
Max

I’ve been having the same issue. Not sure why it happened though. My TTS script has been working for at least 8 months and all of a sudden it stopped working.

This is the script that I’m using:

speech_processing:
  alias: Speech processor (text-to-speech)
  sequence:
    - service: media_player.turn_on
      data:
        entity_id: media_player.squeezebox
    - service: media_player.volume_set
      data_template:
        entity_id: media_player.squeezebox
        volume_level: !include ../templates/volume_level.yaml

    # Play the announcement sound.

    - service: media_player.play_media
      data:
        entity_id: media_player.squeezebox
        media_content_id: !secret sound.announcement
        media_content_type: audio/mp3
    - delay: >-
        {% set duration = states.media_player.squeezebox.attributes.media_duration %}
        {% if duration > 0 %}
          {% set duration = duration - 1 %}
        {% endif %}
        {% set seconds = duration % 60 %}
        {% set minutes = (duration / 60) | int % 60 %}
        {% set hours = (duration / 3600) | int %}
        {{ '{:0>2}:{:0>2}:{:0>2}'.format(hours, minutes, seconds) }}

    # Play the text-to-speech message.

    - service: tts.google_say
      data_template:
        entity_id: media_player.squeezebox
        message: >
          speech_message

    # Turn off the Squeezebox when it is done playing the text-to-speech message.

    - wait_template: "{{ states.media_player.squeezebox.state == 'idle' }}"
    - service: media_player.turn_off
      data:
        entity_id: media_player.squeezebox

I’ve checked everything. The volume is up. It successfully plays the announcement mp3 file (which is a simple chime; also, there is sound here!), the squeezebox than ‘plays’ the google say mp3, but there is no sound!

I’ve even simplified my script to only contain the tts.google_say call and tried to do the same thing from the /dev-service page in Home Assistant. Both didn’t work.

When I grab the URL to the mp3 file and paste it in a browser, it does play fine. So, the mp3 is generated correctly. I also know that my speaker is working fine, since I can play anything on it except for mp3’s generated by tts.google_say.

I’m btw using Duck DNS together with Let’s Encrypt so I have SSL enabled. I’m also on the latest Home Assistant version 0.82.0.

Edit:

This is btw my TTS configuration:

tts:
  - platform: google
    cache_dir: /tmp/tts
    language: 'nl'

And I do have base_url set in the http configuration.

I don’t know if it’s related or not but I can open the Home Assistant app on my phone and it looks fine.

If I click the 3-line menu bar at the top left and choose “Load Web UI” it tries to load the duckdns address eg MyHome.duckdns.org:8123, but it says “Unable to connect to Home Assistant”.

If I open a command window on my windows PC and ping MyHome.duckdns.org, I get the same IP address as https://www.whatismyip.com/ shows me.

The weird thing is that in the app (which is working), when you click the 3 bar menu icon in the top left to expose the menu, the very top shows https://MyHome.duckdns.org:8123 so if there was an issue with the address, the icons wouldn’t work.

As for TTS via the app, if I click on the “office” speaker, the GHM in my office chimes as it becomes “alive” but the text isn’t heard.

I wonder if it has anything to do with now needing to pay a monthly fee (I have never understood what a “free” user doesn’t get compared to a subscription user).

Same thing here.

Wait, you now need to pay for Google Translate (TTS) as well? I thought it was only for Maps, etc.

I just tried a simplified TTS script and noticed the following in my log:

[homeassi
stant.components.http.view] Serving /api/tts_proxy/0db21e1f678c7f39c20e0cef0b56da9fc7a0cf3
4_nl_-_google.mp3 to <ip_address> (auth: False)

Not sure whether the (auth: False) was always there, but for other calls I see (auth: True). Maybe this has something to do with the new auth providers? I’m using Duck DNS and SSL. I have no clue whether this has something to do with the issue, just putting this out there.

So, I just removed the ssl_certificate and ssl_key attributes from the http config and TTS seems to work again.

This might be an issue with my Squeezebox speaker. I’m using a Logitech Media Server to connect to that speaker. I did upgrade that server to the latest version recently, so perhaps that doesn’t work well with SSL / Google. It’s weird though, since it worked perfectly for months.

I hashed out those 2 lines so mine now reads:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  api_password: NotForAnyoneToKnow
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # ssl_certificate: /home/homeassistant/dehydrated/certs/myhome.duckdns.org/fullchain.pem
  # ssl_key: /home/homeassistant/dehydrated/certs/myhome.duckdns.org/privkey.pem
  base_url: myhome.duckdns.org:8123

but after I restart the services, my webpage pointing to https://192.168.178.122:8123/states now displays the message:

# This site can’t provide a secure connection

**192.168.178.122**  sent an invalid response.

* [Try running Windows Network Diagnostics](javascript:diagnoseErrors()).

ERR_SSL_PROTOCOL_ERROR

If I change the web address from https to http, I get my login screen. If I log into that, then I can open one of my GH units eg Office, and TTS works.

What I’m talking about is the card that reads:

It looks like your Home Assistant Cloud subscription has expired. Please check your account page to continue to use the service.

The reason I’m confused is that it says:

With the Google Assistant integration for Home Assistant Cloud you’ll be able to control all your Home Assistant devices via any Google Assistant-enabled device.

I gather that means I can voice control (using my GH/GHM’s) things like my Yeelight lamp.

In that case, I can still do this, so I’m unsure what a subscription does for me. $60 per year isn’t much but I don’t know what that gives me. Perhaps it means I can use encryption and have a HTTPS address but since I don’t currently pay, I can’t use HTTPS and that’s why TTS only works via HTTP and this would only work (I guess) for when I type something into TTS from a web page but not for a scripted response (eg “Someone at the front door”).

Ah ok, I’m not using Home Assistant Cloud at all, so can’t help you with that.

I just bought a Google Home Mini and started using that as my TTS speaker, which works fine. No problems at all with SSL.

I’m not using my Logitech Squeezebox speaker at the moment, since it still doesn’t work with SSL. I would still love to use it though, so that I can broadcast to both my Squeezebox and Google Home Mini. Really hoping someone has a solution.

Ironically last night when I asked Google Mini to turn off my bedside lamp (Yeelight Lamp) it said an error occurred.

Edit: My Mi Home app shows the lamp as offline.

I’m just setting up the tts for the first time, but I think I’m having the same problem. My HA is setup using https and the google assistant integration seems to work fine. BTW, I’m not using the subscription service. I setup the GA integration manually following the instructions. I can control my devices with no problem. If I go to one of the GH media player devices and click the 3 dots, I can type in text in the “tts” input field and that works fine as well. But if I go to the main page and click on the services button under developer tools and fill out the fields like this:

Service Name: tts.google_say
Service Data:

{
  "entity_id": "media_player.upstairs",
  "data": {
    "message": "testing one, two, three"
  }
}

I see the popup in the lower left say “service tty.google_say called”, but nothing comes out of the speaker. My JSON above has been formatted for easy viewing, but in the input field, it’s all on one line.

If I’m trying to call it from the developer tools, is there a different way to specify it?

I haven’t actually tried it from an automation yet. I wanted to see it work from a manual call first.