SmartThings Community

TP-Link/Kasa Bulbs and Plugs Control


(Felix Pau) #588

I was following this PDF

and I got the error at 3i.

Didn’t get far enough to even create the application.

(Dave Gutheinz) #589

This is typically caused by not pasting the entire file correctly. That is easy to do (for some reason). Try re-copying the content and then repasting.

The first two lines should look like (exactly)

TP-Link Connect Service Manager, 2018 Version 2

The last four lines should look like (exactly)

	} catch (Exception e) {
		sendEvent(name: "DeviceDelete", value: "Failed to delete ${alias}")

(Dave Gutheinz) #591

You are loading the device handler, not the Smart App. First two lines are not the same.

(Felix Pau) #592

Got it, going to take another look later on. Thanks

(Eric Leung) #593

Hi everyone I am pretty new to all of this and I am trying to copy the code for the tp link cloud. I opened the link and see the code but I am not sure where to start copying from. I have tried to start the copying from line 37 metadata all the way to the end but when I try to create it. this is the error it gives me.

No signature of method: script_app_metadata_2b3121c2_5e01_4bdc_a20e_af2864cc9725.metadata() is applicable for argument types: (script_app_metadata_2b3121c2_5e01_4bdc_a20e_af2864cc9725$_run_closure1) values: [script_app_metadata_2b3121c2_5e01_4bdc_a20e_af2864cc9725$_run_closure1@d864e86] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

(Eric Leung) #594

sorry i just read the earlier message and I tried copying the whole thing and still gettting this error

No signature of method: script_app_metadata_7a207dd4_e413_4eac_9b14_4fa3dedb3115.metadata() is applicable for argument types: (script_app_metadata_7a207dd4_e413_4eac_9b14_4fa3dedb3115$_run_closure1) values: [script_app_metadata_7a207dd4_e413_4eac_9b14_4fa3dedb3115$_run_closure1@74927ade] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

(Dave Gutheinz) #595

Welcome to the world of technology. Ain’t it wonderful.

You must copy everything in the files to assure that it will work. Common errors are copying Device Handler file into the Smart App page and vice-a-versa, so follow instructions closely.

(Dave Gutheinz) #596

Indicates that you are copying a Device Handler into the Smart App page.

(Eric Leung) #597

Hi Dave thannks for the quick reply and thank you for providing this code. I did try following the directions from your PDF and made sure that I was in the my smartapps tab before clicking new smart app but unfortuneatly it is still giving me the same error. I also put the file in raw mode and copied the entire code.

(Eric Leung) #598

sorry just wanted to add that the last lines of the code for the cloud tp link switch and plugs is

def syncAppServerUrl(newAppServerUrl) {
updateDataValue(“appServerUrl”, newAppServerUrl) “Updated appServerUrl for ${} ${device.label}”

(Eric Leung) #599

sorry dave i think I know where I went wrong. I was copying the device handler code in to the smartapp. Now the question is where is the smartapp code?

(Dave Gutheinz) #600

I know you followed instructions. Look about 10 posts up. I think there was a similar problem.

Note. My concern is you are copying the DEVICE HANDLER into the Smart App Space. The smart app does not have metadata, but the device handler does.

(Dave Gutheinz) #601

You are definitely trying to load the Device Handler into the Smart App space. Smart App is on server under (I believe) Service Manager or Smart App. You need both for installation.

(Eric Leung) #602

awesome i found it and installed very easy thank you for your help and hard work. I just want to ask one final question. As I am looking at the plugs and switches from the smartthings app, I noticed that I only have the option to turn on or off. If i have previously set up schedules from the kasa app, will they still work and if not what are my options?

(Dave Gutheinz) #603

The schedules set up in the Kasa App will still work. Additionally, you can use the SmartThings Automations to control the switches along with other items. For example, I have a ‘Sleep” automation. It turns off ALL lights and switches in the house (with a few exceptions), sets the Thermostat for sleeping, and locks the front door. I have another “Wake”, that turns on some lights and other switches, sets the Thermostat for daytime., etc.


(Eric Leung) #604

Ok, thank you. I will play around with it.

(Brian) #605

So I’ve got the “Cloud” method working using the legacy app. It seems that with the new app, the devices are stuck in a “Checking status” mode, and never do allow for the power to be set on/off or used in an automation/scene.

Is this expected, it seems that with the legacy app - I can do all of this, so I may just remain on that app until this support is available.

What are others doing for this, or what’s the roadmap for support in the new(er) app?


(Dave Gutheinz) #606

I assume you are discussing the new SmartThings app. I have not tried this with these devices since that app (last I looked) was not ready for prime time. When I can actually use the new App, I will fix what they have broken.

(Brian) #607

Exactly, thank you. As it is, it seems the new App has some nice UI – but isn’t quite ready for prime time when doing anything but the basics. Hopefully they get there, but until then, the “Classic” app will do the trick.

(Roomie76) #608

All: Mistakenly ordered the HS103PS from an Amazon deal. These devices are listed on their site as HS103PS but the model is HS103. I was able to update the model definition on line 172 of the TP-Link (unofficial) Connect app:
tpLinkModel << [“HS103” : “TP-LinkHS-Series”]

Saved and published. Seems to work fine but I have only tested it for about an hour. OP: Is there any other testing I should do?