0.2.0 • Published 10 years ago
robosmart v0.2.0
node-robosmart
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 respondDiscover 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 - 255getPowerConsumed
roboSmart.getPowerConsumed(callback(powerConsumed)); // watts per hourgetLightName
roboSmart.getLightName(callback(lightName));setLightName
roboSmart.setLightName(lightName, callback(lightName)); // lightName is stringgetGroupName
roboSmart.getGroupName(callback(groupName));setGroupName
roboSmart.setGroupName(groupName, callback(groupName)); // groupName is stringgetRoomName
roboSmart.getRoomName(callback(roomName));setRoomName
roboSmart.setRoomName(roomName, callback(roomName)); // roomName is string