Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Acquiring and changing basic data on the Nest thermostat

Tags:

nest-api

I've been having trouble acquiring and changing some of the basic data available from the Nest thermostat.

Using a command line, how can I get or change individual settings or values on my thermostat?

like image 265
jfudgeelder Avatar asked Jul 07 '14 01:07

jfudgeelder


People also ask

How do I reset my Nest thermostat?

Press your thermostat ring and hold it down until the screen turns off (about 10 seconds). Then let go of the ring. Press and release the ring to turn it back on and complete the restart process. The Nest logo will appear when it begins to start up.

Why does my Nest thermostat keep changing the temperature?

Automatic switching with presence sensing: If you've enabled Home & Away Routines or Home/Away Assist, your thermostat might still automatically switch to its Eco Temperatures when it senses that everybody has left home. If you don't want it to do that, disable Eco Temperature auto switching for your thermostat.


1 Answers

This is a compilation from several users explaining how to retrieve or change some basic information with some of my own experiences added in. Wherever I use <VALUE>, replace that with the applicable information in your setup. If you're using Windows, you'll need something like git-scm.

  • The following a part of the authentication process. You'll need to have a client already made on Nest's developer page and followed the provided authorization URL to get your auth code. Run this line to get an access token:

    curl --data 'code=<AUTH CODE>&client_id=<CLIENT ID>&client_secret=<CLIENT SECRET>&grant_type=authorization_code' https://api.home.nest.com/oauth2/access_token
    
  • To fetch some information about the thermostats associated with the authorization code:

    curl -v -L https://developer-api.nest.com/devices/thermostats?auth=<AUTH CODE>
    
  • To fetch some information about a specific thermostat:

    curl -v -L https://developer-api.nest.com/devices/thermostats/<THERMOSTAT ID>?auth=<AUTH CODE>
    
  • To fetch the target temperature in F from the specified thermostat. You can replace target_temperature_f with any other value listed under thermostat on Nest's API reference:

    curl -v -L https://developer-api.nest.com/devices/thermostats/<THERMOSTAT ID>/target_temperature_f?auth=<AUTH CODE>
    
  • To change the target_temperature_f:

    curl -v -L -X PUT "https://developer-api.nest.com/devices/thermostats/<THERMOSTAT ID>/target_temperature_f?auth=<AUTH CODE>" -H "Content-Type: application/json" -d "65"
    
  • To change the specific structure to away. The value here is a string so be sure to include the single quotes:

    curl -v -L -X PUT "https://developer-api.nest.com/structures/<STRUCTURE ID>/away?auth=<AUTH_TOKEN>" -H "Content-Type: application/json" -d '"away"'
    

Credit for this is primarily to the following users: thesimm, mccv, Nagesh Susarla, and David W. Keith.


like image 181
jfudgeelder Avatar answered Oct 05 '22 15:10

jfudgeelder