Google assistant voice command and hubitat

It is a way to ask to google assistant custom questions like:


  • I am testing a virtual sensor presence that I am able to populate with information like "I have mail in the mailbox or not" I will like to ask my google assistant "Do I have mail?"
  • I am working in a room and the bathroom is on the other side of the house. "Is the bathroom free?"
  • I live in a 2 family storehouse. And we share the garage, due to covid, I try to cross with my neighbor the less possible (Wonderfull people but I don't want anyone to feel uncomfortable on indoor spaces) I would like to ask google. "It is someone in the garage?"

I did try to create a new routine, but not sure how to proceed.

Updated: I started the question with a very bad example: Ask google home if someone is at the door, So I remove this example and add better situations.

I use Amazon Alexa rather than Google Home.

I know I can use the link between Alexa and Hubitat to pole the status of a sensor. Thus, I would think that something similar is possible with Google Home. However, I am too new to Hubitat to be able to advise you on the method.

However, if you are really concerned about someone being at the front door, you might be better off having the sensor alert you anytime someone is at the front door using the TTS capability of the Chromecast (beta) integration. I understand that it can work with Google Home as well as Chromecast devices.

I do something similar using an older Aeotec Doorbell with custom alert files. When my wife is away and returns to the house, the Smartthings presence sensor on her key chain connects to Hubitat and the Aeotec doorbell anounces "Jean has returned home." That is a lot more user friendly than having to ask "Is that Jean at the door?"

1 Like

Thanks, @rwclements228! You are complete right, I have a similar setup.
But I think I wrote a bad example.
I updated the question description with better examples.

You can write a Rule Machine rule that checks to see if a motion sensor is active.

But as far as speaking on the Google devices, I'm going to give it to you straight and people can scream and cry all they want, but it's the truth. Google's ability to do that without extra software, sucks!
If you setup a separate server that runs CASTWEB API, then yes, you can with decent reliability, get it to speak messages to you on a specific Google device, in the official Google assistant voice. Or if you install Google Assistant Relay on a separate server, you can get a broadcast message on all of your Google devices at once, but you cannot send the message to only a single device. If Google would stop being such jerks and just let you trigger a Google Assistant routine with at least a contact sensor or a motion sensor, then you wouldn't need a separate server to do this semi-reliably.

Want to solve the problem for $25 USD? Buy an Echo Dot. Amazon Echo devices let you trigger an Alexa routine with contact sensor or a motion sensor. So with a few lines of simple code on your hub, you can turn on a switch, and Alexa will think a motion sensor triggered, which will activate the Alexa routine and it will say whatever you want it to say, on any of your Alexa devices. No extra server needed, and it works very consistently.

To automate this, do the following

Create a virtual switch that turns off after 1 second (you can set the auto-off in the virtual switch device details). This will be the trigger for your rule to test the conditions. When you ask google "Is someone in the garage?", it should turn on this switch.

[Garage Status] Changed

IF [Garage Status] ON AND
[Garage Motion Sensor] ACTIVE

Speak the message 'The Garage is Occupied' <- If using Alexa, you will instead turn on the switch here that makes it think a motion sensor has triggered

ELSE-IF [Garage Status] ON AND
[Garage Motion Sensor] INACTIVE
Speak the message 'The Garage is Clear' <- If using Alexa, you will instead turn on the other switch here that makes it think a motion sensor has triggered

1 Like

Thanks, @SmartHomePrimer
The "switch" bit was what I need it. I create the virtual switch, exposed it to google home, and turn it on with a routine.
I am using "Chromecast Integration (beta)" to send a message to a specific Chromecast. So It is not great because I don't respond in the same Chromecast that I ask, but it is the first step.

You'll find it doesn't always work too. I set it up just to test, and it only makes a sound like it's going to announce something, but then it doesn't. I have CASTWEB API running (and Google Assistant Relay too actually), and that works almost every time. But I only use it for a mini in the basement. All my announcements around the house are Alexa.

Don't see any reason you shouldn't be able to speak it from the same device Google device you ask from, but I’m using CASTWEB API, so I guess it’s different.

1 Like

I have the opposite experience. I am using the "Chromecast beta App," and it always works fine. I dislike that after saying the message is in cast mode for a minute, but not a big deal.
With relay my problem that my user auth lasts only for 2 weeks, So I need to reset the credential constantly. I am using the 3.3.2b, so I am not sure if it is the new auth method or I am doing something wrong. I will investigate; I didn't invest much time.

When I say:

So It is not great because I don't respond in the same Chromecast that I ask, but it is the first step.

I am referring that all my Chromecast listen to the routine and act on it. But when I send the communication back from habitat, I send it only to one of them. I don't want to do a broadcast and send it to all devices.
The perfect scenario is, If I ask in the kitchen, the kitchen device responds, but if I ask in the bedroom Chromecast, the bedroom Chromecast responds. But step by step :slight_smile:

Thanks again for all the help!!!

Also didn't know about CASTWEB API, I will investigate!!! Looks cool

1 Like

Yes, that is how you can make an announcement come out on a specific device. I don't think google has "only the device I speak to" type automation. Amazon does.