[Alpha] Community-maintained Google Home integration

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

Disregard... Figured it out from the directions in the app!

This is awesome!! Thank you for this great update!!

There are lots of improvements coming in the google home app, I'm a beta tester, and these changes have unlocked more improvements.

This is amazing! Thank you for all your hard work!

Just installed 2.3.4.116 and this update. So far so good, my devices are showing as available to trigger routines now. I've seen these two lines show up in my logs a couple of times though:

[info](http://hubitat/logs#)Requesting Google sync devices
[error](http://hubitat/logs#)groovyx.net.http.HttpResponseException: status code: 404, reason phrase: Not Found on line 199 (method updated)
1 Like

The only reason I can think of that would happen is if Google doesn't know about your agentUserId yet. Try doing one last manual sync ("Hey Google, sync my devices" or pull down from the top of the Home app to refresh). That should tell Google what they need for the automatic sync to start working.

1 Like

New release: 0.36.1

This is a very small update to avoid reporting errors when scenes and modes turn on/off

any ideas what this is?

@BorrisTheCat Do you have multiple Google Cloud projects? If so, make sure you enabled Home Graph and created the service account and key for the project corresponding to the Google Action that you're using for this app.

I noticed I can now unlock my locks via the app now. It prompted me for the pin and everything. Was that due to the state/sync update? If so thanks!

1 Like