Sample Code

Client-side integration

Python sample app

This app features the following integration functionality:

  • Select structures with a structure picker
  • Set the structure to Home or Away
  • View the Smoke+CO alarm status
  • View Camera status and images
  • Set Camera streaming
  • View Thermostat status and history
  • Schedule updates to Home/Away status
  • Schedule Cameras to turn on/off
Details
LanguagesPython and JavaScript
DevicesNest Learning Thermostat, Nest Cam, Nest Protect
Required Client PermissionsAway read/write / v2
Camera read/write + images / v3-v4
Thermostat read / v6
Smoke+CO read / v5
Source Codegithub.com/nestlabs/nest-python
Codelabhttps://codelabs.developers.google.com/codelabs/nest-ten-tips-for-success/

iOS sample app

A sample iPhone application that shows you how to:

  • Authorize a Works with Nest client using OAuth 2.0
  • Read Nest Thermostat devices using REST
  • Update Nest Thermostat devices using REST

This app features the following Thermostat integration functionality:

Details
LanguagesObjective-C
DevicesNest Learning Thermostat
Required Client PermissionsThermostat read/write / v1-v6
Source Codegithub.com/nestlabs/ios-NestDK

Android-SDK

Android-SDK is an Android-based Java library that shows you how to:

  • Authorize a Works with Nest client using OAuth 2.0
  • Listen for updates of Nest structures and devices using REST streaming
  • Update Nest structures and devices using REST
Details
LanguagesJava
LibrariesOkHttp
DevicesNest Learning Thermostat, Nest Protect, Nest Cam
Source Codegithub.com/nestlabs/android-sdk

Android sample app

A sample Android application based on Android-SDK that features the following Thermostat integration functionality:

Details
LanguagesJava
LibrariesNest Android-SDK
DevicesNest Learning Thermostat
Required Client PermissionsThermostat read/write / v1-v6
Away read/write / v1-v2
Source Codegithub.com/nestlabs/android-sdk-sample

Nest streaming dashboard

A web app that uses REST streaming to get real-time updates of Nest devices and display them in a browser using Node.js. The streaming dashboard shows you how to:

  • Authorize a Works with Nest client using OAuth 2.0
  • Listen for updates of all Nest structures and devices using REST streaming
  • Display updates in a web browser using Node.js
Details
LanguagesJavaScript
LibrariesNode.js, jQuery, Passport, JsRender
DevicesNest Learning Thermostat, Nest Protect, Nest Cam
Required Client PermissionsThermostat read / v1-v6
Smoke+CO read / v1-v5
Camera read + images / v1-v4
Away read / v1-v2
Source Codegithub.com/nestlabs/rest-streaming

Server-side integration

Nest-Twitter

Nest-Twitter is a server-based client created in Scala. Nest-Twitter shows you how to:

  • Create a Nest server-based integration using Scala and Java libraries
  • Authorize a Works with Nest client using OAuth 2.0
  • Handle errors
  • Implement listeners to respond to Nest data changes
  • Interact with the Nest API using Scala
  • Update Twitter status based on Nest data
Details
LanguagesJava, Scala
LibrariesFirebase, Java, Twitter
DevicesNest Learning Thermostat, Nest Protect
Required Client PermissionsThermostat read/write / v1-v6
Smoke+CO read / v1-v5
Away read/write / v1-v2
ETA write / v1-v2
Source Codegithub.com/nestlabs/nest-twitter