TP-Link Smartplug Control for Node
Functionality ported from https://github.com/softScheck/tplink-smartplug to Node.js.
This library allows you to control HS100 and HS110 devices from TP-Link from Node.
npm i tplink-smartplug-node
const TPLinkSmartPlug = ;let tp = "192.168.1.100";tp;
An example of all methods can be found in test.js.
Creates a new instance of the API. This does not connect to the plug yet.
Turns the plug on. Returns a promise resolving to the reply from the plug.
Turns the plug off. Returns a promise resolving to the reply from the plug.
Queries the state of the plug. Returns a promise resolving to the reply from the plug.
Get the readings from the Emeter (only supported on HS110).
Send a raw query object to the plug. A list of valid query objects can be found here.