robosmart

0.2.0 • Public • Published

node-robosmart

Analytics

A Node.js library for the RoboSmart by Smart Home Labs.

Special thanks to @mrose17 for sending me a bulb!

Install

npm install robosmart

Usage

var RoboSmart = require('robosmart');

Discover

RoboSmart.discover(callback(roboSmart)); // Discovers first bulb to respond

Discover Multiple

RoboSmart.discoverAll(timeout, callback(devices)); // Returns array of devices discovered within timeout (2000ms seems adequate)

Connect

roboSmart.connect(callback);

Disconnect

roboSmart.disconnect(callback);

Discover Services and Characteristics

roboSmart.discoverServicesAndCharacteristics(callback);

isOn

roboSmart.isOn(callback(on));

switchOn

roboSmart.switchOn(callback);

switchOff

roboSmart.switchOff(callback);

getDim

roboSmart.getDim(callback(dim));

setDim

roboSmart.setDim(dim, callback); // dim: 0 - 255

getPowerConsumed

roboSmart.getPowerConsumed(callback(powerConsumed)); // watts per hour

getLightName

roboSmart.getLightName(callback(lightName));

setLightName

roboSmart.setLightName(lightName, callback(lightName)); // lightName is string

getGroupName

roboSmart.getGroupName(callback(groupName));

setGroupName

roboSmart.setGroupName(groupName, callback(groupName)); // groupName is string

getRoomName

roboSmart.getRoomName(callback(roomName));

setRoomName

roboSmart.setRoomName(roomName, callback(roomName)); // roomName is string

Package Sidebar

Install

npm i robosmart

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • sandeepmistry