TPLink HS100/HS110 WiFi Smart Plug API
var Hs100Api = require('hs100-api');
var hs = new Hs100Api({host: '10.0.1.2'});
hs.setPowerState(true);
hs.getInfo().then(console.log);
The API is currently not stable and there may be breaking changes. All functions return a promise.
config: { host [, port = 9999] }
Sends out a broadcast and waits for plugs to respond until the until the timeout is reached. If maxSearchCount is > 0 then stop waiting (return early) after that number of plugs respond. Returns an array of data matching getInfo for each plug.
Get general plug info.
Returns true if plug is on.
Turns the plug on or off.
Get power consumption data for HS110 plugs.
Get TP-Link Cloud information.
Get list of networks from last scan.
Thanks to George Georgovassilis and Thomas Baust for figuring out the HS1XX encryption. https://georgovassilis.blogspot.com/2016/05/controlling-tp-link-hs100-wi-fi-smart.html