New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-tplink

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link smart-home devices.

  • 0.4.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 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

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)

Payload - The 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. Payload is ignored if the node input is a command or an event.

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

Inputs

payload: Object | string | boolean | array

On/Off

{
	"state": true // true is "on", false is "off", "toggle" or "switch" sets the opposite power state
}

true - Turn on the device.

false - Turn off the device.

toggle - Toggle opposite power state of the device.

switch - Toggle opposite power state of the device. (deprecated)

Multi-Plug On/Off

{
	"plug": 1 // whole number corresponding to "Plug" number on power strip.  Optional.
	"state": true // true is "on", false is "off", "toggle" or "switch" sets the opposite power state
}

Brightness

{
	"brightness": [value 1-100]
}

LED Status Light

{
	"led": true // true is "on", false is "off"
}

Temperature

temperature:[value 2700-6500]

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

Color Support for Multicolor Bulbs

Hue, Saturation, and Brightness (HSB) support for multicolor bulbs.

{
  "hsb": {
    "hue": 240,
    "saturation": 15,
    "brightness": 100
  }
}

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. Supports multi-plug.

getMeterInfo - Fetch the current device consumption. Supports multi-plug.

clearEvents - Unsubscribe events.

eraseStats - Clear all the meter statistics. Supports multi-plug.

Events

getMeterEvents - Subscribe to meter information events. Event emits on event polling interval.

getInfoEvents - Subscribe to information events.

getPowerEvents - Subscribe to power on/off events. Event emits on device/plug change.

getPowerUpdateEvents - Subscribe to power on/off events. Event emits on event polling interval.

getInUseEvents - Subscribe to device usage events. Event emits on device/plug change.

getInUseUpdateEvents - Subscribe to device usage events. Event emits on event polling interval.

getOnlineEvents - Subscribe to online/offline events. Event emits on poll interval.

Multiple events can be used as an array via the events property or string separated by "|"..

{
	"events": ["getMeterUpdateEvents", "getPowerEvents"]
}

or

"getMeterUpdateEvents|getPowerEvents"

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

Keywords

FAQs

Package last updated on 09 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc