[Alpha] Community-maintained Google Home integration

I finally figured it out. I went back through every step for it seems the 5th time, and found that when you enter "app" it wasnt saving. Once i got app to save it finally worked. Is this a google assistant only app? The locks appear in google home, but you cannot unlock or lock. This includes google assistant

No, but the Google Home app only supports a subset of the functionality available via the assistant. In theory this page lists which device types and traits the Home app supports, but Google isn't very good about keeping it updated.

I know home supports locks, since i have 3 that are wifi (also by kwikset). Its just these damn zwave through hubitat. It appears its more of an integration issue than google home. Seems like hubitat doesnt work nicely with home.

I'll look into that tomorrow. Your Kwikset locks should be using the same APIs this app uses, so I don't know why they would work and locks defined in this app wouldn't. Maybe because this app doesn't use the ReportState and notification API, but I don't see why that would make a difference. Can you post a screenshot of the screen that comes up when you long-press one of the Kwikset locks in the Home app?

I am struggling to figure out the trait(s) for my Garage Door opener. Here is what I have currently...

In the Google Home App on my iPhone it shows the garage door, but the state is wrong. (e.g. Currently it's open, but it shows closed in the GH app.)

Also, if I click on the garage door in Google Home app on iPhone, it just opens more info about the device. I'd like to be able to click the icon and have it open or close. What am I missing here?

Thanks!

This past week, devices started showing up as "starters" for Google Assistant routines in the Google Home app. Little blurb about it here.

I checked the Google Home app on my phone, and I really can add physical devices as starters and determine which action (e.g., turning a light off) should trigger a routine.

For me, lights and outlets (linked via Hue), more lights and the Xiaomi vacuum cleaner (linked via Mi Home), speakers (all of them Google/Nest products), displays (also Google Home devices), and my Nest Doorbell all show up as possible starters!

That sounded fantastic, since it should allow - together with this integration - to launch any routine or start any device that is available in Google Home, but difficult to bring into Hubitat:

  • I have a Xiaomi/Roborock vacuum cleaner that is visible in Google Home, but so far I've been reluctant to go through all of the hassle of setting up something like Mi Connector just so I can start the vacuum out of Hubitat.

  • Another scenario would be launching anything on Spotify to play on my Google Home speakers. I've been looking for ways of doing that for a while - Spotify-HE Connect by @mitchp is probably the closest I've gotten so far, but it still requires a device that can control Spotify (like a Google Home device or the Spotify app on a phone) to initialize the connection. After that has happened, Hubitat can control Spotify and I can send links for songs, albums and playlists - but it would be nice if Hubitat could initialize all of that.

  • White noise! Having Hubitat launch playback of Google Ambient sounds would be such an easy way to play back white noise of your choice on Google speakers without having to host a many-hours-long white noise sound file on your own server somewhere.

So I created a virtual switch, created an Outlet device type and added On/Off as a device trait. Everything shows up correctly, and turning the outlet on and off in Google Home flips the virtual switch in Hubitat (and vice versa).

However, the outlet doesn't show up as a starter in the Google Assistant routines. I tried to map the Hubitat switch to a light in Google Home, with the same results: it shows up, flipping it works, but it doesn't show up as a starter.

Has anyone tried this and had more success?

1 Like

I believe this is because this app doesn't push events to Google, it only responds when Google asks it about the state of a device.

There's an issue over on the GitHub repo to track implementing Google's ReportState feature so that events can be pushed to Google, but I've neglected it for a while now since there really wasn't a compelling reason for it until now. Now that devices can trigger routines it's jumped up my priority list.

5 Likes

I hope Google Home will recognize a button push or doorbell soon. That along with their new routines started by devices will make some broadcasts real handy!

Seems like virtual switches added through the built-in Hubitat GH integration can be used as starters in the GH app now. Not sure what the difference would be between those and the ones from the community app but if it's OK to run side-by-side integrations that will work for now.

is this still considered Alpha ?
just installed my Hubitat, and connected my Bali Blinds using the Generic Z-wave Shade
tested the controls from Hubitat, which do everything fine.
connected the Somfy remote, and set the basic open and close functions (as rules) just fine.
then I linked it to Google Home, and hit the exact problem you describe as the reason you created this plug-in in the first place.
I found this product via the Package Manager and installed it before finding this post.
it seemed easy, I created a device using this package
image
configured it
bali4
used what I think are the correct names for the device configuration


and I can see that Hubitat understands the links.

but Google Home still thinks the blinds are a switch ...
am I missing an obvious step here ...

@talisker You're likely still seeing the copy of your device from the official Google Home integration.
This is a separate app that you will need to connect to Google Home, and once you've set everything up you'll need to tell Google to sync your devices, since the request sync API isn't implemented yet.

duh! glossed right over that step ...
so I walked through creating a new action, to the test point, and while it registers it does not connect ...
as noted earlier the device works fine in Hubitat

when I add the [test] action to Google home


it shows up as a device

the details look correct

but it does not connect

I read your notes again, and I don't think I missed a step here ...
any suggestions ... or is it just on me to read up on adding custom Google Actions and working this out ...

update:
on my phone Google Home, the blinds just say closed
on the Home Hub(s) they just show as "loading"
BUT, the blinds do correctly respond to the commands ok, open, close, set to 28(%) etc.
the Google home device shows the text
"Sorry, something went wrong and I'm unable to control your home device."
is that because I just have the Google Action in [test] mode, and have not made it permanent ?
which of course I wouldn't do as the action is linked to my personal hubitat ...

It sounds like something is going wrong when the app tries to report the blinds' state to Google. To troubleshoot can you turn on debug logging in the Google Home Community app and watch the Hubitat log while you attempt to open the device in the Home app on your phone. Check for any errors. If there aren't any, post the SYNC response from the log here and I can take a look at it.

Note that the [test] thing will always be there. Since I don't have any centralized servers for Google to talk to I can't create a "release" version of the Google Action.

yes, once I thought through the [test] thing, that part made sense ...
I can see the error, is the code public for this? I am an (aging) developer with a decent java background ...

app:92022-11-18 03:11:58.146 PMdebug{"requestId":"2117760445933208439","payload":{"devices":{"1":{"status":"ERROR"}}}}

app:92022-11-18 03:11:58.143 PMdebugApp exception stack trace: user_app_mbudnek_Google_Home_Community_138.hubitatPercentageToGoogle(user_app_mbudnek_Google_Home_Community_138.groovy:4737) user_app_mbudnek_Google_Home_Community_138.deviceStateForTrait_OpenClose(user_app_mbudnek_Google_Home_Community_138.groovy:3149) user_app_mbudnek_Google_Home_Community_138$_handleQueryRequest_closure65$_closure146.doCall(user_app_mbudnek_Google_Home_Community_138.groovy:2948) user_app_mbudnek_Google_Home_Community_138$_handleQueryRequest_closure65.doCall(user_app_mbudnek_Google_Home_Community_138.groovy:2947) user_app_mbudnek_Google_Home_Community_138.handleQueryRequest(user_app_mbudnek_Google_Home_Community_138.groovy:2942) user_app_mbudnek_Google_Home_Community_138.handleAction(user_app_mbudnek_Google_Home_Community_138.groovy:2004)

app:92022-11-18 03:11:58.135 PMerrorError retreiving state for device Bali Blinds: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead at line 4737 (hubitatPercentageToGoogle)

app:92022-11-18 03:11:58.115 PMdebug{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices

From that error it sounds like the attribute you have configured to report the Open/Close percentage of your blinds doesn't exist. What do you have set as the "Open/Close Attribute" in your Open/Close trait, and does that attribute exist under the "Current States" section on the page for your device?

ah ... wasn't sure what attribute to map for that ... so I just put an arbitrary string in there to allow the save of the device
I just went back and put in "position" just now, and that looks like it has resolved the issue for the widget in Google Home, as the controls now work in the UI on both my phone and the home hub.

the Home Hub still reports "Sorry, something went wrong and I'm unable to control your home device. " but the controls work properly ...

and ... that was just a delay in the sync with the Home Hub ... that message is now gone ...

your plugin is now working perfectly ... nice Job ... thanks for the assistance ...

1 Like

Hello, I have followed all the steps above and the fan does show up in my google home. However it only shows up as an on or off switch :frowning: any ideas?

That's all the Google Home app supports. You should be able to do speed control via voice commands, but the app UI will only show on/off.

New release: 0.36.0

This release adds support for the RequestSync and ReportState APIs.

  • The RequestSync API allows the app to automatically request that Google sync its list of devices with the app when changes are made
  • The ReportState API allows the app to proactively push device events to Google instead of waiting for Google to poll for device state.

The latter should both improve responsiveness when making queries about the state of devices and allow devices connected via this app to act as triggers for Google Home automations.

Both of these features require Hubitat version 2.3.4.115, but the app should still remain backwards-compatible with previous versions back to 2.2.9.131.

Some setup is required to use these features. You will need to create a Google Cloud service account that the app can act as when making requests to Google. See the instructions on the app's settings page, the first post in this thread, or the README.md file.

Huge thanks to @bhamiltoncx, who wrote the initial ReportState implementation and @gopher.ny for allowing apps access to the libraries that we needed to make this work.

If you encounter any issues with these new features please don't hesitate to post about it here. I've done only a minimal amount of testing on them, so there may be lingering bugs.

10 Likes