[OBSOLETE] [Deprecated] New TP-Link/Kasa Plug, Switch, and Bulb Integration

As I mentioned, I have read all of those instructions, but I must be missing something.

I still dont see anywhere in those instructions (perhaps I’m just missing it) where it tells me how to create a custom Smart App and copy/paste (or otherwise integrate) your specific SmartApp code.

I just need a little help pointing me to the 1st step (or, if that requires GitHub integration, how I do that).
I already know how to copy/paste code into a Device Handler, but dont know whether I just find your SmartApp code and copy/paste that into a new SmartApp, or whether something more is involved.

Oops. I just realized that you provided updated instructions.
Sorry about that.

I will read those more carefully, and they may answer my question.

Sorry again.

Steps 4, 5, and 6 creates the custion Smart App. However, two steps are missing:

After logging onto the IDE, you must go to “My Locations” and select your hub. If not, then the device handler and smart apps will be installed to a null hub. Selecting your hub here, associates these files with your hub and therefore allows installation.

Big thanks to the author. I am using the node applet on my raspeberry pi for 19 tp-link switchs, plugs and dimmers. It works flawlessly. The only drawback, witch is not a bug, is the delay between status refresh witch make it somewhat less usable as a physical trigger for other devices. But if one can live with a 1 minute delay, it is doable. For that I use leviton zwave switchs, they react instantly.

Speaking of refresh rate, I notice that when a 1 minute rate is selected the applet does refresh every minute, but when 30 minutes is selected the refresh rate stay at 10 minutes. Maybe this as something to do with the smartapp running discovery every 10 minutes somehow resetting the timers .

1 Like

Also want to thank Dave - it worked like a charm once I saw his updated instructions.
Thanks for building it and making it easy (just copied in Dave’s code for Device Handler and Smart App).

1 Like

Hi, im currently running your old version from the other thread. To upgade, can i do a copy paste over the APP & DH or do i need to delete/unisatall then set up the devices again?

First - the first rule. If it isn’t broke, do not fix it. Not necessary and provided no additional functionality.

Exception: you are adding a new device of a different type that you currently have installed.

That being said, the below instructions should work in most cases. If they fail, then a reinstall is required.

a. Open your device handlers for editing. Get copies of the new device handlers from GitHub. Copy content and paste into the SmartThings. Save and Publish.
b. Open the Smart App for editing. Do same thing.
In each device, open and select options and save (this will change some parameters).

I have been using your SmartApp for a week or so (your latest integration - I am using cloud via my Kasa account).
I added 10 Kasa devices (all HS105 mini plugs) and they work great.

However, whenever I now try to discover a new device (just clicking +) from the SmartThings Classis app, all 10 devices show up again, and the gear spins continuously (until I quit the app).

Am I doing something wrong?

Need a log that depicts errors. Hopefully, it will give a clue.

What device type are you installing?

I just attempted successfully adding (one at a time) several versions.

Possibilities: You have two SmartApps installed on your system. This may cause that type of problem. to check:

a. Log onto IDE
b. Go IMMEDIATELY to My Smart Apps. There should be no smart apps there.
c. Go to My Locations and select your location.
d. Go to Smart Apps. You should see only one TP-Link smart app.

Worst case will be removing all devices and the app and starting over (I DO NOT LIKE THIS).

This happens the moment I hit the + sign to install a device (even if I’m not really trying to install a device).
I only see 1 TP-Link smart app in the IDE.

My guess is this has something to do with webCore, which I recently installed (though I’m not yet using it for Kasa devices). My other thought is Alexa, which has a TP-Link skill. Also, before I discovered your app, I did create a virtual switch that fools Alexa into thinking that it is a door/window sensor, making it available for Alexa routines. But, this was a bit cumbersome, and your SmartApp seems much more direct.

I tried deleting all 10 Kasa devices, and I got a message for each one that it was being used by Alexa and webCoRE. I went ahead anyway, and then deleted and reinstalled your SmartApp (adding back the 10 devices). The whole process only took about a minute.

I then clicked the + to add a device, and the app tried to rediscover all 10 Kasa devices.
Do you think Alexa and/or webCoRE is the suspect (or something else)?
Any other suggestions for debugging further?

Thanks
Dan

Are you up and running with all devices???

Yes, if you mean all Kasa devices. I’m also in the process of installing 100+ Fibaro light switches (about 20% installed so far).

Still getting same problem whenever I try to click the + to add a new device (in the Classic app).
I even deleted (from the Alexa app) all 10 TP-Link devices and then the TP-Link skill.
I then deleted (from the SmartThings Classic app) all 10 TP-Link devices and then your SmartApp.
This time, when deleting each device, it only mentioned Alexa (didnt say webCoRE).

But, once I added back your SmartApp and the 10 Kasa devices, I tried to click the + to add a device, and all 10 were again rediscovered.

Not sure what else to try except perhaps deleting your SmartApp from the IDE (and then reinstalling it).
Appreciate any thoughts.

Thanks
Dan

Need logs of what is going on in the background. Also, are you sure the devices actually added?

Maybe I spoke too soon.
The Kasa devices were clearly added when I installed your SmartApp.
But, this time, when I clicked the + to add devices, all 10 Kasa devices again were discovered, but the process stopped and allowed me to “pair” the devices.

After I did that, they were still there and working (no duplicates).
So, I again clicked the + to add devices, and this time nothing was discovered.

So, it appears the problem is solved. Not sure what caused it (perhaps Alexa and the TP-Link skill, which I dont really need any more).

Anyway, thanks for your help.

1 Like

error java.lang.NullPointerException: Cannot get property ‘id’ on null object @line 649 (getToken)

help

It could not find your SmartThings Hub. Two possibilities:

  1. When installing the code, you failed to select My Locations and your hub prior to installing the Device Handler and Smart App.

  2. You do not actually own a hub (this has happened in the past). You must own a hub for this integration to work.

Dave

you are right I don’t have a hub .
what I want to do is if tha switch turned on then send ifttt and to do that is only by ST the tp link there is no trigger available but if i use ST i can do it so when the status of the switch is turn on send ifttt that what i want to do is there any why to do that or add virtual hub

There is a way to cheat the system on owning a hub, but I am unable to assist you nor provide any guidance.

@Gutheinz Thank you for your hard work with the TP-Link integration. I have been using your work with the KL130 without any issues. I started with the cloud integration initially for basic usage, but switched to the node option after experimenting with webcore. The node option seems much more responsive to the webcore commands. I re-purposed a firestick as my node server using Servers Ultimate and so far everything is working great. Thank you.

1 Like