/tplink-cloud-api

A node.js npm module to remotely control TP-Link smartplugs (HS100, HS110) and smartbulbs (LB100, LB110, LB120, LB130) using their cloud web service (no need to be on the same wifi/lan)

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Install with npm:

npm install --save tplink-cloud-api

Usage

const tplink = require('tplink-cloud-api')
async function main() { 
    let myTPlink = await tplink.login('username@example.com', 'Password','TermID')
    //Client/Terminal ID is generated if not specified
    let deviceList = await myTPlink.getDeviceList()
    //Generating device list is required
    let myDevice = me.getLB100("Device Alias");
    myDevice.transition_light_state(1,100)
}
main()

Requires Node.js > v7.7 (async)