Is there a way to have Google Assistant broadcast to the house when I have arrived home automatically?

Is there a way to setup an automation that says when I arrive home tell the Google Home speakers in the house to announce I have arrived automatically? Not sure if this is possible. Thanks!

Sure it’s possible. As long as you have a sensor that can tell promptly when you arrive home.

Have you integrated the google home speakers with the google cast integration and also set up ping or any other presence detection? If you have its simple. If not we have to start from that first.

I think I have the google home speakers and cast along with life360 for presence detection.

By the way you also have to integrate tts to HA, see https://www.home-assistant.io/integrations/tts/

Then its simple. Go to configurations>automations>Add automation>start with empty

Start with giving it a name and then in trigger type tab, select state. Then in the entity tab select life360 device and set “to” state to home.

In the actions tab, select action type as call service. Then in service tab select tts. and in the data put something like this…

entity_id: media_player.google_speaker
message: 'May the Force be with you'.

This is just an outline, hope you can work it out. If anything please ask

A tip, to get precise presence detection, you can set up a ping binary sensor with a low scan_interval so that as soon as you connect to the wifi of your home, your presence can be detected.

Life360 sounds location based. Usually those decide I’m home when i’m still approaching my house so it’ll probably announce your arrival while you’re still driving/walking/biking. Triggering off when your phone connects to your home wifi is a closer approximation but even that event fires while I’m still in my driveway for me.

If you want it to be as you walk in its got to be pretty precise. For me personally the way I’ve approximated that is looking for the door unlock event after someone has arrived home when no one was home before. I use that as a trigger to play christmas music around the holidays lol.

2 Likes

I’ve tried to set this up but whenever I click save and then go back to the automation editor, the service data is blank as if it didn’t save. Not sure what’s going on.

Please try to edit the automation in yaml and then save it. Also try calling the service from developer console to check that if service data is valid

The speaker doesn’t speak anything. It is just making a chime sound. Do I have my configuration.yaml set up correctly?

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

# Text to speech
tts:
  - platform: google_translate

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

Try giving a service name like this so that the service appears ass tts.google_say.

tts:
  - platform: google_translate
    service_name: google_say

Then try the tts.google_say service from developer console with the followinf payload

entity_id: <your_google_home_speaker>
message: 'May the Force be with you'.

Make sure you use the correct entity id

One thing I’m noticing is when I go to overview and click on one of the media player speakers and type in where it says text to speak, the speaker does not actually speak anything. I am using duck DNS on my system, not sure if that would get in the way or not. Any ideas?

I dont think duck dns has any role to play with this. Try calling what I have said from the developer console, I strongly believe that it might not work. Are you running node red?

I am not running node red. When I try it from developer tools, all I get from the speaker is a ding, no actual text spoken.

Ding means that the speakers are online and your tts component has some issues.

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

use this config and please set the correct base url.

I was getting an error in the log that said the IP wasn’t reachable so I switched to the external IP that is used with Duck DNS and that error is not showing in the logs but the speaker is still not speaking any text. Not really sure what is going on.

Check out these thread TTS with SSL on & Google assistant not speaking via tts It explains how this happens and possible solutions for tts.

Are you able to play mp3 with google home from HA? If this is possible we can create an mp3 and store it locally and play as an announcement.

The best way to do your announcements is with Assistant Relay. It even lets music pause and resume before and after an announcement.