[Alpha] Community-maintained Google Home integration

You're correct, you have to select devices for only one device type. Sadly the only way to filter those lists is by a single capability, so getting them down to just the appropriate devices isn't always feasible.

You don't need to use the authorize flow in the Google Home app to add new devices though. Once you've done the initial link, you can add new devices via the app's configuration page in Hubitat (which is significantly easier to navigate than a giant list of checkboxes), click "done" at the bottom to save the changes, and then either say "Hey Google, sync my devices" or swipe down while at the top of the Google Home app until the little refresh arrow appears.

3 Likes

Ah curious... Will try that method of syncing next time.
Still trying to work out how to remove the duplicates from my most recent test with 'authorise all', without removing everything and starting from scratch (which would break all my Google Home automations!
Thanks for the rapid response!

Probably stupid, but thought I'd mention, since it took me way longer to figure out than it should have....

When you go to "Set Up Device" in Google Home app, "Have something already set up?" is no longer an option. At least it isn't for me on a Pixel 5 Android 11.

I have "New Device"" and "Works with Google."

Down the list of "works with Google" was my [Test] GHCTest device.

Also, running a test in the console repeatedly failed for me. Not sure if its supposed to or not, or if I was just supposed to check the settings and not worry about testing in the console. But it had a button, so I needed to click it.

Looking forward to diving into this app now that I've got it (close to) working.

1 Like

Thanks for mentioning that. I've updated the instructions to match the current Google Home app.

1 Like

@mbudnek my pleasure. I love this community, and try to help where I can. Which is rare.

Out of curiosity, does GHC not like stringing virtual devices together? For testing, i created a virtual switch and a virtual RGB light to add to Google Home, but they are acting wonky.

My rule is simply to have the virtual switch turn on the virtual RGB. But I'm getting error that the expected states aren't reached when expected. Ultimately they work.

But in the Google Home app, the state of the virtual RGB isn't being updated. So it shows that it is off when Hubitat shows that its on until I refresh/pull down the app. Is there a way to increase how frequently devices are polled?



No, there's no way to make the Google Home app poll more frequently. It will only poll device status once as long as you remain on the main page of the app. If you close and re-open the app it will re-poll. Or if you open the device in question it should re-poll and show the correct status.

Sadly GHC can't currently push device status to Google due to Hubitat platform limitations (see this thread). Once that feature is implemented it should fix that issue.

I have been using this app for a year now and it has worked well. since june I started getting messages in my log and now Google Home doesn't seem to work with the app. It sees the hub, gives a list of all of the devices but then says that there are no devices in the Hubitat hub, try later.

here is the log:
app:58202021-08-20 13:17:26.351 errorsyncResponse Error: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" } } , giving up for now

app:58202021-08-20 13:17:16.502 errorsyncResponse Error: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" } } , giving up for now

app:58202021-08-20 13:16:41.638 infoupdated...

When I try to relink the Hubitat account, after selecting all devices I sometimes get the message "No devices were found in your Hubitat account. You may need to set up these devices with Hubitat First. If you have already setup devices, they may not be available due to a temporary error. Please wait a few minutes and try again."

Thank-you

Setup went off without a hitch on my C5 last year but on my C7 I've tried several instances and none will link. Despite repeated attempts the link fails at the end of the linking process in the Google Home app. I go through the entire process to include selecting the devices (I have 4 fans enabled) but the moment you try and complete the setup it fails and says could not reach test. Please try again. I've double, triple checked the client ID, client secret, apps ID, and hub ID and it still fails. I'm at a loss.

Are you sure app 5820 is your Google Home Community instance? Those messages don't look like anything this app produces...

Turn on debug logging in the app. If you see any logs when you try to link then post them here. It most likely means everything is configured correctly in your Google Action but something is misconfigured in your device type or traits. If you don't see any logs then there's something misconfigured in the Action. The client secret is the most common, since Hubitat prevents you from copying it and Google masks that field so you can't tell you pasted the wrong thing. A few other common mistakes:

  • Scopes are case-sensitive. You must use app, not App
  • Check your fulfillment URL. It should look something like https://cloud.hubitat.com/api/b97ac781-df30-43cd-98a4-e8a9a040bada/apps/12345/action

Checked the scope and fulfillment URL and it's fine. Sent you screenshots of everything. Also, here's the log along with screenshot:

app:1042021-08-27 08:37:51.095 am debug{"requestId":"17567129171568400293","payload":{"devices":[{"id":"104","type":"action.devices.types.FAN","traits":[],"name":{"defaultNames":["Leviton 4-speed Fan Controller ZW4SF"],"name":"Living Room Fan"},"willReportState":false,"attributes":{},"roomHint":"All"},{"id":"74","type":"action.devices.types.FAN","traits":[],"name":{"defaultNames":["Leviton 4-speed Fan Controller ZW4SF"],"name":"Master Bedroom Fan"},"willReportState":false,"attributes":{},"roomHint":"All"},{"id":"139","type":"action.devices.types.FAN","traits":[],"name":{"defaultNames":["Leviton 4-speed Fan Controller ZW4SF"],"name":"Elijah's Bedroom Fan"},"willReportState":false,"attributes":{},"roomHint":"All"},{"id":"78","type":"action.devices.types.FAN","traits":[],"name":{"defaultNames":["Leviton 4-speed Fan Controller ZW4SF"],"name":"Back Porch Fan"},"willReportState":false,"attributes":{},"roomHint":"All"}]}}

app:1042021-08-27 08:37:51.062 am debug{"inputs":[{"intent":"action.devices.SYNC"}],"requestId":"17567129171568400293"}

--- Live Log Started, waiting for events ---

You are right, I still had the original Hubitat Google Home running (with noting in it). I deleted that app now.

Sorry for your trouble and thank-you for your response.

I'm looking into a problem with Google Home, because I can't relink Hubitat to Google Home anymore. I've have messaged Google back and forth with no answers yet. I always get the message "There are no devices in your Hubitat account".

Yannick

It doesn't look like you've given your fan device type any traits. Traits are what tell Google how to interact with your devices, so every device type must have at least one trait configured.

That means you either haven't configured any devices in the Hubitat app, didn't select any devices when linking to Google Home, or something's misconfigured in one of your device types or traits. The first two should be easy to rule out (just set up one or more devices and try again). If you have devices configured and selected, try turning on debug logging in the Hubitat app and posting any log messages that are generated when you try to link.

I have 76 devices configured in Google Home Community. They all have worked for the past year and a half. When I go in the Google Home app and add Hubitat I get the usual login from Hubitat, then I chose my Hubitat Hub, then I see a list of all of my devices and I can select each one with the click box or chose Authorize ALL or Deny. Then, after a few seconds, I get the message that there are no devices in my Hubitat Account (funny, it just gave me the list of devices ! ).

1 Like

Any luck on the remote control channel trait?

This trait works out great for a vertical blind project I just finished. I can use open/close, on/off, and brightness traits to control the blinds as usual. And then with the rotation trait I can control the rotation percentage also(*voice control only). works out great!

1 Like

Then definitely grab the debug logs while you do a sync and post them here. Sounds like it's just a misconfigured device type/trait causing problems with Google.

Greetings,

I've had the GHC app setup on my C7 for a while now, providing a means to cast my Unifi cameras to my Nest Hubs (by way of an RTSP to HLS docker image). This was all working great earlier this year, but now I can't seem to get any of my hubs to display either camera. When asking the hubs to "show me the XX cam", I get a "Sorry, it looks like the stream is currently unavailable from the XX camera". Similar message if I tap on the camera in the Home Control tab.

What's odd is that my HE logs aren't showing any errors for that app, and when I tcpdump from the AP that my hub is connected to, I never see an attempt to initiate a connection with my local HLS source. I can't remember exactly, but I thought the HE logs for the GHC app showed the stream URL that the virtual camera is set to when the cast request comes in?

Here's some logs:

app:1163 2021-09-01 02:12:20.285 pm debug{"requestId":"217049201389073811","payload":{"devices":[{"id":"1112","type":"action.devices.types.CAMERA","traits":["action.devices.traits.CameraStream"],"name":{"defaultNames":["Front Door Camera"],"name":"Front Door Camera"},"willReportState":false,"attributes":{"cameraStreamSupportedProtocols":["hls"],"cameraStreamNeedAuthToken":false,"cameraStreamNeedDrmEncryption":false},"roomHint":"Porch"},{"id":"1113","type":"action.devices.types.CAMERA","traits":["action.devices.traits.CameraStream"],"name":{"defaultNames":["Porch Camera"],"name":"Porch Camera"},"willReportState":false,"attributes":{"cameraStreamSupportedProtocols":["hls"],"cameraStreamNeedAuthToken":false,"cameraStreamNeedDrmEncryption":false},"roomHint":"Porch"}]}}
app:1163 2021-09-01 02:12:20.245 pm debug{"inputs":[{"intent":"action.devices.SYNC"}],"requestId":"217049201389073811"}
app:1163 2021-09-01 02:07:31.888 pm debug{"requestId":"14053847018838119864","payload":{"commands":[{"status":"SUCCESS","ids":["1112"],"states":{"online":true}}]}}
app:1163 2021-09-01 02:07:31.885 pm debugAll devices reached expected state and are ready.
app:1163 2021-09-01 02:07:31.883 pm debugPolling device attributes for 1000 ms
app:1163 2021-09-01 02:07:31.876 pm debug{"inputs":[{"context":{"locale_country":"US","locale_language":"en"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"1112"}],"execution":[{"command":"action.devices.commands.GetCameraStream","params":{"StreamToChromecast":true,"SupportedStreamProtocols":["progressive_mp4","hls","dash","smooth_stream"]}}]}]}}],"requestId":"14053847018838119864"}
app:1163 2021-09-01 02:06:58.939 pm debug{"requestId":"7250716365269299817","payload":{"commands":[{"status":"SUCCESS","ids":["1112"],"states":{"online":true}}]}}
app:1163 2021-09-01 02:06:58.935 pm debugAll devices reached expected state and are ready.
app:1163 2021-09-01 02:06:58.928 pm debugPolling device attributes for 1000 ms
app:1163 2021-09-01 02:06:58.887 pm debug{"inputs":[{"context":{"locale_country":"US","locale_language":"en"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"1112"}],"execution":[{"command":"action.devices.commands.GetCameraStream","params":{"StreamToChromecast":true,"SupportedStreamProtocols":["progressive_mp4","hls","dash","smooth_stream"]}}]}]}}],"requestId":"7250716365269299817"}

Has anyone had a similar experience recently? I want to say the last time I used this was in March, and possibly before my hubs had Fuchsia OS on them.

Apparently Google changed the camera API a while ago. @lpakula has had a pull request open to fix it for a while and I've just been lazy and forgetful and neglected to review and merge it. In its current state it will require you to reconfigure your CameraStream traits, but I'll see if we can make it backwards-compatible before I merge it. When I merge it I'll post here and make it clear if you'll be required to re-configure your devices.

1 Like

Let me check and make sure it aligns with your current trunk. I can make the changes.

1 Like

@mbudnek is this integration 2 way? So could I get a google home device into hubitat? Also does it work with media controllers?