Naresh Reddy
Naresh Reddy

Reputation: 179

Nest Thermostat Using cylon.js

Retrieving thermostat ambient Temperature using cylon.js throwing errors I replaced ACCESS_TOKEN with my Access_token and also device id

Code:

var Cylon = require('cylon');

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

  devices: {
    thermostat: { driver: 'nest-thermostat', deviceId: 'YOUR_DEVICE_ID' }
  },

  work: function() {
    every((10).seconds(), function(){
      var temp = my.thermostat.ambientTemperatureC();
      console.log('Ambient Temperature', temp);
    });
  }
}).start();

Upvotes: 3

Views: 231

Answers (1)

Trott
Trott

Reputation: 70163

You need to make the cylon module available in your project.

npm install --save cylon

Upvotes: 3

Related Questions