[RELEASE] Google SDM API - Nest integration

Ill address each error.

  • Response code: 408 - this is a server timeout, essentially it took too long to finish what we asked, so it sent this response. Not much we can do, since we only asked for one thing.
  • Response code: 404 - indicates "not found", but not sure what... Maybe the image itself - did Google give us a bad url?
  • ThermostatEco.SetMode response code: 400 - this is a legitimate error condition - from the Google documentation: Some thermostat models do not support changing the Eco mode when the thermostat mode is OFF, according to the ThermostatMode trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the Eco mode.
  • Response code: 500 - internal server error (on Google's side), but the App didn't parse any details from the response, just the code.

I'll look at enhancing some of the error logging to get more details when some of these issues happen.

2 Likes

Hello, I have a question about aux heat.

We will be replacing our HVAC system with a duel fuel heat source, heat pump above temp X and LP below.

We also have Powerwalls.

I am wondering if this integration allows for changing the heat source to Aux Heat in the even we are running on battery power.

Thanks in advance for any input that can be provided.

-Walt

Unfortunately the API from Google does not expose any direct access to the heating source, aux or heat pump.

I know there are some integrations here in the forums that poll Tesla powerwalls, so you could integrate that state, and perhaps tie it via RM to a virtual switch - shared to Google Home to trigger a Google Assistant routine? Just an idea of an alternative to explore.

I'm sure I'm making some idiotic mistake, but I just can't get this app to work.

I generate the Client ID from the Google Cloud platform, download the client configuration .json. I then create a project with the Client ID and generate the project ID. I then add the app in Hubitat and enter the Google Device Access Project ID and the full content of the .json file. I've even tried using https://jsoneditoronline.org to format it as another attempt. However, even with all of this, after clicking Done and going back into the app, I never get the authorization link.

What other step could I be missing?

Check your logs for any error messages. After filling in the top two boxes you should have this Auth Link button to click.

image

Here's what I see in logs:
app:8662023-04-19 21:31:31.538infoGoogle SDM API updating

app:8662023-04-19 21:31:22.929errorjava.lang.RuntimeException: OAuth is not enabled for this App on line 279 (method installed)

app:8662023-04-19 21:31:22.907infoGoogle SDM API installed

app:8662023-04-19 21:31:12.914warncredentials.json input is not valid JSON

app:8662023-04-19 21:31:12.911warncredentials.json input is not valid JSON

app:8662023-04-19 21:31:00.243warnprojectId input is not a valid UUID

app:8662023-04-19 21:31:00.240warncredentials.json input is not valid JSON

app:8662023-04-19 21:31:00.237warnprojectId input is not a valid UUID

What's interesting is that the Google Device Access - Project ID and Google credentials.json entry fields no longer show an invalid entry, yet the Auth Link button as seen above never displays for me, even after I click "Done" and go back to the app.

This is the kicker - go back to the Apps Code, open Google SDM API, and click on OAuth in the top-right. This must be enabled in order to create the access token for handshaking and secure callbacks from Google for async events. Once enabled, you will need to remove and re-add the app, as the Hubitat token creation is only attempted during initial install, so as to not overwrite an in-use token.

That fixed it! Thank you.

Now to figure out all the drivers. I seem to have the doorbell working with it. Are there any drivers out there for Nest Protect (the smoke detectors)?

Unfortunately Google has neglected the Protect smoke/CO detectors - there is no support for them in the API. If Google ever adds support, I will for sure add a Driver for it!

3 Likes

Not that big a loss I suppose. If I have smoke issues going off so frequently I need more than notifications from the native Nest app, I've got bigger problems. :sweat_smile:

Not sure if this is just in my case, but the setEcoMode seems to be broken. Pretty much everything else seems to be working fine though. This is for both of my thermostats.

Working fine for my Gen3 Learning model.

What about it is broken for you? How are you trying to invoke it - via the device page, Rule Machine? Debug logs from device and app would be most helpful to attempt to troubleshoot.

Hello. I have used the app for a while to help with my thermostat. I use the Nest to program the actual setpoints, etc., but I love using Hubitat for various automations, including turning fans on in the house when the HVAC kicks in. It's great!

However, periodically my Google account decides to deauthorize the app and I have to reauthorize it. Is there something I am missing or is this a "feature" of google?

The only condition I'm aware of is if your Google Cloud Project is in "Testing" mode, instead of Production. You can check here: https://console.cloud.google.com/apis/credentials/consent (make sure the correct project is selected, if you have multiple) --under "Publishing status". If in Testing mode, then authorization will expire after 7 days.

1 Like

I have an existing Nest Doorbell and Camera, and they were discovered fine when I installed this app. Today I installed another Camera, clicked discover...and it's not finding the new camera. Am I missing a step somewhere?

You may need to click the Auth link again, and follow that workflow, to enable permissions for the new device.

I ended up figuring it out from a message earlier in the thread from you, back in 2021 I think
You posted the link to authorize the devices, and all I had to do was tick the boxes and rediscover.

Thanks!!!

Well, spoke too soon. It discovered the new camera but I'm getting no activity from it. No log events at all
I'll do some more digging later tonight.

Off-hand, I'd suggest to double-check permissions allowed/enabled in the auth flow (or whichever other link you found).

Additionally, I recall reports that events via this App are also dependent on enabling notifications/events in the Nest or Google Home app, depending on the variant of your device - e.g. you may have to enable them in Google Home in order for them to be sent to Hubitat, then block certain notification categories on your phone to suppress them if undesired... Hope that makes sense

Makes sense. Once I regain the use of my arm I'll start digging and report back. I'm mainly interested in motion events. Our garage door swings out into the sidewalk when opening so I want to create a rule that audibly and visually warns us in the garage before we open the door.