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

I might have missed this, but how should we handle WebCore, tplink smart app, and device handler when converting to the official integration?

I see the steps are:

  • Start the new app and add the devices.
  • You will now be able to access the devices in either new or classic app.
  1. At what step should I remove the tplink beta smart app and device handler?
  2. Do I have to remove all the tplink devices/pistons from WebCore first, then re-add them later or is it a seamless transition?

I canā€™t answer this.

Do you guys know how can I fix this problem?
On old SmartThings Classic app the power consumption shows right (1700 Wh) but if I switch to new Connect app it shows 1.7MWh which itā€™s wrong, the scale itā€™s wrong.It should have been 1.7KWh.

Thanks ,
Vlad

It should also be noted that the Energy Meter capability defines its units as Wh, kWh or mWh. Unfortunately the app UI has a habit of folding the first character to uppercase which makes a mess of SI units, in this case making a difference of nine orders of magnitude.

I believe the default units are supposed to be kWh which would appear to be correct.

It seems like the unit has been set to mWh (or MWh) somewhere on the assumption the value would get magically scaled.

I would contact SmartThings and Support. I believe they wrote the official integration.

@Gutheinz : already done that for the official integration, but no response, no support.It not even works properly, because the official one does not even measure the power, it only has an ON/OFF switch.

@orangebucket yes, it should have been kWhā€¦I donā€™t have code skills, so i cannot modify myself the DTHā€¦

Oh hang on, this is Daveā€™s handler isnā€™t it? It looks like it is pumping out energy usage in Wh without a unit. The new app would probably see that as kWh and perhaps I did it a disservice and it can scale the units automatically and is displaying MWh.

You could try editing line 224 to say

sendEvent( name: "energy", value: wattHrToday, unit: "Wh")

That might perhaps do something.

1 Like

changed.
itā€™s working!
thank you

Glad you got it fixed. Remember, it is deprecated and will not carry over to when the classic app and IDE die away! I will maintain the current state for errors, so I will update the code when I have a break from my Hubitat and life requirements.

Thanks to everyone for using my Integration. It was a pleasure and I am sorry to see it come to an end!

2 Likes

Additionally, since I do not have the skills, etc. if anyone wants to carry this to the future, the GitHub repository is mine and OPEN SOURCE. You have permission to use as you see fit. I also have a lot of node.js tools (old node version) that I can share; including the old manual install that used a stand-alone server. Those can be made available (not all are on GitHub. I have node.js tools like a UPNP discovery tool that allows you to see the UPNP devices on your LAN, a tool to rapidly list Kasa devices, and tools to test the commands I discovered during the investigation process.

I just bought a Kasa HS 300 smart plug. Iā€™d like to get the power use info into Smartthings but Iā€™ve read all of the posts and it still is not clear to me if I can do this now. I have the new Smartthings app. I can figure out how to add the device handler, but not clear to me if that will work adding at this point.

If it is, what order do I do this? Do I first add DH, then do integration of TP link to Smartthings?

Be sure to read through the documentation folder on the GitHub site. Dave has great detailed instructions there that should point you in the right direction.

Keep in mind that the official integration of TP-Link to Smartthings can exist parallel, but it is separate from the SmartApp.

Both the SmartApp and the Device Handler (DH) need to be installed through the IDE, and if both the official TP-Link integration and the SmartApp are installed, each device will appear 2 times.

The HS300 is relatively new, and probably need some modification in the DH, similar to what I did for the KP115: TP Link Kasa Devices with new official integration (July 2019): reviews needed - #164 by ernie

However, as the HS300 is a multi-socket device, not sure if the DH in its current form will correctly report the HS300 device capabilities. Making this another reason to push TP-Link to update their integration into Smartthings with the missing Energy Monitoring (EM) capabilities.

First, I am no longer using smartThings; however, the driver/service managers are still available. The HS-300 is in the code; including the EM function. HOWEVER, I have not (can not) update this code to worke with the new Appā€™s interface to include Energy Functions.

Dave

Be sure to read through the documentation folder on the GitHub site. Dave has great detailed instructions there that should point you in the right direction.
[/quote]

Yes, I have been reading this information. It just is not clear to me if with the end of Classic app if this will work with new Smartthings app. I donā€™t add DHā€™s often, so it will cost me a day of my life to do it :smile: Iā€™d like to know if there is a pot of gold at the end.[quote=ā€œDerakkon, post:402, topic:142507, full:trueā€]

Thanks Ernie. Are you using the new Smartthings app with the Device Handlers and getting energy use information? Iā€™m not clear on whether any of this will work now that Classic Smartthings is gone.

I have already contacted both TP Link and Samsung about the need for this upgrade.

Dave, thanks for all the effort you put into this in the past. Hope all is going well for you in new endevours.

I am currently on Hubitat and have similar code there. If anyone knows of explicit fixes for the DTH to help integration into the new API, please let me know.

OK, I figured this out. As usual, it cost me a day of my life, but right now Iā€™m drinking a beer and feeling it was worth it.

I got my TP Link Kasa HS 300 to show energy values in the new Smartthings app by finally getting the right device handler into my IDE. It is DEPRECATED-TP-Link-SmartThings/TP-Link EM Multi-Plug.groovy at master Ā· DaveGut/DEPRECATED-TP-Link-SmartThings Ā· GitHub

And the Smart App (Service Manager) is DEPRECATED-TP-Link-SmartThings/TP-Link SmartThings Manager.groovy at master Ā· DaveGut/DEPRECATED-TP-Link-SmartThings Ā· GitHub

Itā€™s very easy to get an incorrect device handler, or at least it was for me. It was in the Deprecated list, but not on this table in the documentation. I found it by sifting through conversations to find Dave Gutheinzā€™s update for the HS 300 Device Handler. ā€œTP Link EM Multi-Plug.groovyā€ is the one you need.

1 Like

Surprised it still works!