TP-Link/Kasa Bulbs and Plugs Control (Old, Unofficial Integration)

Yes. The problem was human error - MINE.

I had no problems at all, I now have all my tp-link switches and bulbs working like a champ using a windows pc as a middle man. The only issue i have now is that these switches and bulbs will not show up in ActionTiles but Iā€™m not sure if that is even possible. Itā€™s more wishful thinking anyway, I am very happy as it is!

Thanks. I need to learn about smarttiles. Next project after I develop the Service Manager that will automatically install and manage IPs for both the PC bridge and the devices.

Do smarttiles require interface to a SmartApp or Service Manager to work?

Oh wow, it is possible! That is excellent news. There is a SmartApp for ActionTiles, it is called ā€˜ActionTiles V6 (connect)ā€™. When I tap it, it brings up the screen to select devices that ActionTiles has permission to display. Iā€™m no programmer but I would like to help if you need a tester. Again, I appreciate all the work you have put in here so far.

I am going to get Action Tiles and review the connect smart app. See what the requirements are for a device to add and see if i can mod code accordingly. May take a while, but this is fun for a 67 yo retiree.

1 Like

It is lots of fun, thatā€™s for sure. I really enjoy messing with ActionTiles too since it adds an additional layer of software and design tinkering that keeps my mind busy on the weekends. In fact, next weekend Iā€™ll need to spend some time crawling in my attic to run ethernet for security cameras. I can only hope that projects like these keep me as active as you are! Now that i think about it, ever since I received my hub, the fun never stops!

Chozo747,
I just got ActionTiles and figured out how to make it work.

In the Device Handlers, near the top, is a capabilities section. Add after the last ā€œcapabilityā€

capability "Sensor"
capability ā€œActuatorā€

This will make the devices available to ActionTiles (through the Smart App).

I will update the DHs tomorrow (all) and incorporate this. They will become Version 2.4; however, this will be the only change and only the DHs will be required (no change to the TP-LinkServer.js file.

1 Like

Wow, that is excellent news Dave, thank you for looking into this. As soon as I get home tonight Iā€™ll check the update and see if I can get the devices to authorize in ActionTiles. Itā€™s times like these that I know I chose the right ecosystem for my HA setup, this community is fantastic!

Apologies if i am being thick, but i have about 5 TP Link HS100ā€™s, am i right in thinking even with this fix you have produced, i need a pc to be on 24hours / day for this to work?
Or is it just for the initial set up process?

Many thanks

Paul

No, the PC needs to be on and not in sleep mode 24/7. I use a stick PC with windows 10 and the monitor/keyboard off unless I am working on it. The instructions provided gave details on making a PC work for this.

I was able to make the edits to the DH you outlined and it worked like a charm. Thank you for your help Dave, I now have all my smart devices available in ActionTiles.

Fade Capability. Is there any interest on the bulbs for the addition of a fade capability (using the native transition time parameter)? I want to play with it, and the Device Handlers I create will be published eventually, if there is any request. I do want implementation feedback. Mainly, where to control:

A. From the setting page as an input parameter
B. From the details page as an additional slider control

Dave

Dave you are the man, thanks for updating this once again. I canā€™t wait to try out some of the new features. I will need to start over again anyway, none of my devices are working with SmartThings again since I changed out my router. Not exactly sure how that broke ST integration (Kasa app still works fine) but it shouldnā€™t take too long to set it all up again. I saw what you said about how you doubt TP-Link will ever add offcial ST support, that makes me kind of sad but it makes sense. Iā€™m glad we at least have your code to help us keep everything connected.

Your device IP addresses for the Bridge and TP-Link devices may need re-setting. That is why we need Static IP addresses.

There is a tool (GetDeviceIPs.js andGetDeviceIPs.bat) under utilities that if you run (on your bridge with node.js) will identify all of your TP-link bulbs and plugs with IP address. makes it easy to go in and update on SmartThings as well as use for setting Static IP addresses.

PS - read the update instructions, vice new install - if you want to update. All DHs should work with Action tilesā€¦ However, there is no significant benefit in updating (if it ainā€™t broke, donā€™t fix it).

Thatā€™s the strange part, I made sure to copy all the same rules on the new router and even checked the mac IDs against the IPā€™s to make sure everything was set up just as it had been, host computer included. I will try the utility you recommended to see if it provides me with some information I was not aware of before.

So I was able to give this some time and I came across a strange issue. I tried the utility you mentioned above and was able to verify my smart devices are on the IPs I assigned them, good. I then decided to update everything to version 3.0, the server, the device handlers, i even went so far as to reinstall node.js but i could not for the life of me get any of these devices to communicate with my always on ā€œserverā€ pc running windows 10. Out of frustration I booted up my gaming pc that also runs windows 10 and run the server app on that pc, changed the gateway in one of my devices to match the IP of the gaming pc and and it works. Now Iā€™m really scratching my headā€¦ Both pcs are set up the same way, both have IP reservations but the server app works on one but not the other. What even more strange is I had this all set up for months with no issues on that ā€œserverā€ pc but it only stopped working after my old router died. My router utility shows nothing out of the ordinary and the fact that i was able to get it working on one pc shows itā€™s a local issue. Any ideas? I really would like to get the server app working again on the always on pc.

Also, i should probably mention when I tried to ā€œdownload as zipā€ from github, windows defender through chrome would not allow me to save the file, saying it had a virus. I know itā€™s a false positive but I felt i should inform you. I was able to download through firefox on a different pc. Both pcs using windows 10.

First, on the server, is the applet window opening with a display similar to:
Fri 06/02/2017
09:42 AM
v6.10.3
TP-Link Device Bridge Application

If not, check the path within the Server.bat file. It should point to the directory you applet is started in.

cd c:\1-TP Link\

Results?

PS - what router did you get?

Yep, on the server applet i see exactly what you have above except with my time. Normally i could see the requests from the ST app and the device responses in this window but now Iā€™m not seeing any communication. On the gaming computer, I can see all of the communication and it is working perfectly. I replaced a Linksys E3200 with a Netgear Nighthawk R6700. I have been happy with it so far and have not had any other issues. I edited the .bat file before i started and for what itā€™s worth, i copied the same exact file and used it on the gaming pc where it is working. The setups are nearly identical, both on ethernet with reserved IPs, both windows 10, the only difference being the hardware of the pcs. I noticed an error log file but there doesnā€™t seem be much info there. Copied below.

Fri Jun 02 2017 09:29:03 GMT-0400 (Eastern Daylight Time)TP-Link Device Bridge Error Log
Fri Jun 02 2017 09:35:49 GMT-0400 (Eastern Daylight Time)TP-Link Device Bridge Error Log
Fri Jun 02 2017 09:37:00 GMT-0400 (Eastern Daylight Time)TP-Link Device Bridge Error Log
Fri Jun 02 2017 09:53:14 GMT-0400 (Eastern Daylight Time)TP-Link Device Bridge Error Log

Each time the server app is started, the lines above are generated. This tells me you started it four times today (hopefully manually - if not, I need what the screen says).

Next check: Windows just updated on my computer, and auto-connect to the lan is not working. Stupid to ask, but are you sure you are connected. I assume you downloaded the app through the serverā€™s browser, so, stupid question.

Guest Network. Make sure that none of your devices were put on the Guest Network or that all the devices are on the Guest Network. (pg 90 of userā€™s manual).

UPNP - assure that is still enabled (page 56)

Port Forwarding. Check if port forwarding or triggering is enabled on your gaming pc (page 202). If so, replicate on the server.

Put a query into netgear. Your server is listening on HTTP port 8082 for HTTP commands from the cloud.

Next: IF these steps do not work, you can change the Ports from 8082 on the server app and in a test device and see if that works. Very unlikely. Try 8083 or 8085.

In TP-LinkServer_v3.js, the line looks like:
var serverPort = ā€˜8082ā€™ // Same is in various groovy files.

In the Device Handlers, the line looks like:
headers.put(ā€œHOSTā€, ā€œ$gatewayIP:8082ā€) // port 8082 must be same as value
in TP-LInkServerLite.js