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

Hi,

Thanks for the great work Dave, it is appreciated.

Just wondering when/if we might see support for the new SmartThings App?

Cheers

Getting the following error in live logging when trying to add app into smartthings:

physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘(Cloud) TP-Link EnergyMonitor Plug’ in namespace ‘davegut’ not found. @line 202 (doCall)

I attempted to re-add both smartapp and device handler and got the same issue. I am able to set the credentials and identify my hs110.

Typical cause is not selecting your location before installing the device handler. You must select the location first or the device handler will not be found. Go to your location and My Device Handlers. See if ther is one (spaces count):

davegut : (Cloud) TP-Link EnergyMonitor Plug

When the SmartThings Staff converts the system to take custom device handlers based on the web.

dave

Hi Dave,

First, let me thank you for all of your work on this connector. It’s been a wonderful solution for me so far. Yesterday I purchased one of the LB130 color bulbs and installed it through the Kasa app. I then logged into the IDE and selected my location, then installed the device handler (I installed both the emon and normal) I then went into the app and attempted to add the new bulb. The app sees it as a new device, but when I tap Save, I get “An unexpected error has occurred”

When I view the live logging and tap save the only error that comes across is:
error java.lang.NullPointerException: Cannot get property ‘value’ on null object @line 201 (doCall)

Otherwise everything seems ok. Any idea what the issue might be or what I should look at next?

Best,
-mark

BULB SOFTWARE UPDATE.

TP-Link changed the bulb return message for on/off very slightly - but it broke parsing. A fix has been applied. It requires re-installing the Device Handler Software. The updated software is on GitHub (replacing the old).

  1. Go to GitHub and copy text of device handler you need.
  2. Go to SmartThings Groovy IDE
  3. Select your location.
  4. Go to My Device Handlers
  5. Open the relevant DH
  6. Remove the existing text.
  7. Paste the text copied in step 3.
  8. Save
  9. Publish
  10. Test.

After the install, the bulb should automatically set the new state on changes (without using refresh).

Dave

Mark,

I do not think you have the current version of the device handler. Line 201 in the current version is a blank. I had to change the captured device data in the update to accommodate the ever-expanding TP-LInk/Kasa line of products.

Dave

The top of the file should look like the below:

/*
TP-Link Connect Service Manager, 2018 Version 2

Copyright 2018 Dave Gutheinz

Licensed under the Apache License, Version 2.0 (the “License”); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.

Discalimer: This Service Manager and the associated Device

Handlers are in no way sanctioned or supported by TP-Link. All
development is based upon open-source data on the TP-Link devices;
primarily various users on GitHub.com.

Notes
  1. This Service Manager is designed to install and manage TP-Link
    bulbs, plugs, and switches using their respective device handlers.
  2. Please direct comments to the SmartThings community thread
    ‘Cloud TP-Link Device SmartThings Integration’.
History

2018-01-31 Updated for new release of Device Handlers
*/

What version are you using? I can make the old version DH available.

I feel like I pulled this from your github. Where are the current versions available at?

Updated in April (and again today). I believe the error is caused by the Device Handler not being the same as listed in the Smart App. Three possibilities:

a. Not installed to the same SmartThings “My Locations” location.

b. Not really an LB130. Kasa makes a KB130 and now a KL130 (this is brand new). If it is this, I just fixed it on the GitHub SmartApp!!!

c. Old driver with different name. In the My Device Handlers, should see device:

davegut : (Cloud) TP-Link Color Bulb

which corresponds to the driver line:
tpLinkModel << [“LB130” : “(Cloud) TP-Link Color Bulb”] // LB130


m4rk

Mark Slagle

September 22
I feel like I pulled this from your github. Where are the current versions available at?

I have my TPlink plugs and switches working in the Classic app.
They show as devices in the New ST app, but no toggle, cant do anything.

Is this normal?

Yes. SmartThings has not worked at all on integrating custom Device Handlers. They only work in the Classic app.

1 Like

TP-Link / Kasa Bulbs and Plugs Control now supports the new SmartThings phone application.

Update instructions:
A. Replace the device handlers with the new ones from the link below.
B. In the CLASSIC App, exercise each device (run a refresh).
C. Go to the NEW App and see if you can control the devices.
D. If not, Remove the devices using the IDE. DO NOT remove the Smart App. Then re-install using either the New or Classic App.
Note: To delete individual devices, you will have to use the My Devices page on the IDE or the CLASSIC app. The new app can not delete.

HUB Version

Cloud Version

2 Likes

Hi Dave,

Thanks again for your time on this, however I am having a problem updating.

I followed the instructions above-

  • Replaced device handlers
  • Refreshed (didn’t work),
  • Removed all devices using IDE,
  • Re-installed using new app.

They show in the new app, but I am still unable to control them.

They show and are controllable in the classic app.

Any ideas?

Thank you for your help.

Just removed my devices (10 total). I then re-installed my new SmartThings Android App. Reinstalled all items while watching logs. All worked well and control was immediately available.

Try Refreshing in the classic app with logging turned on. Then try the new app again.

My configuration: Android phone. HS100, HS105, HS220, LB120 and LB130 devices.

Yours???

Dave

Hi Dave,

I’m using TP Link Bulbs Device Handler, 2018 Version 2 with the SmartThings Classic App. I have two LB130 bulbs, and have two scenes set up in the app. Scene A turns on the bulbs to 5% blue, and Scene B turns on the bulbs to 100% white. Both scenes used to work, but no longer
not for a few months, I think. They do turn on to 5% or 100%, but they no longer change color.

Today, I decided to dig in. No luck searching the Internet and this community, so I turned to the SmartThings IDE, went to Live Logging, and noticed I was getting this error:

java.lang.NullPointerException: Cannot get property ‘get_sysinfo’ on null object @line 228 (commandResponse).

Any ideas? Thanks in advance.

Replace the driver with the latest. There was a change in the tplink status word that causes errors.

Thanks for getting back to me so quickly. I tried to update but I got the same thing. How do I “replace the driver”?

Copy the text source from the GitHub site (top of forum) the file for your device.

Thanks for the wonderful integration. I might make some suggestions to make this easier for new users like myself. For example, on the page listing errors, perhaps add suggested fixes on that page?
I have run into an issue that I can’t seem to fix. I am getting the token expired error message {error_code=-20651, msg=Token expired} (copied from the IDE -> APP -> OTHER -> tp
)

I chose the cloud implementation to eliminate another failure point. I installed the device, the Kasa app, which works flawlessly. I installed the device handler, smart app. I went to the service manager, tried to add device, but I got the token expired. I searched this list and your two previous recommendations were to verify the userid/password and try resetting the password. I am using a password manager (lastpass) so I know I am getting it correct although I tried manually typing it as well. I tried changing the password in the app, logging out, logging back in to verify the password and email are correct.

Am I missing a step somewhere? I reviewed the documentation again, and I can’t find anything
 Thanks!