A node.js client for controlling BAYweb Internet thermostats.
Usage
Simply create a new Thermostat using the ID and Key from your BAYweb Cloud EMS account. The callback is optional. If you provide one, then the thermostat data will be immediately fetched from Cloud EMS.
var Thermostat = ; var stat = 'ID' 'APIKEY' { if err console; else console;};
Once data is fetched, you can access the following properties...
statinsideTemp; // integer indoor temperaturestatinsideHum; // integer humidity readingstatactivitySetPoint; // integer set point of current activitystatoutsideTemp; // integer outdoor temperature (provided by outdoor sensor or Cloud EMS)statoutsideHum; // integer outdoor humidity (provided by Cloud EMS)statwindMph; // integer wind speed (provided by Cloud EMS)statsolarIndex; // integer solar index (provided by Cloud EMS)statdoorOpen; // boolean is the door open?statrelay1; // boolean is relay 1 (w2) open?statrelay2; // boolean is relay 2 (y2) open?statinput1; // if digital, boolean is input open? otherwise, integer temperaturestatinput2; // if digital, boolean is input open? otherwise, integer temperaturestatinput3; // if digital, boolean is input open? otherwise, integer temperature
In addition, the following properties can be accessed and modified...
statactivity; // string 'occupied', 'away 1', 'away 2', or 'sleep'statmode; // string 'off', 'heat', or 'cool'stathold; // boolean true to hold temperaturestatfan; // string 'auto' or 'on'statsetPoint; // integer value of the desired temperature set point
Make changes and save them to Cloud EMS...
// set thermostatstatmode = 'cool';statactivity = 'occupied';statsetPoint = 76; // save settingsstat;
Refresh data from Cloud EMS...
stat;