[RELEASE] Google SDM API - Nest integration

I'm sure they'll go on supporting them in some form. I have a feeling that they're going to release a new product to integrate with their new chip program though and that's where most of their effort will be focused.

1 Like

Does anyone know if I can control (turn on and off) Nest cameras with this app?

Thank you for this integration. I'm new to Hubitat, so going through a lengthy process of migration of my devices and automations.

I went through the instructions and everything appears to be setup and authorized; however, I am not getting the Discover Devices button. Curl commands return success (proper tokens, bearer, responses from the device).

The log shows the following - help is appreciated!

app:552021-01-28 00:46:27.868 infoGoogle SDM API updating
app:552021-01-28 00:46:12.916 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:46:12.613 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:46:12.610 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:46:12.278 infoCreating Google pub/sub event subscription
app:552021-01-28 00:46:12.255 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:46:11.922 infoGetting access_token from Google
app:552021-01-28 00:46:11.914 infosuccessful redirect from google
app:552021-01-28 00:45:33.270 infoGoogle SDM API updating
app:552021-01-28 00:45:23.610 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:45:23.378 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:45:23.377 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:45:23.094 infoCreating Google pub/sub event subscription
app:552021-01-28 00:45:21.912 errorLogin refresh failed -- Bad Request: [error:invalid_request, error_description:Missing required parameter: refresh_token]
app:552021-01-28 00:45:21.511 infoRefreshing access_token from Google
app:552021-01-28 00:45:19.911 debugAccess Token: null
app:552021-01-28 00:42:29.418 infoGoogle SDM API updating
app:552021-01-28 00:42:26.217 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:42:25.975 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:42:25.967 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:42:25.756 infoCreating Google pub/sub event subscription
app:552021-01-28 00:42:15.369 infoGoogle SDM API updating
app:552021-01-28 00:42:10.391 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:42:10.158 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:42:10.153 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:42:09.827 infoCreating Google pub/sub event subscription
app:552021-01-28 00:42:09.802 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:42:09.577 infoGetting access_token from Google
app:552021-01-28 00:42:09.565 infosuccessful redirect from google
app:552021-01-28 00:41:51.017 infoGoogle SDM API updating
app:552021-01-28 00:34:08.455 infoGoogle SDM API updating
app:552021-01-28 00:33:40.421 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:33:40.121 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:33:40.120 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:33:39.744 infoCreating Google pub/sub event subscription
app:552021-01-28 00:33:39.723 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:33:39.481 infoGetting access_token from Google
app:552021-01-28 00:33:39.474 infosuccessful redirect from google
app:552021-01-28 00:33:16.678 debugAccess Token: null
app:552021-01-28 00:33:15.479 errorLogin refresh failed -- Bad Request: [error:invalid_request, error_description:Missing required parameter: refresh_token]
app:552021-01-28 00:33:15.158 infoRefreshing access_token from Google
app:552021-01-28 00:28:58.030 infoGoogle SDM API updating
app:552021-01-28 00:26:27.101 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:26:26.812 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:26:26.810 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:26:26.446 infoCreating Google pub/sub event subscription
app:552021-01-28 00:26:26.425 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:26:26.174 infoGetting access_token from Google
app:552021-01-28 00:26:26.159 infosuccessful redirect from google
app:552021-01-28 00:21:10.802 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:21:10.537 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:21:10.536 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:21:10.187 infoCreating Google pub/sub event subscription
app:552021-01-28 00:21:10.162 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:21:09.857 infoGetting access_token from Google
app:552021-01-28 00:21:09.847 infosuccessful redirect from google
app:552021-01-28 00:17:27.086 infoGoogle SDM API updating
app:552021-01-28 00:17:09.796 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:17:09.540 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:17:09.538 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:17:09.277 infoCreating Google pub/sub event subscription
app:552021-01-28 00:17:09.227 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:17:08.947 infoGetting access_token from Google
app:552021-01-28 00:17:08.934 infosuccessful redirect from google
app:552021-01-28 00:16:45.794 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:16:45.503 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:16:45.498 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:16:44.116 infoCreating Google pub/sub event subscription
app:552021-01-28 00:16:38.629 debugAccess Token: null
app:552021-01-28 00:04:05.590 infoDropping stale events with timestamp < now, and refreshing devices
app:552021-01-28 00:04:05.582 infoGoogle connection recovered
app:552021-01-28 00:02:19.860 infoGoogle SDM API updating
app:552021-01-28 00:02:13.302 infoGoogle SDM API updating
app:552021-01-28 00:01:52.154 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:01:51.827 warnAuthorization token expired, will refresh and retry.
app:552021-01-28 00:01:51.823 errorcreateEventSubscription returned status code 401 -- 
app:552021-01-28 00:01:51.382 infoCreating Google pub/sub event subscription
app:552021-01-28 00:01:51.354 errorLogin failed -- Unauthorized: [error:invalid_client, error_description:Unauthorized]
app:552021-01-28 00:01:51.013 infoGetting access_token from Google
app:552021-01-28 00:01:51.001 infosuccessful redirect from google
app:552021-01-28 00:01:22.811 infoGoogle SDM API updating
app:552021-01-28 00:00:48.795 infoGoogle SDM API installed

Sounds like a problem with your credentials.json, copied from your GCP OAuth details. Did you get to click all the way through the Authorization redirect to Google, and see the Success page when redirected back to Hubitat?

Yes, went through the Google and Hubitat authorizations and got Success and then redirected back to the Hubitat (https).

So here is what I found from the logs.
Last debug with a success token refresh

and here is where it started failing.

I'm clueless on what is going on! Is there anything on the google side I can monitor? Any logs that I can tap into to see what is causing it?

Hmm... Weird. Honestly I'm not sure, but we could add a debug log to print the specific data being sent. Something like this, at line 73: log.debug("Sending httpPost with params: ${params}")

1 Like

I just set this up and noticed the same thing, only my Nest Hello and legacy drop cam are being discovered. I have two thermostats neither are being discovered :frowning: did you get this working yet ?any tips are much appreciated
-James

I had where my thermostat was not being discovered, tried and tried, then did a restart on the thermostat itself and then tried and it picked it up, may be something to try

going to give it a try shortly thanks for the tip I will keep you posted !

Yes, I used the method of deleting and re-adding the device to my Nest account as @jmpierce describes here. Not ideal, but it worked for both of us.

this 100% works, strange after deleting my first floor tstat the second showed up but then after deleting all from the hubitat app and doing a full rediscover all is well. Thank you!

1 Like

data is in hubitat but it doesnt appear to auto refresh, are you guys just doing a rule to refresh ?

I too am seeing the behavior that Hubitat is not receiving changes from Nest. For example, temperature and thermostatOperatingState are not updating to reflect the current values. If I hit refresh from within the device itself in hubitat, the updated values will be populated from Nest/Google.

Same here...I just built a refresh rule every 3 min, I am graphing the data in influx/grafana

1 Like

Same here.

Same here, just started happening today

Yep, I see the same - my thermostat is not sending events - but cameras are... Will dig in to see what I can find

1 Like

Update: my thermostat also no longer showed up in the "device list" -- so I figured I would remove and re-add it to my account, as several others in this thread have done.

Now, of course, it won't re-add. Guess I'll let it sit overnight and think about what it has done -- I don't negotiate with terrorists

2 Likes

:flushed: - that's not good! :frowning: