0.2.3 • Published 7 years ago

node-rwe-smarterhome-lib v0.2.3

Weekly downloads
2
License
GPL-2.0
Repository
github
Last release
7 years ago

RWE-SmarterHome Lib

RWE-SmarterHome is a Node.JS library for the RWE-SmartHome which directly communicates with the SmartHome central.

    var sh = require("./lib/smarthome");
    var smartHome = new sh("192.168.1.17");
    var DO_EXIT = false;
    
    smartHome.login("USERNAME", "PASSWORD", function (res, error) {
        if (res) {
            console.log("LOGIN COMPLETE");
    
            smartHome.init(function () {
                console.log("INIT COMPLETE");
    
                var devices = smartHome.devices;
    
                devices.forEach(function (device) {
                    console.log(device.Name + " (" + device.Id + ", " + device.Type + "): " + device.getFriendlyState());
                });
    
                var p = smartHome.getDeviceByName("Test");
                
                if (p)
                    p.setState(true);
    
            });
    
            smartHome.on("StatusChanged", function (device) {
                console.log("DEVICE STATUS CHANGED", device.Name, device.getFriendlyState());
            });
        } else {
            console.log("LOGIN ERROR", error);
        }
    });
    
    (function wait() {
        if (!DO_EXIT) setTimeout(wait, 1000);
    })();
0.2.3

7 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

1.0.0

8 years ago