Skip to content

fabsenet/node-red-contrib-tplink-iot

 
 

Repository files navigation

node-red-contrib-tplink-iot

TP-Link Smart Home Node-Red Nodes

GitHub release NPM Version GitHub last commit

Node version GitHub repo size in bytes CodeFactor

Github All Releases Liberapay receiving

npm GitHub contributors contributions welcome

This is a collection of Node-RED nodes that allow you control smart plugs and bulbs from the TP-Link smart home ecosystem.

This is a fork of so inspiring node-red-contrib-tplink-smarthome with added functionality.

Under the hood, each node uses the awesome TP-Link Smart Home API.

Installation

Run the following command in the root directory of your Node-RED install

$ npm install node-red-contrib-tplink-iot

or you can use the Palette Manager in Node-RED.

Parameters

Name - Type in the name of the host manually or keep the default device name

Device IP - Type in the Device IP address manually or press the button to retrieve all locally available plug devices

Poll interval - Interval that is used to poll availability of devices (>500ms / Recommended 5000-10000ms)

Event poll interval - Interval that is used to poll active devices for events (>500ms / Recommended 1000-3000ms)

Inputs

payload: string | boolean

On/Off

true - Turn on the device.

false - Turn off the device.

switch - Toggle opposite power state of the device.

Brightness

brightness:[value 1-100]

Example: Send payload as brightness:25 to set brightness of the bulb to 25%.

Temperature

temperature:[value 2700-6500]

Example: Send payload as temperature:5000 to set temperature of the bulb to 5000k.

Commands

getInfo - Fetch the device information.

getCloudInfo - Fetch the device information from the cloud.

getQuickInfo - Fetch most popular proprieties, such as username, device consumption, mode, lighting state, and many more.

getMeterInfo - Fetch the current device consumption.

clearEvents - Unsubscribe events.

eraseStats - Clear all the meter statistics.

Events

getMeterEvents - Subscribe to meter information events.

getInfoEvents - Subscribe to information events.

getPowerUpdateEvents - Subscribe to power on/off events.

getInUseEvents - Subscribe to device usage events.

getOnlineEvents - Subscribe to online/offline events.

Multiple events can be used as a list separated with the | character.

For developers

Nodes are made available to Node-RED in .js files minimized by Google's Closure Compiler.

HOWEVER an original, up-to-date, file is included as .bak.js to easily modify code. Must be recompiled or copied as .js for code to reflect in you app.

This repo. is (mainly) coded on Node 10.3.0 with Node-RED 0.18.7 on Windows 10 Home Build 17134.81. Runs succesfully in a Raspberry Pi 3 Model B on standard Raspbian Stretch's Node 0.10.29 and matching Node-RED.

https://nodei.co/npm/node-red-contrib-tplink-iot.png?downloads=true&downloadRank=true&stars=true

About

A collection of Node-RED nodes for TP-Link Smart Home devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 57.7%
  • HTML 42.3%