New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bayweb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bayweb

Control BAYweb internet thermostats

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

A node.js client for controlling BAYweb Internet thermostats.

Build Status

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 = require('bayweb');

var stat = new Thermostat('ID', 'APIKEY', function(err) {
  if (err)
    console.log('Error fetching data from BAYweb server: ' + err);
  else
    console.log('Loaded data from BAYweb server!');
});

Once data is fetched, you can access the following properties...

stat.insideTemp;       // integer indoor temperature
stat.insideHum;        // integer humidity reading
stat.activitySetPoint; // integer set point of current activity
stat.outsideTemp;      // integer outdoor temperature (provided by outdoor sensor or Cloud EMS)
stat.outsideHum;       // integer outdoor humidity (provided by Cloud EMS)
stat.windMph;          // integer wind speed (provided by Cloud EMS)
stat.solarIndex;       // integer solar index (provided by Cloud EMS)
stat.doorOpen;         // boolean is the door open?
stat.relay1;           // boolean is relay 1 (w2) open?
stat.relay2;           // boolean is relay 2 (y2) open?
stat.input1;           // if digital, boolean is input open? otherwise, integer temperature
stat.input2;           // if digital, boolean is input open? otherwise, integer temperature
stat.input3;           // if digital, boolean is input open? otherwise, integer temperature

In addition, the following properties can be accessed and modified...

stat.activity;         // string 'occupied', 'away 1', 'away 2', or 'sleep'
stat.mode;             // string 'off', 'heat', or 'cool'
stat.hold;             // boolean true to hold temperature
stat.fan;              // string 'auto' or 'on'
stat.setPoint;         // integer value of the desired temperature set point

Make changes and save them to Cloud EMS...

// set thermostat
stat.mode = 'cool';
stat.activity = 'occupied';
stat.setPoint = 76;

// save settings
stat.save(function(err) {
  if (err)
    return console.err(err)
  console.log('Saved!');
});

Refresh data from Cloud EMS...

stat.fetch(function(err) {
  if (err)
    console.log('Error fetching data from BAYweb server: ' + err);
  else
    console.log('Loaded data from BAYweb server!');
});

FAQs

Package last updated on 20 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts