caseyjhol / node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link Smart Home devices
https://www.npmjs.com/package/node-red-contrib-tplink-iot
MIT License
16 stars 15 forks source link

node-red-contrib-tplink

TP-Link Smart Home Node-Red Nodes

GitHub release NPM Version GitHub last commit

Node version GitHub repo size in bytes

Github All Releases

npm GitHub contributors contributions welcome

This is a Node-RED node that allows you to control smart plugs, switches, and bulbs from the TP-Link Kasa Smart ecosystem.

Under the hood, this uses 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

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. To specify a plug in a multi-plug device, append a / followed by the plug number (zero-indexed). Use is optional. Alternatively, or additionally, an input message can include msg.topic with a device IP (and optional plug number). Examples: 192.168.1.101 or 192.168.1.101/3

Connection poll interval - Interval that is used to poll availability of devices (>500ms / Recommended 5000-10000ms). Set to 0 to disable availability checks (in which case, OnlineEvents will not trigger, even if started).

Event poll interval - Interval that is used to poll active devices for events (>500ms / Recommended 1000-3000ms). Set to 0 to disable event polling (in which case, all events except OnlineEvents will not trigger, even if started).

Output payload - Types are info, none, string, number, boolean, JSON, and timestamp. Default type is info with a value of getInfo. If set to info, the selected payload command will be fired after completion, and the payload set accordingly. Output payload is ignored if the node input is a command or an event, in which case see below for more information

Debug - If enabled, will output device information to the flow editor debug tab.

Inputs

Send in a message to control, command, or start/stop events.

Controls

Control a device by setting its properties.

string | Object

Commands

string

Events

string | array | Object

Multiple event actions can be sent at once, either as an array or as a string separated by "|". Alternatively, an array or string can be sent in the events property of an object. Examples:

['startMeterEvents', 'stopPowerEvents']

or

{ events: 'startMeterEvents|stopPowerEvents' }

For developers

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.png?downloads=true&downloadRank=true&stars=true