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

Hey @Knightro I have this currently working on my windows pc, but want to move it over to my pi and try and run it in docker, wondered if you managed to note down the steps you did to get it working? :slight_smile:

Sorry, but Iā€™m using QNAP and have no knowledge on pi.

hey aapocketz

First off, thank you so much for your work here! Iā€™m struggling to make this work with docker and was wondering if you would be kind enough to help me troubleshoot this. I previously got this working fine with the HOWTO thread and running it natively on windows/NodeJS. I then decided to get ambitious and run it with docker. I installed your docker package using kitematic, and the curl commands work fine, turning the light on as expected:

C:\WINDOWS\system32>curl -H "x-hs100-command:on" -H "x-hs100-ip:192.168.1.42" -D - 192.168.1.13:32770
HTTP/1.1 200 OK
Date: Sun, 05 Mar 2017 18:32:21 GMT
Connection: keep-alive
Content-Length: 72

However, now ST isnā€™t turning on the lights.I also removed and added the devicehandler and device and I tried both the debug executeCommand() you posted, no joy, here is the output:

Any idea why the docker isnā€™t responding to ST, but my regular node is (yes I changed the port since they were using different ports). Thanks again for your time!

Could you double check to make sure your docker is configured to expose the port you are using. Just a guess from your description.

Thanks aapocketz for the quick reply! Would the curl command work if docker wasnā€™t configured to expose the port? (new to docker, might be a noob question :slight_smile: )

The curl command may work on your host machine where it can reach the port on the docker network, but the port may not be bound to an external interface on the host machine. My thought was maybe that port isnā€™t accessible from an external computer on your LAN. If you have another machine, verify the curl command works from there.

Finally figured it out, Windows firewall was blocking the connection. I did two things to fix this:

  1. Switched my home network to a ā€œprivateā€ one (go to wifi settings for the home wifi and set it to discoverable)
  2. Set windows firewall ā€œPrivate profileā€ to allow inbound connections (go to firewall > advanced settings > windows firewall properties > private profile > set inbound connections to allow)

I hope this helps someone else stuck on this step! Thanks aapocketz for all the help

Iā€™m on the same boat. I would like to use the energy consumption to figure out if my TV is on in a CoRE rule.

If no one is adding this to the tp-link grovy script, Iā€™ll try to add it myself. Just need to figure out if the kwh readings will be understood by the HUB device entryā€¦

hey aapocketz, another question for you. Do you have a version complied for the raspberry pi? Iā€™m new to all this, after getting this working on my windows machine, I bought a raspberry pi W so I donā€™t need to leave my machine running all day. However, I get an error when I try to run the package on my pi: ā€œexec user process caused exec format errorā€ which online forums indicate Iā€™m trying to run a docker image complied for Windows on the Pi (which is an ARM architecture).
Would it be asking too much to ask you to release a version compiled for the PI?

Yeah if I have some time later I should be able to help.

The issue isnā€™t compiled code really, I think itā€™s an issue running the x86 Ubuntu phusion baseimage on arm.

1 Like

So I would just install the node.js script and run it directly on a raspberry pi without docker. I did update the docker image in a branch but docker seems sort of beta on ARM arch right now, and it doesnā€™t build in docker cloud.

1 Like

Thanks aapocketz, I got it running in node without docker like you said, working fine. Thanks again for all the assistance!

Is there a way to make the port static also? It is changing incrementally once it restarted from the QNAP-Container.

Iā€™m not sure if you gave up on this but I saw this error while setting mine up.

My issue was that my HS100 was on a guest wifi network and did not have access to my lan ports where my raspberry pi was running the code.

I changed the wifi network to a non-guest network and everything worked.

I suggest you try pinging 192.168.200.28 from your machine with the nodejs code

HS110 energy monitoring support is added in the apps in the thread ā€œTP-Link Bulbs and Plug Controlā€. I am the author. Feel free to use this as a guide.

Note that my approach is different from the basic HS100 app. I do most processing in SmartThings and have a minimal footprint on the server/bridge. I do not use the HS100 API in this approach.

Hey Dave G. I donā€™t mean to hijack this thread but Iā€™m having trouble with 1 step from your instructions @ GitHub.

Scenario:
Try to get HS-200 working with Smartthings hub v2

Step Iā€™m having trouble with:
Running the ā€œTP-LinkServer_v3.jsā€

Background:
Iā€™m using Windows as my Server PC
From the Node.js command prompt version is v8.1.2 (I downloaded the MSI as per your instructions)
I was hoping to get the results in your instructions when I ran the test but instead I get "SyntaxError: Unexpected token <"
I was able to run another test with a ā€œHello Worldā€ js and it worked
I also tried your ā€œGetdeviceIPs.jsā€ and same error

I might be totally doing this wrong but please point me to the right path. Let me know if you need to full Syntaxerror msg and any other info.

Thanks in advance for your time.

James,

hello im just starter in smartthings. I need know or you crate Cloud-Based_TP-Link-to-SmartThings-Integration. because I do your metod but nothing happens. if is you crate this metod I need ask mi and I haw several questions .

Yes. Go to the below link and I will help.

In the meantime, assure that you have followed the published instructions explicitly. These are at the getHub site in a document ā€œCloud TP-Link to SmartThing Installation.pdfā€. You might want to print these and mark the steps so you can be explicit on when / where the installation fails.

I donā€™t find haw to write to you in email. becuose write here. what mi
problem.
what this red meens?

There is no error at the called line. However, there is something spurious on line 32 (indicated by the space between the two lines.

Usually done by not copying/pasting as text. I tested the app exactly as copied from GitHub this AM and it worked fine. Again, a copy / paste problem.