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

It appears I was overly optimistic. It now sees my devices but errors when I actually try to install them in either app. “Server or network error occured”.

OK, all is well. It’s one of those “I’m not quite sure what I did, but something worked”. I hate those. Thanks for your help!

I seem to get a lot of those. The password field is very tricky and very quirky within the phones.

Thanks for having a look at it.

Craig - Contact Using Spike

Hi all, would appreciate any help you can offer. Dave, thanks very much for your work on this app. A few months ago I successfully installed the SmartApp and added a TP-Link smart plug which has worked perfectly since then.

However, I have since purchased three additional plugs that the SmartApp recognizes, but when I go to install them (using any of the three options for initial install, add devices, etc.), it says that “an unexpected error occurred.” I figured I’d delete the SmartApp and reinstall to see if that fixes it, but I am currently unable to remove the SmartApp from my mobile app (I’m on Classic). It gives the same error message when trying to remove it.

I’m currently stuck in a state where I cannot delete the SmartApp, but nor can I use it to add the new devices. What should I do next? Thanks!

What plugs are you having a problem with??? The latest version of the Smart App (yesterday) added support for the KP400 and KP200 multi-plugs.

I’m a bit confused about SmartThings GitHub integration for this repository. In all the repositories I have successfully accessed from the SmartThings IDE there’s a directory structure where the groovy files are in a directory/folder such that abc.groovy is in a folder named abc.src. In those repostories where that isn’t the case I can’t get the integraton with the Smartthings IDE to work. On the other hand there’s lots of messages in this thread that appear to imply that the integration is working. Have I missed something? Sorry if this has already been clarified.

Just walked through the whole process and it worked perfectly! Thanks for the all the great information, instructions and discussion. :grinning:

1 Like

I apologize if this is has been asked before, but I couldn’t seem to find the answer. I have the smart app and device handlers set up for my TP-Link HS110 plugs with the cloud integration/control. They work fine in the Smartthings classic app. The issue is that the devices do not show up in webcore. Are there any configuration changes I need to make in order for them to be able to be controlled through webcore pistons? Thank you!

Never heard of this problem before. Since I do not use Webcore, I can not check.

The device has all the planned capabilities for switches; namely;

capability “Switch”

capability “refresh”

capability “Health Check”

capability “Power Meter”

capability “Energy Meter”

Webcore should detect.



I’ve been using the TP-Link SmartThings Manager (Kasa Cloud only) for a few weeks and its been great, but I noticed a few things:

The status on some of the plugs in Smartthings don’t match the the Kasa app sometimes. This has happened a few times, but the most major one was when I noticed that my fridge was off, but the Kasa app and led on the plug both showed green, but the fridge was off (Smartthings showed off).

The second issue I am seeing the last few days was when I moved a plug to a different spot and renamed it in Kasa. It did not rename in Smartthings automatically, but I removed it from a smartapp that was turning the plug off when I left the house. However, it is still being turned off when I leave the house, even though the smartapp no longer has the plug checked.

How would I go about resolving this?
I just renamed the plug name to match what is in Kasa today, but I don’t think that is the issue.

Status not matching: The Status reported is directly derived from the status sent from the bulb. However, this does not occur automatically. If you turn the switch on / off via the Kasa App, it will not update in SmartThings until a refresh is run. You can control the frequency of the refresh in preferences.

Changing name of plug: There is no synchronization of the Kasa Name with the SmartThings name. You must rename in Kasa.

Link to a SmartApp: Assure you actually unchecked this device (after renaming). All of the device handlers use Capability Switch with the standard capability commands. So It should work ok.


Status not matching: Understood. I just wanted to point out that the physical green LED that is on the plug which lights up when power is supposed to be on the device did not match the actual state of the switch. Very much a Kasa plug bug, but I’d never seen that type of mismatch before using the Kasa smartapp.

Link to a Smart App: I am 100% sure the device is unchecked from the smart app. I’ve checked the smartapp settings itself, and the smartapps section of the kasa plug in Smartthings, which doesn’t list the smartapp that triggers when I leave the house. it’s already happened twice in two days (two tries) so far. Ifam going to reboot the hub and hope its just a Smartthings bug I hadn’t noticed before.

Sorry for stupid question but I successfully installed device manager, 2 device profiles, and have published all 3 - but am unable to run the service manager for the first time because “My Apps” list is empty? Any help is appreciated…TIA.

Best guess is you forgot to select MyLocation prior to installing the code. Other possibility is you are not using the Classic app.

With the SmartThings integration would I be able to turn on 1 HS200 switch and it would turn on my other 2 HS200 switches?

I am trying to find a way to create a 4 way switch setup with out having to run the wires all across my house.


Two cases:

  • Press wall switch. Essentially no. There would be an average 30 second delay before the other lights changed if refresh were set to 1 minute.
  • Use SmartThings Interface. Yes. Using rule machine (I am not the person to ask on how to use rule machine). Basically, you will key of the switch’s attribute “switch” (on/off) and then do anything you want within SmartThings.

Update: Turned out I had a forgotten IFTTT task turning on and off one of my TP-Link plugs. With this integration, I can get rid of that. Again, great integration.

1 Like

Awesome work guys… thank you so much

I keep getting “java.lang.NullPointerException: Cannot get property ‘id’ on null object @line 504 (getToken)” when I enter my KASA credentials and request a token. I was looking at the source code that you’ve written and I think the problem is that it’s looking for my “Hub ID”. I don’t have a smartthings hub though. I’m just doing this to control my KASA plugs and nothing else really. And the only reason why is because I need a Sunset with offset mode that Stringify already has but is shutting down soon. If this is indeed the cause of the problem, can this source code be re-written to not need that Hub ID?

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.