TP-LINK HS110 Smart Plug w/ Energy Monitoring, Wi-Fi Enabled


(Daniel) #1

TP-Link HS110

Anyone know if this is compatible with a Smartthings 2nd Gen Hub?


[HOW TO] Add your TP-Link HS-100 Wifi outlets to SmartThings
TP-Link Outlet and Switch on Amazon Daily Specials
(Kurt Sanders) #2

I don’t believe it has either Z-Wave or zigbee protocols, so one would have to develop a custom SmartApp to control over http (if that is available to the device).


TP-Link Wifi Switch and Outlet
(Geko) #3

This sells for just $22.95 on Amazon, cheaper than most Zigbee and Z-Wave smart plugs and in compatible with Echo. Have anyone tried to integrate it with ST?


(Eli) #4

It is now even 19.99… would be great if integrated with ST.


(Chris) #5

I have 3 of these at home that I’m replacing with z-wave outlets since I can’t control them from ST. I’d love to be able to integrate them. They are wifi-connected and run exclusively off the Kasa app, there’s no web interface available. There is remote capability though, I can control them when I’m not at home. Not sure if it’s possible to write a smartapp to control these, but it would be pretty awesome.


(Chris) #6

TP Link has the GPL source code for the HS100 here, I’m not a developer so I’m not sure if this is helpful but maybe there’s a possibility?

http://www.tp-link.com/en/gpl-code.html


(mat) #7

any one cracked this yet?


#8

Anyone? These things are so cheap and consistently on sale for under $20 it would be great if someone could get them working with ST.


(dbej) #9

A couple of caveats to start.

  • First, it is not native integration. Smartthings doesn’t allow you talk sockets so we have to go with a middleware gateway.
  • You will need to be able to run the gateway on something that runs NodeJS. You will need to install it using npm because it uses the hs-100-api library created by plasticrake (www.npmjs.com/package/hs100-api)
  • I run it in Docker so if you have something capable of running it there, it would be worth it. If you want to get started in something can run Docker on the cheap, I would suggest picking up a Raspberry Pi 3. It will do the job. I have included a docker file and some instructions that will stand up quickly.

Once you have the gateway up and running, you simply install the device handler and create a new device for each outlet you have. The networkDeviceID shouldn’t matter as long as it is unique. You have to supply the ip address of the outlet and the ip address and port of the gateway in the preferences. Once done it should look like a normal outlet. You will have to do an initial on/off to get the switches reflecting the correct state.

I have five of these outlets myself and they all seem to work as expected. The is probably the minimal work needed to make the outlets available to Smartthings so don’t expect miracles or for it be bug free. I will update and help as time permits. You can download the files here:

github hs-100 gateway


[HOW TO] Add your TP-Link HS-100 Wifi outlets to SmartThings
Any compatible smart power outlets that do historical energy monitoring?
(Chris) #10

Sweet! I’ll get this set up when I get home later, already have a node.js gateway running on an old windows laptop for a separate Alexa/Harmony integration. Thanks for sharing :slight_smile:


(dbej) #11

A few updates. The status of the outlet should be reflected correctly now when you on/off/refresh the outlet. It will poll the outlet and update the status at the standard polling interval. I also had to add a callback from hubAction to a custom response handler. Calls in to Parse do not seem to be reliable.


TP-Link Smart Wi-Fi Light Switch
(Chris) #12

Question for you…I installed node.js on a Windows 10 machine to run as a web server for a different smartapp. Do I still need Docker or can I run directly through node?


(dbej) #13

You should be able to run it directly on your node machine. When you start the app it will spin up web server on you machine using port 8083, which is what you will reference as the gateway ip and gateway port in ST device. You can change that port in the hs100.js file if you need it to be something else. You will still need to install the hs-100-api dependency using npm. After that just “node hs100.js”


(Chris) #14

Cool. I got hs100.js running, it says “The HS-100 controller has started”. I think I’m good there. Copied the groovy file into My Device Handlers in IDE, now unsure what to do next to actually add my 3 outlets to ST. I’m not seeing anything that resembles HS-100 in the list of Things in the marketplace, maybe I’m looking in the wrong place? Been awhile since I added a custom device.


(Chris) #15

Nevermind I got it, found the section in IDE where I add a new device. First one is working as expected…two to go :slight_smile: Badass, thank you!


(Chris) #16

Can the console log be modified to give either the device name or IP address along with a timestamp for on/off commands? Right now it just does a simple on or off, no differentiation between devices or times.


(Chris) #17

I modified the hs100.js file on my OneDrive online account from work, won’t be home to test it till later this evening. Think this will work? My changes are in bold.


(dbej) #18

Looks like that would work. You should also see the events in the ‘Recently’ tab on the device itself in the ST app.


(Chris) #19

Tested tonight, works fine. Thanks.


(Bill) #20

I would think that since the HS110 can be controlled via Echo 'alexa; that between the two you could get it working or a recipe via ifttt