Windows Open / Nest Thermostat Off

I just bought the Hubitat C8 and have been setting up window sensors. Iā€™d like to set up the window sensors to shut off one of the Nest thermostats if a single window or multiple windows are opened and to turn it back on when the single window or all windows are closed. I know Nest no longer has an open API, which makes things difficult. Has anyone found a workaround?

Thank you

You can use the nest api integration but honestly there are better thermostats out there (Try the Honeywell T6 Pro Z-wave). That said it's pretty easy to do...

Trigger: Contact Sensor(s) changed: open
Action: Turn off thermostat

Trigger: Contact Sensor(s)Changed: close
Action Turn on thermostat

I would also use Device Status Announcer as well to tell you what window is open.

Are there step-by-step instructions posted anywhere for a newbie? I've searched the articles and can't find this. Thank you.

I use this integration with my Nest thermostat and it has been working for me for a couple years now.

Thank you for this.

I'm following the instructions and when I get to:

Installation

SDM Api App

I Paste the code for sdm-api-app.groovy and get the message "Cannot invoke method minus() on null object on line 1"

How do I fix this?

Import the raw link into user apps code

1 Like

Additionally, you can use this app to group your windows sensors to simplify setting up your rules. I'm no longer maintaining, but another dev has plans to pick it up. Should have no issues supporting your use-case as is though.

1 Like

So like this?

https://raw.githubusercontent.com/sdm_api_app.groovy

paste just the link into user apps (pick new user app, then click import and paste that link) and click import then save. Then go to apps, add apps, add user app

1 Like

I used this App Code: Hubitat Elevation - Google SDM API

I used this Driver's Code: https://raw.githubusercontent.com/dkilgore90/google-sdm-api/master/sdm-api-thermostat.groovy

In the App Code, I changed the UUID code and JSON code to what what given to me by Google.

I go to the Apps Page and click on the link Google SDM API but no Auth Link is provided.

I'm not sure what I'm doing wrong.