A node.js library for the RoboSmart
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json
test.js

README.md

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

Must be called after connecting, for other API's to work.

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