TTS.Google_Say - Can't Hear Any Announcement

I’m not an expert, but my configuration file works and looks like this:

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'

I don’t know anything about the developer tools and perhaps they do formatting differently. Mine is in my Configuration.yaml file and as you can see doesn’t have the curly brackets and uses single quote marks etc.

Yeah, I’ll try it in an automation and see if the result is the same. The reason I had to use JSON in the developer tools is because they just give you one line for the data and I don’t think I could do any kind of yaml there.

But I would like to figure out if anyone is getting it to work from the developer tools and what you enter into the input fields.

Hi @brucehvn , I was in the same boat as you 10 minutes ago.
It seems there was a problem with Google TTS platform but it has been solved in 0.83.2 as confirmed in this thread.
I didn’t want to update to a new version yet so I applied the patch mentioned here.
The next step was to enter in the developers tools this JSON (no message inside data, just message alone):

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

and everything was fine. Good luck!

Thanks timseebeck. I upgraded to 0.83.2 and indeed it does work now, though I have to use the JSON format you describe which seems odd.

Using it in automations worked even before the upgrade, but did (and does) require the documented format (message inside data)

I had one quirk which also seems to be fixed by the 0.83.2 update. I have a speaker group that I created in the Google Home app which includes all 4 of my google home devices. When I had an automation that was supposed to announce on that media player, the first message would never be announced, though I would see the media player in the home screen come alive and say “playing”. A subsequent attempt to put a second message through would speak normally. The same was true just trying it through the UI, opening that media player, and typing in the text to say. The first message would not be heard, but the next message would. But so far it’s working now with 0.83.2

Potential explanation to random playing messages?

Anyway, glad the update solved it! Happy HASSing!

If you want to integrate the fix that was made for 0.83, it’s super simple. Just edit “/lib/python3.5/site-packages/homeassistant/components/tts/google.py” under your home assistant install directory, and change “1.1.2” to “1.1.3”. That’s it.

https://github.com/home-assistant/home-assistant/commit/fcdb25eb3c8197c3b8c6f9c4637d7c34a056d467#diff-6197ea884e45903cb72208965bfa19ba

1 Like

Guess I spoke too soon. There is still some weirdness when trying to play to the media_player.all_google_homes from an automation. Even with the cached file there, GH chimes, but the text doesn’t come through. Much like what the OP was posting. Putting multiple service calls in the automation, each targeting a specific GH seems to work ok.

I just did the update to 0.83.2 and on the web front end, I open the card for the Google Home Mini in the office and enter some text.

Other than the beep, I don’t get the text played.

I tried emptying my TTS folder and trying again, but no luck. I did a refresh of the TTS folder and no files showing after the 2 attempts following the deletion of the old files, if that helps.

EDIT: Solved

The issue was my security certificates. It had expired and when I tried to manually renew, it didn’t work.

I followed these instructions and my system was still having issues with the certificates.

Further investigations found that although I followed the instructions where it said:

Our Home Assistant user needs access to files within the letsencrypt folder, so issue the following commands to change the permissions.

$ sudo chmod 755 /etc/letsencrypt/live/
$ sudo chmod 755 /etc/letsencrypt/archive/

I was still getting errors until another forum user in another thread suggested running the following:

$ sudo chmod 755 /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem

Once I did that, I wasn’t getting errors on restart, nor did the HTTPS part in my web address become red and double scored through, and TTS began working again.

1 Like

Hi all

I know this is an old thread, but I’m getting the same issue, but with Hassio.

I have the DuckDNS addon which includes also LetsEncrypt.

In Hassio there is no /etc/letsencrypt folder and the pem files are in the ssl folder.

I’ve set both folder and files with chmod 755, but if I’m in https the tts.google_say does not work, if I am in http all is ok.

In Hassio what should I have to do?

Thanks

Hi,
have you solved your problem?
I have same issues with google home tts and ssl…

Nope.
I’m using nodered now to have Google speak.
Easy with no hassle

1 Like

By chance, did you modify your base URL somewhere along the line?

I configured SSL and set the base URL to my DuckDNS domain name, but had to change it to my local IP to authenticate with another vendor’s site. That broke parts of Google authentication. Fortunately, I was able to change the base URL back after I got an authentication key from the other vendor so everything works again.

1 Like

Solved!

I changed back the base url from ip to the duckdns domain, and it’s working now.
Thank you!

2 Likes

Would you mind giving some explanation on the NodeRed sollution?
I am new to NodeRed.
I have set up a flow for TTS but is gives me the same result. I hear the chime, but no voice.
Aantekening%202019-06-10%20200334

I would really like to make TTS work.

This is in the debug.

{"domain":"tts","service":"google_say","data":{"entity_id":"media_player.googlehome6684","message":"test"}}

I’m not using the HA service in Node red.
I’m using the node node-red-contrib-cast
It’s simpler for me.

1 Like

Hey guys,

Is there any line I can add to my current TTS announcements which will preset the volume level on my google home/mini?

Currently announcements are being played at the volume level the last use of the Home/mini was used at. In my case, I have the volume set at 10% to play music on a sleep timer going to bed, but this means that if it announces that there’s someone outside, I don’t hear it. I only am aware that my motion sensor was tripped because the bedroom light is turned on.

My current configuration reads:

  - alias: 'Someone At The Front Door Nighttime'
    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: '20:00:00'
        before: '08:00:00'
      # Text to Speech
    action:
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
    #   entity_id: light.yeelight_bedside_7811dc9201bd 
        entity_id: light.yeelight_bslamp1_7811dc9201bd
        data:
          brightness: 200
          color_name: Red                 

Thanks in advance.

Sure is, something like this you’ll need to add:

  - service: media_player.volume_set
    data_template:
       entity_id: media_player.nighttime_doorbell
       volume_level: 0.7 # 70% volume
1 Like

Thank you so much

Edit:

I got home and put it in my configuration file as follows (changing level to 50%):

  - alias: 'Someone At The Front Door Nighttime'
    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: '20:00:00'
        before: '08:00:00'
      # Text to Speech
    action:
      - service: media_player.volume_set
        data_template:
        entity_id: media_player.nighttime_doorbell
        volume_level: 0.5
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
    #   entity_id: light.yeelight_bedside_7811dc9201bd 
        entity_id: light.yeelight_bslamp1_7811dc9201bd
        data:
          brightness: 200
          color_name: Red

When I look at the config checker, it says:

Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][0]['data_template']. Got None
extra keys not allowed @ data['action'][0]['volume_level']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 253). Please check the docs at https://home-assistant.io/components/automation/

Line 253 in my Notepad++ is where the word “Automation” starts. The whole “automation” section reads:

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'
    # Bedroom Light On - Red at Full Brightness
#      - service: light.turn_on
#        entity_id: light.yeelight_bedside_7811dc9201bd 
#        data:
#           brightness: 254
#           color_name: Red
  - alias: 'Someone At The Front Door Nighttime'
    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: '20:00:00'
        before: '08:00:00'
      # Text to Speech
    action:
      - service: media_player.volume_set
        data_template:
        entity_id: media_player.nighttime_doorbell
        volume_level: 0.5
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
    #   entity_id: light.yeelight_bedside_7811dc9201bd 
        entity_id: light.yeelight_bslamp1_7811dc9201bd
        data:
          brightness: 200
          color_name: Red                 
  - alias: 'Auto Renew SSL Cert'
    trigger:
      platform: numeric_state
      entity_id: sensor.ssl_cert_expiry
      below: 29
    action:
      service: shell_command.renew_ssl   
# !include automations.yaml

With the 4 lines hashed the config checker comes back as:

Configuration valid!

I finally figured out where my issue was. I actually needed to start those 4 lines with a line saying “Action:”, so the whole nighttime section now reads:

  - alias: 'Someone At The Front Door Nighttime'
    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: '20:00:00'
        before: '08:00:00'
      # Text to Speech
    action:
      - service: media_player.volume_set
        data_template:
        entity_id: media_player.nighttime_doorbell
        volume_level: 0.5
    action:
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
    #   entity_id: light.yeelight_bedside_7811dc9201bd 
        entity_id: light.yeelight_bslamp1_7811dc9201bd
        data:
          brightness: 200
          color_name: Red

I thought I might mention it in case someone else was wanting to adjust the volume, came here and added the 4 lines and got config errors like me.

TBH, I’m quite chuffed I figured out what the issue was. Pity it took me over an hour :slightly_smiling_face:

EDIT: I spoke too soon. I just went and manually triggered it after setting my GH minis to 10% and the sound stays at 10% when it plays the message.

I’ll see if I can get it to work tomorrow. It’s time for bed :slight_smile:

EDIT - 23rd June 2019

Okay, I got it changing the volume. What I needed was a “data” line, rather than “data_template”. - see Volume_set not working

The only issue is that because media_player.nighttime_doorbell is a group of 2 Google Home Mini’s, the volume isn’t being set to 50% on each. It seems to be 100% divided between the 2. Using my phone to trigger the automation, my experiment shows the following:

Bedroom Mini . . . . . . . . Loungeroom Mini
10% . . . . . . . . . . . . . . … . . . . . 10% (starting volume)
55% . . . . . . . . . . . . . . … . . . . . 45% (after 1st trigger)
55% . . . . . . . . . . . . . . … . . . . . 45% (after 2nd trigger)
Set loungeroom Mini to 10% (left bedroom to 55%)
73% . . . . . . . . . . . . . . … . . . . . 27% (after 3rd trigger)
Set Bedroom Mini to 10% (left loungeroom at 27%)
41% . . . . . . . . . . . . . . … . . . . . 59% (after 4th trigger)

It looks like I’m going to have to use the individual entity ID’s for the 2 GH mini’s. The following now works as it sets the volume level on the 2 minis individually and then plays the message to the group:

  - alias: 'Someone At The Front Door Nighttime'
    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: '20:00:00'
        before: '08:00:00'
      # Text to Speech
    action:
      - service: media_player.volume_set
        data:
          entity_id: media_player.master_bedroom_speaker
          volume_level: 0.5
      - service: media_player.volume_set
        data:
          entity_id: media_player.living_room_mini
          volume_level: 0.5
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
        entity_id: light.yeelight_bslamp1_7811dc9201bd
        data:
          brightness: 200
          color_name: Red

Thanks for everyone’s help. Greatly appreciated.

2 Likes

Hi. Can you to post the tts section from configuration.yaml? Thanks

> tts:
>   - platform: google_translate
>     service_name: google_say
1 Like