[Alpha] Community-maintained Google Home integration

Freaking amazing work. It didn't like something with my receiver.

Thanks again!

I end up getting the "could not reach [test]" when I get to the authorize stage of the setup. I've tried enabling the logs to see if there's anything I could send to diagnose it, and the logs don't show anything. I have a device type of dimmers with brightness trait turned on and multiple devices selected, but it doesn't authorize. Do you have any suggestions of next steps?

When you try to link, do you get sent to Hubitat's login page and/or the hub selection or device selection pages that come after it? If not, you almost certainly have an issue with the OAuth settings in your Google Action. Check the URLs, client ID, and client secret.

If you do get through the login and hub/device selection then it's probably an issue with the fulfillment URL in your Google Action.

2 Likes

Entirely correct. Thank you!

Just wanted to share another integration and why I love this app.

I have 2 Zooz Zen16 relay boxes controlling my irrigation. With this app, even though they are "switches" I can make them "sprinklers" in GH. It's the small things in life.

Thanks again for a great app!

First I wanted to say Thank You! for creating this. I just migrated from ST to HE and I was beating my head against the wall trying to figure out why some of my Zwave devices were not integrating with Google Home, even ones that previously worked with ST and Google Home integration. (My wife was not amused..)

I just got my iBlinds configured and working but is there a way to get the blinds to open to 50% when I give the open command (Hey Google Open the blinds)? I'm using the default HE driver where 0 = closed and 100 = fully open. When I give the open command it drives fully the other way t0 100% (technically closed). It does properly set if I tell Google to open to 50%.

I have discrete unchecked and I set the open/close attribute to 50 but that has no effect. I tried setting that variable to 0 or 100 with no difference either.

Thanks again

For the default iblinds driver you'll need to turn Discrete Only on. Then you can set the open command to 'open' and the close command to 'close'. You can create a Rotation trait that uses the 'position' attribute and 'setPosition' command to be able say "rotate the blinds to 30" or similar to set the blinds to an arbitrary position.

Ok thanks for the info, and I will give it a shot. Would you recommend switching to the actual iBlinds driver then for better control?

The driver from iblinds and the built-in one behave the same. I actually modified my own iblinds driver to make 100% open to the default open position so it would work better with this app, but the tradeoff is that I can't actually open past the default position at all anymore.

Ok got the open and close working properly now, but for the life of me I cannot get the rotate command to work. I set the position attribute to 50 (the current setting for the blinds since they are open) and I have the setPosition command in the set rotation command section.

When I ask Google to rotate the blinds, it responds that it does not understand the command and nothing happens or I get an error that it cannot control my device.

I see in the commands list that setposition command is:

setPosition(position)
position required (NUMBER) - Shade position (0 to 100)

Am I supposed to set a number for the position? Wouldn't a static number override the point of it being a variable? Is the setPosition command mapped to rotate or is there a different command I should be using or can use?

You should set the "Current Rotation Attribute" to position and the "Set Rotation Command" to setPosition, then you can say "Hey Google, rotate the blinds to 60" and it will set them to position 60 (slightly past fully open).

Ah that makes sense. Guess I was overthinking it. Thanks again!

Hi Guys, I need help.
I had this running fine for months without issues.

Today I installed a temperature sensor, everything works as expected in Hubitat, I then wanted to share it to Google Home.
At first it worked, I could ask Google the temperature and it told me but the icon was weird and I wanted to display something more accurate.

I then went into Google Home Copmmunity and changed the trait for different Temperature choice, the device type from sensor to thermostat and to humidity, played with it for a little bit to see how it behaved in Google Home.

While in the Thermostat or Humidity settings, I most probably set the wrong value in one of the fields, maybe setting the steps to 0.5 was a mistake or it could be another field. Anyhow, it ended up with "Unexpected error / An unexpected error occured trying to load the app. check logs for more information." but... nothing in the logs ( I set debug logging withno changes ).

I then tried a backup, same error, i removed all instances of Google Home Community, re-installed the user app, re-installed the app, updates settings on the Google side ( devices that I add appear correctly on my google phone app ) but the error persists when I want to edit or set up any traits, even existing ones and Google gets an error on communication with Hubitat.

Is there a cache to clear somewhere, or any way to really really start from scratch ( it's easy to re-install so no problem there), is there a config file to flush? a JSON file to modify ?

I will try to provoque logs to see if anything would mean something..

any help would be appreciated

Thanks !

EDIT: now even Package manager gets stuck if I click on repair or uninstall, it spinns endlessly, my wild guess is that this app hangs, hope I am wrong

EDIT 2 : I managed to get this:

errorError retreiving state for device Garage porte de garage: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead at line 4129 (hubitatPercentageToGoogle)

I've had a similar issue to @robertsimard today.
I've already got some temp/humidity sensors installed & exposed to Google as "Refrigerators." Great, as that's where they're located & they've been working just fine.

Today I installed some identical sensors and tried to expose them to Google with a different device type (they're not in fridges!). I encountered all the same errors as described above.

I can add them in to the existing list of 'fridge sensors and they expose just fine. I just cannot seem to successfully create a new device sub-set - the app throws a wobbler every time.

thanks for your reply, it gave me the idea to try to recreate my faulty device

I just tried to re-create a device with himidity in traits, all i get is a blank result page with a "done" button, it then freeses there, I have to clisk on "apps" on the left menu to get out...

I am pulling my hair

@robertsimard There shouldn't be any sort of cache. If you remove the app instance Hubitat should delete all of the settings with it. A new instance will have a new ID though, so you'll need to update the fulfillment URL in your Google Action. If you delete the app code, you'll also get new OAuth paremeters, so you'll need to update those in the Google Action and probably unlink and re-link with the Google Home app.

That last error you posted indicates that Google is trying to query a device that the Hubitat app doesn't know about. Make sure you do a sync any time you add, remove, or update devices in the Hubitat app ("Hey Google, sync my devices" or pull down from the top of the Google Home app).

@robertsimard @ChrisPowys I'll need more specific info to really be able to help beyond generic advice. What exact errors are you seeing? Which exact pages or screens do you see them on? What do you see in the logs when you try to sync your devices with Google? If you can't get that far, then you could try exporting your app's settings and I could take a look. In the Hubitat app, click the little gear in the top-right, then click "Export/Import/Clone", then "Export Google Home Community" and send me the file (I don't think there should be anything sensitive in there, other than perhaps any PIN codes you've configured).

Thanks for your answer!

I tried that with no luck.
are there any entries in the database ?

I could send you my JSON file ?

@robertsimard The JSON file could be useful, but it would be more useful if I knew exactly what page/screen you're seeing errors on. It sounds like the app is at least partially working (you can add device types), but it errors out somewhere? Please walk me through exactly what actions you take to get an error.

ok, i removed all instances
created a blank one
created a test switch and linked it to Google

the switch appears in Google Home

when i select a trait in the pull down menu, it changes to a blank page, and stays stuck there

here is the error when i try to flip the switch from Google:
Error executing command OnOff on device 18: java.lang.IllegalArgumentException: Command 'null' is not supported by device 260. at line 2111 (doCall)

here is the JSON
{"deviceReplacements":{"260":{"deviceName":"18","deviceLabel":"Cuisine ilot","deviceTypeName":"Lutron Dimmer","deviceTypeNamespace":"hubitat"}},"appReplacements":{"1443":{"appTypeName":"Google Home Community","appTypeNamespace":"mbudnek","appType":"usr","appName":"Google Home Community","appLabel":"Google Home Community","parentAppInstalledAppId":null,"parentAppTypeName":null,"parentAppTypeNamespace":null,"parentAppName":null,"parentAppLabel":null,"childApps":{},"singleInstance":false}},"appData":{"1443":{"state":{"currentlyEditingDeviceTrait":"deviceTypes.0.traits.OnOff","deviceTraits":{"deviceTypes.0":["OnOff"]},"clonedName":"Google Home Community","nextDeviceTypeIndex":1},"appSettings":[{"deviceList":null,"multiple":false,"name":"deviceTypes.0.type","type":"enum","value":"switch"},{"deviceList":null,"multiple":false,"name":"GlobalPinCodes.display","type":"text","value":"Global PIN Codes"},{"deviceList":null,"multiple":false,"name":"debugLogging","type":"bool","value":"false"},{"deviceList":null,"multiple":false,"name":"deviceTypes.0.display","type":"text","value":"test 2"},{"deviceList":null,"multiple":false,"name":"addPin:GlobalPinCodes","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"deviceTypes.0.googleDeviceType","type":"enum","value":"SWITCH"},{"deviceList":null,"multiple":true,"name":"modesToExpose","type":"mode","value":null},{"deviceList":null,"multiple":false,"name":"deviceTypeToDelete","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"deviceTypeToEdit","type":"enum","value":""},{"deviceList":{"260":"Cuisine ilot"},"multiple":true,"name":"deviceTypes.0.devices","type":"capability.switch","value":null}],"subscriptions":[]}}}

@robertsimard @ChrisPowys Ah ha! The Hubitat 2.3.2.127 update broke it! I found the problem (or rather @lpakula did, as part of a completely unrelated pull request he's working on). One sec, I'll make a fix.

2 Likes