Socket Thermostat Using cylon.js

Fetching the ambient temperature of a thermostat using throwon.js errors I replaced ACCESS_TOKEN with my Access_token as well as the 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();

      

+3


source to share


1 answer


You need to make the module cylon

available in your project.



npm install --save cylon

      

+3


source







All Articles