[Alpha] Community-maintained Google Home integration

Ah so after a reinstall everything works. One small issue, I cannot seem to set fan speed levels... Even with that trait added. Any idea on that one?

Do you mean you can't set them with voice controls or in the Google Home app? The latter is expected; there are no app controls for the Fan Speed trait, only voice controls.

I know it's an oxymoron, but it's sad that Google can't get their poop together and have the app match voice controls.

Okay I should have clarified, if I include the "Fan Speed" device trait then Google gives me that "Cannot Change Setting" error and won't connect to hubitat. So adding that trait breaks everything for some reason.

Edit: Ah! I shouldnt have messed with it. After removing that trait I can reconnect google home to hubitat but no commands are being sent again and every device shows offline :frowning: I'll start over again tomorrow.

Just an FYI/personal experience; Google does some really weird things when it sees devices with the same name and/or ID as a previous device/integration. Like not using the new ID or the correct/new endpoint. I had this happen when switching to the Community App from the built in one. I also experience this every so often when adding many devices at the same time.

I found that If I rename the device in the Google Home App (say Office Light -> Office Light2), exit out of the rename/settings screen for the light, then go back in and rename it back (Office Light2 -> Office Light), it fixes the problem.

The rename, for some reason, causes Google Home to refresh the device control URL and the device states. I have fixed many "unresponsive" or "offline" devices this way.

I also found it useful to enable debug logging on the Integration App and keep the Hubitat Log window open. You should be able to see the refresh commands when you have Google "Sync My Devices" or when you pull down to refresh the screen when at the top of the home app (nice find that I don't have to keep telling google to "sync my devices"). You should also see the request come in to the Hubitat Integration when you access a device, as google will do a state refresh. If you do not see the state refresh in the log, then try the rename trick and see if it fixes it.

Please pardon my ignorance with this question, but why haven't these changes been integrated upstream into the built-in integration?

The built-in integration isn't open-source, so I can't modify or contribute to it. Since I released this app under the GNU General Public License the Hubitat team would be free to merge the two, but they would have to release the combined app as open-source under a compatible license (or negotiate a separate license with this app's copyright holders, which is no longer just me). That's not something they're likely to do though. They've never shown any interest in adopting community apps/drivers nor releasing their built-in apps as FOSS.

1 Like

Shame really, I feel as though a code review over creating something from scratch that already exists is more beneficial.

Would give them more work in reviewing and testing the merged code and curating the versions than if they simply keep a clear distinction between their own verified and authorised code and that which "could be dodgy use at own risk". They'd not want to be in a position where they'd failed to notice someone had written in a malicious back door, and got sued because the app was in their official list. At least they have facilitated community additions, in quite a user-friendly way.

1 Like

Thanks for the explanation, now I understand.

Why do people have to be so clever with their responses :joy:

1 Like

I am having a failure following this final step. I created an on/off device type with one on/off trait. I assigned one switch to the type. In Google Home I added my test service, logged in, and kept the selected device, which was the only one I had assigned to a type:

I clicked the "Authorize" button below, completing the authorization process and everything seemed good. I get the "Signing in..." modal for a moment and the it kicks me back to the list of Linked services, and my [test] service is not on there. I can repeat the process with the same result.

So far I have tried nuking and paving the Hubitat application and making small changes to the metadata on the Smart Home action config on the Google side. No interesting errors in the debug log.

I'm really liking the lastest update to the Google home app. The dark theme is great. I got the update two days ago. And then yesterday the devices status started updating in the background. It doesn't seem to be working yet on my pixelbook or my wife's phone, not sure why.
I still can't control the lock but at least it shows the status now :slight_smile:


2 Likes

If you enable debug logging in the Hubitat app, do you see anything in the Hubitat log when you tap "Authorize"? If not, then the issue is probably the fulfillment URL in your Google Action.

Nope, no log lines at all.

I visited the fulfillment URL and got an OAuth invalid_token error, which seems correct. When I mangle the URL in other ways to screw up the hub ID or the app ID the error changes and I can generate a log line:

sys:1 2020-08-28 09:46:17.752 pm warn Received cloud request for App 660 that does not exist, path: /action from 24.154.252.111

Yeah, it sounds like the fulfillment URL. Make sure the hub ID and app ID are correct. For example, if your app instance is ID 1234 and your hub ID is 244b16f0-24a8-409c-8946-248ababb9750 then the fulfillment URL should be https://cloud.hubitat.com/api/244b16f0-24a8-409c-8946-248ababb9750/apps/1234/action.

The other thing to check would be the OAuth settings. Make sure your client ID and client secret match those from the OAuth info from the app definition. Also make sure you have the app scope configured. Note that the scopes are case-sensitive, so App won't work; it has to be app exactly. The fact that you can get to the point of selecting devices points to that not being the issue though.

OK, I've checked the fulfillment URL many times. Here's the URL I am using, copied direct from the Google Actions Console field:
https://cloud.hubitat.com/api/bbd{REDACTED}22b/apps/661/action

It's based on this copied and pasted Hub ID:
{screenshot redacted}

And this app ID taken from the following URL when the only remaining copy of the Google Home Community app is showing:
http://hubitat/installedapp/configure/661/mainPreferences

If I have somehow still messed up the fulfillment URL I am lost as to how.

I also quadruple-checked the OAuth login credential and the scope, which is set to "app".

Space at the end? Invisible characters if you copied via browser? Try pasting first into notepad or similar plain text editor then copy and paste from there. Something that has affected me at times in the past.

Got it connected. Thanks to you both for your suggestions.

I had to nuke and pave the Google Action. No idea what was wrong there but the second time it worked. I now have my [test] app linked up (though it shows a greater number of devices than I expected).

And with a bit more futzing around, I have my Ikea switchable outlets and my Inovelli dimmers, light/fan controls, and switches all nicely represented and working via Google Home app and the voice assistant. Thanks so much @mbudnek, it's officially wife-approved!

1 Like