Skip to content

Use the smart device API with Apps Script to create a Nest thermostat logger

Notifications You must be signed in to change notification settings

rjwalters/nestThermostatLogger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nest Thermostat Logger

Project to log data from Google Nest thermostats into a Google Sheet, using the Smart Device Management (SDM) API and Apps Script. It also uses the weather.gov API to add local weather data.

The SDM API was launched in September 2020 (read more).

Changes in this fork

  • collects slightly different data
  • assumes only one thermostat
  • gets oauth token from accounts.google.com rather than nestservices.google.com
  • async data collection
  • averages weather data from two local stations

Setup

Follow the steps in this Get Started guide from Google to access your device(s).

Note: there is a one-time, non-refundable $5 charge to access the API.

The project must be created in the same Google account that owns the Nest devices.

You will need to create a project in your Google Cloud console, where you can get OAuth ID and secret.

This project uses the OAuth2 Apps Script library.

Tutorial setup details on https://www.benlcollins.com/apps-script/nest-thermostat/

I had trouble setting up permissions in oauth and then managed to get it to work by running the logRedirectUri() function within Apps Script to trigger the ui flow that stores a token.

About

Use the smart device API with Apps Script to create a Nest thermostat logger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%