lib nest

OverviewPrerequisitesConnectivitySupported PointsLearn

Overview

The Nest library implements connector support for the Google Smart Device Management (SDM) API. The SDM API allows you to retrieve sensor data from Google Nest devices.

Prerequisites

Before your can use the nest connector, you must complete the steps in the Google Device Access Quick Start Guide. After completing this guide you should have obtained the following information:

  1. A project id from the Device Access project you created
  2. The following OAuth settings:
    1. client_id
    2. client_secret
    3. refresh_token

Make a note of the those values since you will need them to setup the connector.

Connectivity

The SDM API is a RESTful API over HTTPS. You can connect to devices in your device access project by creating a nestConn rec (the values in <> are obtained by completing the prerequisites):

dis: "Nest Connector"
conn
nestConn
nestProjectId: "<project-id>"
nestClientId: "<oauth-client-id>"
nestClientSecret: "<oauth-client-secret>"
nestRefreshToken: "<oauth-refresh-token>"

Supported Points

The nest connector uses the nestCur tag to get the current value of a particular device "trait". This value is specified as:

<point-address> := <device-id>:<trait>
<trait> := <trait-name>.<trait-field>
<device-id>, <trait-name>, <trait-field> := Str

For example, if you have a thermostat with device id THERM-123, you can obtain the current room temperature by setting nestCur to THERM-123:Temperature.ambientTemperatureCelsius

The following section detail the supported devices and traits that can be mapped to points. Note: the nest connector currently supports only Thermostat devices.

Thermostat

The following trait's are supported for Nest Thermostats:

  • Humidity.ambientHumidityPercent - the humidity measured at the device
  • Temperature.ambientTermperatureCelsius - the temperature, measured in degrees Celsius, measured at the device
  • ThermostatMode.mode - the current thermostat mode (e.g. HEAT)
  • ThermostatHavac.status - the current HVAC status of the thermostat (e.g. HEATING)
  • ThermostatTemperatureSetpoint.heatCelsius - the target temperature when the thermostat is in HEAT or HEATCOOL mode
  • ThermostatTemperatureSetpoint.coolCelsius - the target temperature when the thermostat is in COOL or HEATCOOL mode

The thermostat mode, aand heating/cooling setpoints can be written if the nestWrite tag is configured for those points. If you use connLearn(), then these tags will be automatically applied for you.

Learn

The nest connector supports connLearn() to learn points from your devices. This is the easiest way to discover and add points to your project.