Nest Home


Most people leave the house at one temperature and forget to change it. So the Nest Learning Thermostat learns your schedule, programs itself and can be controlled from your phone. Teach it well and the Nest Thermostat can lower your heating and cooling bills up to 20%.

For more information click here.

How To Connect

Cylon.robot({
  connections: {
    nest: { adaptor: 'nest', accessToken: 'ACCESS_TOKEN' }
  },

  devices: {
    home: { driver: 'nest-home', structureId: 'STRUCTURE_ID' }
  },
});

How To Use

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    nest: { adaptor: 'nest', accessToken: 'ACCESS_TOKEN' }
  },

  devices: {
    home: { driver: 'nest-home', structureId: 'STRUCTURE_ID' }
  },

  work: function(my) {

    my.home.on('status', function(data) {
      console.log('The Nest Home at a glance:', data);
    });

    every((10).seconds(), function(){
      console.log('Nest home structures:', my.home.structures());
      console.log('Nest home structure name:', my.home.structureName());
      console.log('Nest home thermostats:', my.home.thermostats());
      console.log('Nest home smokeCoAlarms:', my.home.smokeCoAlarms());
      console.log('Nest home away status:', my.home.away());
      console.log('Nest home eta:', my.home.eta());

      my.home.read('country_code', sId, function(data) {
        console.log("Nest home country id: ", data);
      });

      my.home.away('away');

    });
  }
}).start();

Commands

structures

Returns all structures the Nest API knows about

Returns

  • (Object) structures

getStructure

Gets a specific structure from the Structures reference

Params

  • structureId (Number) identifier of structure to get

Returns

  • (Object) structure

structureName

Gets name of specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (String) structure name

thermostats

Gets thermostats in specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (Array.<Object>) structure thermostats

smokeCoAlarms

Gets Smoke/Carbon Monoxide alarms in specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (Array.<Object>) structure Smoke/C0 alarms

devices

Gets devices in specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (Array.<Object>) structure devices

away

Gets the current away value of the structure, or assigns a new value if provided

Params

  • val (Number) new value for away

  • structureId (Number) identifier of structure to get

Returns

  • (Number null) structure away status

eta

Gets ETA for specified structure or assigns a new value if provided

Params

  • structureId (Number) identifier of structure to get

Returns

  • (Array.<Object>) structure ETA

countryCode

Gets Country Code for specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (String) structure Country Code

postalCode

Gets Postal Code for specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (String) structure Postal Code

peakPeriodStartTime

Gets Peak Period Start Time for specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (String) structure Peak Period Start Time

peakPeriodEndTime

Gets Peak Period End Time for specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (String) structure Peak Period End Time

timeZone

Gets Time Zone for specified structure

Params

  • structureId (Number) identifier of structure to get

Returns

  • (String) structure Time Zone

Events

status

Emitted with the home status on startup

Compatibility