SmartThings Community

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

(Chris) #26

Interesting. I just checked and I’m on 0.2.0 also. Haven’t tried 0.3.0.

(Kpdillon) #27

Ok, well downgrading to .0.2.0 solved it for me… This is great work thank you for putting this out there!

1 Like
(Chris) #28

Still working great for me after a month. Only thing I had to do was disable automatic updates on my Windows 10 machine, it was rebooting on it’s own and killing my node window. Thanks to @dbej!!!

(dbej) #29

I will take a look at updating hs100api to 0.3.0 as soon as I have some time. I will post any updates to the DTH and the nodejs server.

1 Like

Thanks for taking the time to do all of what you have for the community. I am new to smartthings and would like to ask if you could do a step by step tutorial on how to get this to work, this can be a step by step worded process or a youth be video.

I know it may be asking a lot, but it would help not just me but many others as well.

I’m very tech savvy but have no clue how exactly to get this to work. Thanks in advance if you can and thank regardless if you can’t (this request also goes out to anyone who has gotten this to work)

1 Like
TP-Link Smart Wi-Fi Light Switch
(Chris) #31

How-to moved into it’s own thread as of 12/29/16

Black Friday Deals!

Thanks a million!!

I have a raspberry pi 3 running osmc in my living room. It’s always on so I decided to use that instead of another device and with the help of your instructions it’s up and running perfectly.

I followed the instructions here starting at the “Install Node.js” paragraph which involves running 2 lines of code. After getting it installed I simply followed your instructions and profited as you said I would lol. I did it all from my android phone via ssh. For those going this route I also added code to /etc/rc.local to start the node for me at boot.

Thanks again for your instructions and a big thanks to @dbej for his work in putting this together for the community!

1 Like
(Derek) #33

I second that, thank you very much @destructure00 !!!

1 Like
(Sebastian) #34

I’d like to setup one Smart Plug to turn ON and turn OFF every time my computer (Windows 10) goes to sleep. Do you think this is possible? (I’m using multiple users in this PC, so a potencial service should be working in /system for all the users).

  • PC (power supply) and LCD Monitor would be connected to a regular plug (since they both consume less than 3W in SLEEP mode).
  • Studio Monitors ( PC speakers) would be connected to the Smart Plug, and this is the thing I’d like to turn off / on every time the PC wake up and sleep. They use always the same energy, no matter they are in stand by or working.

Thanks in advance!

(Kevin Gibson) #35

thank you @destructure00 I set this up last night on an original raspberry pi and it is working great.

I’ve got this and the myq node implemented on the same pi and both are working great.

1 Like
(Sumit Garg) #36

Great stuff… Thanks for the instructions and step by step guide.

Does this stop working for anyone else randomly as well? For me, it works fine for a day or so and then I have to restart the hs100 node server.

1 Like
(Chris) #37

Been running for a couple months now with no issues. I was having problems early on with the gateway laptop restarting but disabling automatic updates took care of that. I manually check for updates every couple of weeks, node session always stays up besides that.


I got in on one of these hs-100 for black friday and figured i would integrate it with smartthings. This technique works great! I had to change the node dependency to 0.2.0 version of the hs-100 api to get it to work.

For convenience I uploaded my image to docker hub, in case someone wants to use it.

If you have a QNAP NAS device at home, its easy to search and add this using the container store. You could probably do something similar with Synology NAS or others as well.


destructure00, I just want to say excellent work I’ve had no problems. But I was wondering if you’ve had in experience with the TP-Link Smart Bulbs? I’ve tried the same instructions here with no luck. Just wondering.

Thanks again!

(Chris) #40

Thanks, don’t forget that @dbej created the js app and ST DTH, all I did was write up the install instructions :wink:

I don’t have any TP-Link devices other than the HS-100 outlets, so can’t offer any input on those.

1 Like

Oh, my bad! Thanks for the response. My apologies!

1 Like

Hi, I’d very much appreciate a little help…

Presently when I run “node hs100” I get the message “The HS-100 controller has started”, but I receive no further messages, and the HS100 does not respond to toggling the switch in ST (or vice versa).

I’m running Raspbian Jessie on a PI3. I have node 7.2.0 installed, and I have installed hs100-api@0.2.0
The Gateway IP/Port and Outlet IP are definitely set correctly in the ST device.
The HS100 correctly responds to the standard Kasa app.

Any ideas how to resolve?

Thanks in advance.

(Jacob ) #43

Just wanted to throw this out there as I did not see any mention. The method to get this working for the plug also works with the tp link smart switch.
Thanks for all the hard work on this!

(dbej) #44

Hi guys. I finally had a few moments to update the hs-100-api calling code to be compatible with his v3.0 code. I have been running it against my plugs and it operates as before. I also put the code from @destructure00 that outputs the additional commentary as to what has happened when you make a call.

@ChrisM. I am running node 7.2.0 also. Lets try this:

  1. ssh in to your gateway. Update to the latest code. Start the hs-100.js from the terminal with
    node /hs-100/hs100.js.
    This will let us see messages being outputted as you are making calls.

  2. From a different ssh, run the following. Edit it to put in the IP of your outlet and your gateway
    curl -H “x-hs100-command:on” -H “x-hs100-ip:[plugip]” -D - [gatewayip]:8083
    curl -H “x-hs100-command:off” -H “x-hs100-ip:[plugip]” -D - [gatewayip]:8083

  3. Those to curl commands will turn the outlet on or off just using the gateway, removing the DTH and ST from the mix for testing. If you hear the relay kick on and off, we have to look at the DTH. You should also see messages on the gateway similar to this following.
    Sun Dec 04 2016 20:01:49 GMT+0000 (UTC): OFF commmand sent to
    Sun Dec 04 2016 20:01:49 GMT+0000 (UTC): ON commmand sent to

  4. If you don’t see the messages or hear the relays we will have to troubleshoot a few other things.

1 Like
(Colfax Upton) #45

Thank you so much for posting the update! I was literally in the middle of troubleshooting my own rig when I saw your update, worked like a charm, thank you! Perfect timing!

For those of you trying to get this all to work on a Raspberry Pi 3 with npm/node, here’s what worked for me. (This assumes you have node/npm already setup).

  • Download @dbej’s github zip to the Pi
  • Extract the files to a new folder, I named mine ‘hs100’
  • Open the terminal, change your working directory to the new folder - cd hs100
  • Next install the node with this command npm install
  • Lastly, use this command - node hs100.js to run it.
  • Next, reference @destructure00’s post, and follow steps 9 through 15., use your Raspberry Pi’s IP address as the Gateway IP.
  • Don’t forget to Profit.

Thank you @dbej and @destructure00, you guys are the folks who make this community awesome!

1 Like