[HOW TO] Add your TP-Link HS-100 Wifi outlets to SmartThings

Disregard. I started up a secondary node process using forever on a different port and was able to 2 of my HS105 mini plugs using this same plugin. Worked like a charm. Thanks for the awesome work on this.

Any update on Energy Monitoring support, please.

Chris,
Is it OK if I copy and modify your instructions. I want to use the modified instructions for the installation of my TP-Link LB1nn Light Bulb Device Handler. that will work similar to the HS-100 (but require a different gate node).

Absolutely, have at it :slight_smile:

Waiting on your update. Thanks.

I have completed all tests on the HS100 app. Been running w/o interruption for several weeks. One addition was to modify the TPLinkHS100Server.bat file to loop back and restart if an error causes the program to drop out. Basically, add a label before calling the node command, then a goto (the label) after. Commands are:

title TP-Link LB-1nn Family SmartThings Controller
prompt $_
Echo off
CLS
:startNode
date /t
time /t
node LB1nn.js
goto startNode

This allows the node to automatically restart in the event of a non-reboot issue.

1 Like

TP-Link LB1nn SmartThings Integration. The TP-Link LB1nn SmartThings integration is complete. Thanks to distructure00 and the developer of the HS100API, both of whose work was used in generating this work.

The integration has been tested on the LB-120 and LB-130 bulbs and is assumed to work on the LB-100 and LB-110 bulbs.

More information and a link to the code can be found at the thread:
“TP-Link LB-120 Control from SmartThings”, posting on Feb 9.

I pulled the container but how to run the container (with autostart)?

There are generic instructions on how to start docker containers on startup here, its just a preference.


https://docs.docker.com/engine/admin/host_integration/

If you are using QNAP or another NAS, there should be a checkbox somewhere to autostart.

Fantastic. Thanks for this OP. I’ve just finished transfering this from a Windows 10 based laptop to a Raspberry Pi Model B.

1 Like

I wanted to make note I did this on an Ubuntu system.

unifi@unifi-controller:~/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1$ sudo -s
[sudo] password for unifi: 
root@unifi-controller:~/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1# apt install npm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-headers-4.4.0-63
  linux-headers-4.4.0-63-generic linux-image-4.4.0-31-generic
  linux-image-4.4.0-62-generic linux-image-4.4.0-63-generic
  linux-image-extra-4.4.0-31-generic linux-image-extra-4.4.0-62-generic
  linux-image-extra-4.4.0-63-generic snap-confine
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  gyp javascript-common libjs-inherits libjs-jquery libjs-node-uuid
  libjs-underscore libssl-dev libssl-doc libuv1-dev node-abbrev node-ansi
  node-ansi-color-table node-archy node-async node-block-stream
  node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
  node-form-data node-fstream node-fstream-ignore node-github-url-from-git
  node-glob node-graceful-fs node-gyp node-inherits node-ini
  node-json-stringify-safe node-lockfile node-lru-cache node-mime
  node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
  node-normalize-package-data node-npmlog node-once node-osenv node-qs
  node-read node-read-package-json node-request node-retry node-rimraf
  node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
  node-underscore node-which nodejs-dev python-pkg-resources zlib1g-dev
Suggested packages:
  apache2 | lighttpd | httpd node-hawk node-aws-sign node-oauth-sign
  node-http-signature debhelper python-setuptools
The following NEW packages will be installed:
  gyp javascript-common libjs-inherits libjs-jquery libjs-node-uuid
  libjs-underscore libssl-dev libssl-doc libuv1-dev node-abbrev node-ansi
  node-ansi-color-table node-archy node-async node-block-stream
  node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
  node-form-data node-fstream node-fstream-ignore node-github-url-from-git
  node-glob node-graceful-fs node-gyp node-inherits node-ini
  node-json-stringify-safe node-lockfile node-lru-cache node-mime
  node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
  node-normalize-package-data node-npmlog node-once node-osenv node-qs
  node-read node-read-package-json node-request node-retry node-rimraf
  node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
  node-underscore node-which nodejs-dev npm python-pkg-resources zlib1g-dev
0 upgraded, 59 newly installed, 0 to remove and 1 not upgraded.
Need to get 5,246 kB of archives.
After this operation, 26.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main i386 python-pkg-resources all 20.7.0-1 [108 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 gyp all 0.1+20150913git1f374df9-1ubuntu1 [265 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial/main i386 javascript-common all 11 [6,066 B]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial/main i386 libjs-jquery all 1.11.3+dfsg-4 [161 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 libjs-node-uuid all 1.4.0-1 [11.1 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial/main i386 libjs-underscore all 1.7.0~dfsg-1ubuntu1 [46.7 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu xenial/main i386 zlib1g-dev i386 1:1.2.8.dfsg-2ubuntu4 [167 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 libssl-dev i386 1.0.2g-1ubuntu4.6 [1,133 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 libssl-doc all 1.0.2g-1ubuntu4.6 [1,079 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 libuv1-dev i386 1.8.0-1 [77.1 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-async all 0.8.0-1 [22.2 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-node-uuid all 1.4.0-1 [2,530 B]
Get:13 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-underscore all 1.7.0~dfsg-1ubuntu1 [3,780 B]
Get:14 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 libjs-inherits all 2.0.1-3 [2,794 B]
Get:15 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-abbrev all 1.0.5-2 [3,592 B]
Get:16 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-ansi all 0.3.0-2 [8,590 B]
Get:17 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-ansi-color-table all 1.0.0-1 [4,478 B]
Get:18 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-archy all 0.0.2-1 [3,660 B]
Get:19 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-inherits all 2.0.1-3 [3,060 B]
Get:20 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-block-stream all 0.0.7-1 [4,832 B]
Get:21 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-delayed-stream all 0.0.5-1 [4,750 B]
Get:22 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-combined-stream all 0.0.5-1 [4,958 B]
Get:23 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-cookie-jar all 0.3.1-1 [3,746 B]
Get:24 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-forever-agent all 0.5.1-1 [3,194 B]
Get:25 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-mime all 1.3.4-1 [11.9 kB]
Get:26 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-form-data all 0.1.0-1 [6,412 B]
Get:27 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-rimraf all 2.2.8-1 [5,702 B]
Get:28 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-mkdirp all 0.5.0-1 [4,690 B]
Get:29 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-graceful-fs all 3.0.2-1 [7,102 B]
Get:30 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-fstream all 0.1.24-1 [19.5 kB]
Get:31 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-lru-cache all 2.3.1-1 [5,674 B]
Get:32 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-sigmund all 1.0.0-1 [3,818 B]
Get:33 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-minimatch all 1.0.0-1 [14.0 kB]
Get:34 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-fstream-ignore all 0.0.6-2 [5,586 B]
Get:35 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-github-url-from-git all 1.1.1-1 [3,138 B]
Get:36 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-once all 1.1.1-1 [2,608 B]
Get:37 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-glob all 4.0.5-1 [13.2 kB]
Get:38 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 nodejs-dev i386 4.2.6~dfsg-1ubuntu4.1 [265 kB]
Get:39 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-nopt all 3.0.1-1 [9,544 B]
Get:40 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-npmlog all 0.0.4-1 [5,844 B]
Get:41 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-osenv all 0.1.0-1 [3,772 B]
Get:42 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-tunnel-agent all 0.3.1-1 [4,018 B]
Get:43 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-json-stringify-safe all 5.0.0-1 [3,544 B]
Get:44 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-qs all 2.2.4-1 [7,574 B]
Get:45 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-request all 2.26.1-1 [14.5 kB]
Get:46 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-semver all 2.1.0-2 [16.2 kB]
Get:47 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-tar all 1.0.3-2 [17.5 kB]
Get:48 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-which all 1.0.5-2 [3,678 B]
Get:49 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-gyp all 3.0.3-2ubuntu1 [23.2 kB]
Get:50 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-ini all 1.1.0-1 [4,770 B]
Get:51 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-lockfile all 0.4.1-1 [5,450 B]
Get:52 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-mute-stream all 0.0.4-1 [4,096 B]
Get:53 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-normalize-package-data all 0.2.2-1 [9,286 B]
Get:54 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-read all 1.0.5-1 [4,314 B]
Get:55 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-read-package-json all 1.2.4-1 [7,780 B]
Get:56 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-retry all 0.6.0-1 [6,172 B]
Get:57 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-sha all 1.2.3-1 [4,272 B]
Get:58 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 node-slide all 1.1.4-1 [6,118 B]
Get:59 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 npm all 3.5.2-0ubuntu4 [1,586 kB]
Fetched 5,246 kB in 1s (4,367 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package python-pkg-resources.
(Reading database ... 288115 files and directories currently installed.)
Preparing to unpack .../python-pkg-resources_20.7.0-1_all.deb ...
Unpacking python-pkg-resources (20.7.0-1) ...
Selecting previously unselected package gyp.
Preparing to unpack .../gyp_0.1+20150913git1f374df9-1ubuntu1_all.deb ...
Unpacking gyp (0.1+20150913git1f374df9-1ubuntu1) ...
Selecting previously unselected package javascript-common.
Preparing to unpack .../javascript-common_11_all.deb ...
Unpacking javascript-common (11) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../libjs-jquery_1.11.3+dfsg-4_all.deb ...
Unpacking libjs-jquery (1.11.3+dfsg-4) ...
Selecting previously unselected package libjs-node-uuid.
Preparing to unpack .../libjs-node-uuid_1.4.0-1_all.deb ...
Unpacking libjs-node-uuid (1.4.0-1) ...
Selecting previously unselected package libjs-underscore.
Preparing to unpack .../libjs-underscore_1.7.0~dfsg-1ubuntu1_all.deb ...
Unpacking libjs-underscore (1.7.0~dfsg-1ubuntu1) ...
Selecting previously unselected package zlib1g-dev:i386.
Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb ...
Unpacking zlib1g-dev:i386 (1:1.2.8.dfsg-2ubuntu4) ...
Selecting previously unselected package libssl-dev:i386.
Preparing to unpack .../libssl-dev_1.0.2g-1ubuntu4.6_i386.deb ...
Unpacking libssl-dev:i386 (1.0.2g-1ubuntu4.6) ...
Selecting previously unselected package libssl-doc.
Preparing to unpack .../libssl-doc_1.0.2g-1ubuntu4.6_all.deb ...
Unpacking libssl-doc (1.0.2g-1ubuntu4.6) ...
Selecting previously unselected package libuv1-dev:i386.
Preparing to unpack .../libuv1-dev_1.8.0-1_i386.deb ...
Unpacking libuv1-dev:i386 (1.8.0-1) ...
Selecting previously unselected package node-async.
Preparing to unpack .../node-async_0.8.0-1_all.deb ...
Unpacking node-async (0.8.0-1) ...
Selecting previously unselected package node-node-uuid.
Preparing to unpack .../node-node-uuid_1.4.0-1_all.deb ...
Unpacking node-node-uuid (1.4.0-1) ...
Selecting previously unselected package node-underscore.
Preparing to unpack .../node-underscore_1.7.0~dfsg-1ubuntu1_all.deb ...
Unpacking node-underscore (1.7.0~dfsg-1ubuntu1) ...
Selecting previously unselected package libjs-inherits.
Preparing to unpack .../libjs-inherits_2.0.1-3_all.deb ...
Unpacking libjs-inherits (2.0.1-3) ...
Selecting previously unselected package node-abbrev.
Preparing to unpack .../node-abbrev_1.0.5-2_all.deb ...
Unpacking node-abbrev (1.0.5-2) ...
Selecting previously unselected package node-ansi.
Preparing to unpack .../node-ansi_0.3.0-2_all.deb ...
Unpacking node-ansi (0.3.0-2) ...
Selecting previously unselected package node-ansi-color-table.
Preparing to unpack .../node-ansi-color-table_1.0.0-1_all.deb ...
Unpacking node-ansi-color-table (1.0.0-1) ...
Selecting previously unselected package node-archy.
Preparing to unpack .../node-archy_0.0.2-1_all.deb ...
Unpacking node-archy (0.0.2-1) ...
Selecting previously unselected package node-inherits.
Preparing to unpack .../node-inherits_2.0.1-3_all.deb ...
Unpacking node-inherits (2.0.1-3) ...
Selecting previously unselected package node-block-stream.
Preparing to unpack .../node-block-stream_0.0.7-1_all.deb ...
Unpacking node-block-stream (0.0.7-1) ...
Selecting previously unselected package node-delayed-stream.
Preparing to unpack .../node-delayed-stream_0.0.5-1_all.deb ...
Unpacking node-delayed-stream (0.0.5-1) ...
Selecting previously unselected package node-combined-stream.
Preparing to unpack .../node-combined-stream_0.0.5-1_all.deb ...
Unpacking node-combined-stream (0.0.5-1) ...
Selecting previously unselected package node-cookie-jar.
Preparing to unpack .../node-cookie-jar_0.3.1-1_all.deb ...
Unpacking node-cookie-jar (0.3.1-1) ...
Selecting previously unselected package node-forever-agent.
Preparing to unpack .../node-forever-agent_0.5.1-1_all.deb ...
Unpacking node-forever-agent (0.5.1-1) ...
Selecting previously unselected package node-mime.
Preparing to unpack .../node-mime_1.3.4-1_all.deb ...
Unpacking node-mime (1.3.4-1) ...
Selecting previously unselected package node-form-data.
Preparing to unpack .../node-form-data_0.1.0-1_all.deb ...
Unpacking node-form-data (0.1.0-1) ...
Selecting previously unselected package node-rimraf.
Preparing to unpack .../node-rimraf_2.2.8-1_all.deb ...
Unpacking node-rimraf (2.2.8-1) ...
Selecting previously unselected package node-mkdirp.
Preparing to unpack .../node-mkdirp_0.5.0-1_all.deb ...
Unpacking node-mkdirp (0.5.0-1) ...
Selecting previously unselected package node-graceful-fs.
Preparing to unpack .../node-graceful-fs_3.0.2-1_all.deb ...
Unpacking node-graceful-fs (3.0.2-1) ...
Selecting previously unselected package node-fstream.
Preparing to unpack .../node-fstream_0.1.24-1_all.deb ...
Unpacking node-fstream (0.1.24-1) ...
Selecting previously unselected package node-lru-cache.
Preparing to unpack .../node-lru-cache_2.3.1-1_all.deb ...
Unpacking node-lru-cache (2.3.1-1) ...
Selecting previously unselected package node-sigmund.
Preparing to unpack .../node-sigmund_1.0.0-1_all.deb ...
Unpacking node-sigmund (1.0.0-1) ...
Selecting previously unselected package node-minimatch.
Preparing to unpack .../node-minimatch_1.0.0-1_all.deb ...
Unpacking node-minimatch (1.0.0-1) ...
Selecting previously unselected package node-fstream-ignore.
Preparing to unpack .../node-fstream-ignore_0.0.6-2_all.deb ...
Unpacking node-fstream-ignore (0.0.6-2) ...
Selecting previously unselected package node-github-url-from-git.
Preparing to unpack .../node-github-url-from-git_1.1.1-1_all.deb ...
Unpacking node-github-url-from-git (1.1.1-1) ...
Selecting previously unselected package node-once.
Preparing to unpack .../node-once_1.1.1-1_all.deb ...
Unpacking node-once (1.1.1-1) ...
Selecting previously unselected package node-glob.
Preparing to unpack .../node-glob_4.0.5-1_all.deb ...
Unpacking node-glob (4.0.5-1) ...
Selecting previously unselected package nodejs-dev.
Preparing to unpack .../nodejs-dev_4.2.6~dfsg-1ubuntu4.1_i386.deb ...
Unpacking nodejs-dev (4.2.6~dfsg-1ubuntu4.1) ...
Selecting previously unselected package node-nopt.
Preparing to unpack .../node-nopt_3.0.1-1_all.deb ...
Unpacking node-nopt (3.0.1-1) ...
Selecting previously unselected package node-npmlog.
Preparing to unpack .../node-npmlog_0.0.4-1_all.deb ...
Unpacking node-npmlog (0.0.4-1) ...
Selecting previously unselected package node-osenv.
Preparing to unpack .../node-osenv_0.1.0-1_all.deb ...
Unpacking node-osenv (0.1.0-1) ...
Selecting previously unselected package node-tunnel-agent.
Preparing to unpack .../node-tunnel-agent_0.3.1-1_all.deb ...
Unpacking node-tunnel-agent (0.3.1-1) ...
Selecting previously unselected package node-json-stringify-safe.
Preparing to unpack .../node-json-stringify-safe_5.0.0-1_all.deb ...
Unpacking node-json-stringify-safe (5.0.0-1) ...
Selecting previously unselected package node-qs.
Preparing to unpack .../node-qs_2.2.4-1_all.deb ...
Unpacking node-qs (2.2.4-1) ...
Selecting previously unselected package node-request.
Preparing to unpack .../node-request_2.26.1-1_all.deb ...
Unpacking node-request (2.26.1-1) ...
Selecting previously unselected package node-semver.
Preparing to unpack .../node-semver_2.1.0-2_all.deb ...
Unpacking node-semver (2.1.0-2) ...
Selecting previously unselected package node-tar.
Preparing to unpack .../node-tar_1.0.3-2_all.deb ...
Unpacking node-tar (1.0.3-2) ...
Selecting previously unselected package node-which.
Preparing to unpack .../node-which_1.0.5-2_all.deb ...
Unpacking node-which (1.0.5-2) ...
Selecting previously unselected package node-gyp.
Preparing to unpack .../node-gyp_3.0.3-2ubuntu1_all.deb ...
Unpacking node-gyp (3.0.3-2ubuntu1) ...
Selecting previously unselected package node-ini.
Preparing to unpack .../node-ini_1.1.0-1_all.deb ...
Unpacking node-ini (1.1.0-1) ...
Selecting previously unselected package node-lockfile.
Preparing to unpack .../node-lockfile_0.4.1-1_all.deb ...
Unpacking node-lockfile (0.4.1-1) ...
Selecting previously unselected package node-mute-stream.
Preparing to unpack .../node-mute-stream_0.0.4-1_all.deb ...
Unpacking node-mute-stream (0.0.4-1) ...
Selecting previously unselected package node-normalize-package-data.
Preparing to unpack .../node-normalize-package-data_0.2.2-1_all.deb ...
Unpacking node-normalize-package-data (0.2.2-1) ...
Selecting previously unselected package node-read.
Preparing to unpack .../node-read_1.0.5-1_all.deb ...
Unpacking node-read (1.0.5-1) ...
Selecting previously unselected package node-read-package-json.
Preparing to unpack .../node-read-package-json_1.2.4-1_all.deb ...
Unpacking node-read-package-json (1.2.4-1) ...
Selecting previously unselected package node-retry.
Preparing to unpack .../node-retry_0.6.0-1_all.deb ...
Unpacking node-retry (0.6.0-1) ...
Selecting previously unselected package node-sha.
Preparing to unpack .../node-sha_1.2.3-1_all.deb ...
Unpacking node-sha (1.2.3-1) ...
Selecting previously unselected package node-slide.
Preparing to unpack .../node-slide_1.1.4-1_all.deb ...
Unpacking node-slide (1.1.4-1) ...
Selecting previously unselected package npm.
Preparing to unpack .../npm_3.5.2-0ubuntu4_all.deb ...
Unpacking npm (3.5.2-0ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for doc-base (0.10.7) ...
Processing 3 added doc-base files...
Setting up python-pkg-resources (20.7.0-1) ...
Setting up gyp (0.1+20150913git1f374df9-1ubuntu1) ...
Setting up javascript-common (11) ...
Setting up libjs-jquery (1.11.3+dfsg-4) ...
Setting up libjs-node-uuid (1.4.0-1) ...
Setting up libjs-underscore (1.7.0~dfsg-1ubuntu1) ...
Setting up zlib1g-dev:i386 (1:1.2.8.dfsg-2ubuntu4) ...
Setting up libssl-dev:i386 (1.0.2g-1ubuntu4.6) ...
Setting up libssl-doc (1.0.2g-1ubuntu4.6) ...
Setting up libuv1-dev:i386 (1.8.0-1) ...
Setting up node-async (0.8.0-1) ...
Setting up node-node-uuid (1.4.0-1) ...
Setting up node-underscore (1.7.0~dfsg-1ubuntu1) ...
Setting up libjs-inherits (2.0.1-3) ...
Setting up node-abbrev (1.0.5-2) ...
Setting up node-ansi (0.3.0-2) ...
Setting up node-ansi-color-table (1.0.0-1) ...
Setting up node-archy (0.0.2-1) ...
Setting up node-inherits (2.0.1-3) ...
Setting up node-block-stream (0.0.7-1) ...
Setting up node-delayed-stream (0.0.5-1) ...
Setting up node-combined-stream (0.0.5-1) ...
Setting up node-cookie-jar (0.3.1-1) ...
Setting up node-forever-agent (0.5.1-1) ...
Setting up node-mime (1.3.4-1) ...
Setting up node-form-data (0.1.0-1) ...
Setting up node-rimraf (2.2.8-1) ...
Setting up node-mkdirp (0.5.0-1) ...
Setting up node-graceful-fs (3.0.2-1) ...
Setting up node-fstream (0.1.24-1) ...
Setting up node-lru-cache (2.3.1-1) ...
Setting up node-sigmund (1.0.0-1) ...
Setting up node-minimatch (1.0.0-1) ...
Setting up node-fstream-ignore (0.0.6-2) ...
Setting up node-github-url-from-git (1.1.1-1) ...
Setting up node-once (1.1.1-1) ...
Setting up node-glob (4.0.5-1) ...
Setting up nodejs-dev (4.2.6~dfsg-1ubuntu4.1) ...
Setting up node-nopt (3.0.1-1) ...
Setting up node-npmlog (0.0.4-1) ...
Setting up node-osenv (0.1.0-1) ...
Setting up node-tunnel-agent (0.3.1-1) ...
Setting up node-json-stringify-safe (5.0.0-1) ...
Setting up node-qs (2.2.4-1) ...
Setting up node-request (2.26.1-1) ...
Setting up node-semver (2.1.0-2) ...
Setting up node-tar (1.0.3-2) ...
Setting up node-which (1.0.5-2) ...
Setting up node-gyp (3.0.3-2ubuntu1) ...
Setting up node-ini (1.1.0-1) ...
Setting up node-lockfile (0.4.1-1) ...
Setting up node-mute-stream (0.0.4-1) ...
Setting up node-normalize-package-data (0.2.2-1) ...
Setting up node-read (1.0.5-1) ...
Setting up node-read-package-json (1.2.4-1) ...
Setting up node-retry (0.6.0-1) ...
Setting up node-sha (1.2.3-1) ...
Setting up node-slide (1.1.4-1) ...
Setting up npm (3.5.2-0ubuntu4) ...
root@unifi-controller:~/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1# npm install
loadDep:hs100-api → resol ▄ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine hs100-api@0.3.0: wanted: {"node":">=4.4.0"} (current: {"node":"4.2.6hs-100-api-bridge@1.0.0 /home/unifi/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1
└── hs100-api@0.3.0 

root@unifi-controller:~/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1# node hs100.js
The program 'node' is currently not installed. You can install it by typing:
apt install nodejs-legacy
root@unifi-controller:~/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1# apt install nodejs-legacy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-headers-4.4.0-63
  linux-headers-4.4.0-63-generic linux-image-4.4.0-31-generic
  linux-image-4.4.0-62-generic linux-image-4.4.0-63-generic
  linux-image-extra-4.4.0-31-generic linux-image-extra-4.4.0-62-generic
  linux-image-extra-4.4.0-63-generic snap-confine
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  nodejs-legacy
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 27.7 kB of archives.
After this operation, 81.9 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 nodejs-legacy all 4.2.6~dfsg-1ubuntu4.1 [27.7 kB]
Fetched 27.7 kB in 0s (144 kB/s)         
Selecting previously unselected package nodejs-legacy.
(Reading database ... 293501 files and directories currently installed.)
Preparing to unpack .../nodejs-legacy_4.2.6~dfsg-1ubuntu4.1_all.deb ...
Unpacking nodejs-legacy (4.2.6~dfsg-1ubuntu4.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs-legacy (4.2.6~dfsg-1ubuntu4.1) ...
root@unifi-controller:~/Desktop/66b8ed43c1cb372e3811756a737397b2-f2d72911e57c44b5620f9bdeaffbd94a62d37ea1# node hs100.js
The HS-100 controller has started
Sun Mar 26 2017 18:08:57 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:08:59 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:00 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:00 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:01 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:02 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:02 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:02 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:03 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:03 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:03 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:03 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:03 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:04 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:04 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:09:04 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:09:04 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:11:26 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:11:27 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:11:29 GMT-0400 (EDT): ON command sent to 192.168.1.84
Sun Mar 26 2017 18:11:30 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Sun Mar 26 2017 18:11:37 GMT-0400 (EDT): ON command sent to 192.168.1.84
status
192.168.1.85:status
Sun Mar 26 2017 18:11:39 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Sun Mar 26 2017 18:13:00 GMT-0400 (EDT): ON command sent to 192.168.1.84
Sun Mar 26 2017 18:13:01 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:13:13 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Sun Mar 26 2017 18:13:13 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:13:26 GMT-0400 (EDT): ON command sent to 192.168.1.84
Sun Mar 26 2017 18:13:26 GMT-0400 (EDT): ON command sent to 192.168.1.85
Sun Mar 26 2017 18:13:42 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Sun Mar 26 2017 18:13:42 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
status
192.168.1.84:status
status
192.168.1.85:status
Mon Mar 27 2017 00:15:11 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 00:15:14 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 00:15:16 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 00:15:18 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 00:15:20 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 00:15:25 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 00:15:26 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 00:15:27 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 00:15:28 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 00:15:29 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
status
192.168.1.85:status
status
192.168.1.85:status
Mon Mar 27 2017 07:01:20 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 07:01:20 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:30:35 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 14:30:35 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:30:37 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 14:30:39 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:30:43 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 14:30:43 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:30:52 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 14:30:55 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 14:30:56 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:30:58 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:30:58 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:30:59 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:30:59 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:30:59 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:31:00 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:31:00 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:31:00 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:31:00 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:32:17 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:32:20 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:32:21 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 14:32:22 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 14:32:47 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:32:48 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:32:50 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:32:50 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:32:50 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:32:50 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:32:50 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:32:51 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:32:52 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:33:00 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:33:02 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:33:03 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
Mon Mar 27 2017 14:33:05 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 14:33:06 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 14:33:21 GMT-0400 (EDT): ON command sent to 192.168.1.84
Mon Mar 27 2017 14:33:22 GMT-0400 (EDT): OFF commmand sent to  192.168.1.84
Mon Mar 27 2017 14:33:23 GMT-0400 (EDT): ON command sent to 192.168.1.85
Mon Mar 27 2017 14:33:23 GMT-0400 (EDT): OFF commmand sent to  192.168.1.85
status
192.168.1.85:status

Current status on TP-Link integration. I have a single node.js bridge that controls both the plugs/switches and bulbs. All functionality except encryption have been moved to the groovy application (reducing total code and improving performance), and the need for the bulb or plug API files has been eliminated.
I relied heavily on the HS-100 API files for guidance as well as the encryption and communications code and on destructure00 for the basis of instructions.
Location: https://github.com/DaveGut/TP-Link-Smarthings-with-Server

NEXT. Integrate discovery into the bridge and find or create a groovy service manager that will manage the device discovery process so that this integration looks similar to the Hue Bridge integration. Rationale. I am thinking of an eventual bridgeless integration when and if Smartthings supports the requisite communications protocols over the LAN.

Is there a way to make the port static. It’s changing everytime the container restarts.

A new PC Bridge SmartThings device has been created. Functions are very basic:

Connects to a node.js applet on your PC Bridge for
a. Monitoring applet status.
b. RESTART the PC.

Location:

It is also integrated with my TP-Link bulb, plug, and switch integration, monitoring the state of the node.js applet associated with that integration. This is a separate groovy file (to keep user interface clean).

Firstly, thanks for posting output. That’s really helpful for other linux users.

I’ve noticed two things that I think it’s worth mentioning:

  1. On a linux system with sudo there’s not really any need to do sudo -s just for installs. Ubuntu especially sets a timeout from the first sudo request that keeps you authenticated for the next few minutes so followup commands don’t require re-entering a password
  2. Regarding the nodejs-legacy package. There is a naming clash with a prior package called node that’s nothing to do with nodejs on several linux flavours (including Ubuntu), so the launch command is usually nodejs (as is the name of the package). The nodejs-legacy package allows linux systems to launch scripts with node instead.

Therefore, the simplest install command on Ubuntu (for ease of use) is:

sudo apt install npm nodejs-legacy

You need to set your router (or whatever is assigning IPs via DHCP) to reserve an address.

The exact process varies from router to router, but essentially:

  1. Log in to your router as an administrator (mine is at 192.168.1.1. The username and password are often either on the bottom of the router or on a card that came with it)
  2. Find a section about DHCP (sometimes behind an ‘Advanced’ confirmation box)
  3. Find the option to Add a new reservation. Might also be called a “Static assignment” or “MAC assignment”
  4. For this you will definitely need to know the MAC address of your switch, which you can find in Device Info in the Kasa mobile app. It’s a string of six pairs of numbers and letters in the form 00:11:22:AA:BB:CC
  5. Enter the MAC address where prompted and an IP address to map it to. I’ve got my router set to assign dynamic IPs below .200 so I assign any static ones above that. There are multiple routers in my setup so I need to be a bit careful, but generally pick a range and start sticking them in. My first two sockets are on 192.168.1.201 and 192.168.1.202, for example
  6. Save your settings.
  7. Power off (unplug/disconnect) your switches
  8. Power cycle your router
  9. Reconnect your switches

Hope that’s helpful. If you get stuck, let me know.

Thanks @jymbob for this. I have already done this to make the ipaddress static. What I am referring to is to make the assigned PORT on Container static also.

Ah. I’m not using it with Docker. I have a linux media server that is up for months at a time, so the node file is just running in a screen instance at the moment. If/when it falls over I’ll look into something more permanent (o;

It looks like you may need to change your run script to include a -p flag (cf here) but as I say, I’m no expert in Docker setups.

Hey, Ive installed this to control my HS100 plugs, but not having much success:/
Ive set ip reservations on the win10 VM and also the power plug (running pfSense).
When I try to turn the plugs on/off in Smartthings, nothing happens, but there seems to be traffic going on.
The Node.js on the Win10 VM does have entries every time I press…

Suggestions?

What does your VM show?
My terminal has entries like this:

Sun May 07 2017 22:56:18 GMT+0100 (BST): OFF commmand sent to  192.168.1.201
Sun May 07 2017 23:11:43 GMT+0100 (BST): OFF commmand sent to  192.168.1.203
Sun May 07 2017 23:11:43 GMT+0100 (BST): OFF commmand sent to  192.168.1.201
Mon May 08 2017 08:00:01 GMT+0100 (BST): ON command sent to 192.168.1.203
Mon May 08 2017 11:31:14 GMT+0100 (BST): ON command sent to 192.168.1.201

What happens if you ping those IPs from inside your VM?

testing@gTok:~$ ping 192.168.1.203
PING 192.168.1.203 (192.168.1.203) 56(84) bytes of data.
64 bytes from 192.168.1.203: icmp_seq=1 ttl=64 time=8.68 ms
64 bytes from 192.168.1.203: icmp_seq=2 ttl=64 time=2.32 ms
^C
--- 192.168.1.203 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.323/5.501/8.680/3.179 ms

I also tested my plugs were working beforehand with this python script

HTH