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

Ok. I am not sure. The previous error had indications that the line numbers were copied into the file
(startup failed: script_app_metadata_87edcb27_1bba_497d_a2de_b4cf3ca20968: 35: unexpected token: name @ line 35, column 5. 34 name: “TP-Link (unofficial) Connect”, ^ 1 error) .

I am able to duplicate the above by adding “34” at the name line, column 5.

That should not occur. Your file area should be without line numbers. The “definition” question should start out exactly as below.

    definition(
    	name: "TP-Link (unofficial) Connect",
    	namespace: "beta",
    	author: "Dave Gutheinz",
        description: "A Service Manager for the TP-Link devices connecting through the TP-Link Cloud",

Doh! I was including the incorrect code for smartApp. I feel stupid :frowning: thanks for quick responses. I was able to setup quickly after I identified my mistake. thanks for all the awesome work! Head bow!

1 Like

Any chance this could be migrated into a GitHub Repository so we can auto-update based on progress of the project?

I am learning how to do that now and hope to do this on next update.

Note that the product is relatively stable with no changes in last 3 months. The next update will be mostly minor improvements (user interface, health checks, etc.). Ideas for changes are appreciated!!!!

@Gutheinz - I love this SA btw. Works awesome!!

1 Like

Dave Gutheinz

Thanks for your tutorial and code. My TP link plugs are now working perfectly with the Smartthings system. Thanks!!

1 Like

Just want to say thanks for the effort. Just a simple question! When I add the device handler the smartapp doesn’t show up. I have added and removed multiple times and the same thing happens. I cannot add see the smartapp via the phone app or in API, so I’m sitting doing something wrong and cannot figure it out.

Cheers

I am trying to get the node hub working on my Linux server running Node.Js version 8.9.4 it runs for a little while then it errors out and crashes with the following error

deviceCommand sending to IP: 192.168.1.11 Command: {"system":{"get_sysinfo":{}}}
Command Response sent to SmartThings
_http_outgoing.js:494
    throw new Error('Can\'t set headers after they are sent.');
    ^

Error: Can't set headers after they are sent.
    at validateHeader (_http_outgoing.js:494:11)
    at ServerResponse.setHeader (_http_outgoing.js:501:3)
    at Socket.socket.on (/home/smartbulbs/TP-LinkServer_v3.js:92:13)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)

I have been previously using the cloud version but i find its slower in reacting to on/off commands compared to the hub version

i will look at it today or tomorrow. I have to reload the devices and review notes. Need to know which device and handler you are using.

Best advice. Reread the instructions. You have to add both the appropriate device handler as well as the Service Manager (smart app).

Dave, I know things have been very wonky and laggy the last few days. Seems like things have normalized…at least for me. My TP-Link plugs are working just fine without lag again (after the outage mess) but when I log in to my IDE it shows my 3 tplink plugs as inactive but everything else is active. Frankly, don’t know what their status was before the outage. Is this normal? Should I even worry about it since they seem to be responding in the smart app normally? Big thanks!

I would not worry about the state on the ide (active/inactive) AS LONG AS the devices are controllable and provide the proper state on the phone app when updating.

Hi Dave

I am using LB120 with energy meter. Quick question how does the energy meter stuff work when using hub mode ? Are some stats not available ?

Thanks

The energy monitor data is the same in either product (hub / cloud). For the bulbs, the numbers are kind of bogus. It is a calculated number based on the brightness level of the bulb and the runtime.

Hub error. Your error may be one I have had before (and thought I corrected). Basically, the energy monitor usage stats come back in two or more messages from the server (one for each month), so I usually need the data from two messages. I had this handled earlier, but will need to revisit. Hopefully sometime this next week.

Hi…

Can help what does this error mean?

error java.lang.NullPointerException: Cannot get property ‘value’ on null object

before that everything work well. I just change to a new kasa account and trying to re-add the devices back and got this error.

TIA

David,

The error message means that data was not received somewhere. However, I need to know exactly where in the Service Manager you were and what steps you took up to that point. You can use the installation guide as a means of communicating this point.

Basically i got 2 kasa accounts. 1 old 1 new

my old account had problem with alexa detecting new hs110 plug. Samsung smart things had no issues detect new devices from the smartapps u provide.

So what i do is that i create a new kasa account and re-add all the devices to the new kasa account and also rename most of the devices. i got about 40 Hs110.

And from the samsung smartthing apps i go to the smart apps TP Link i change to the new account.

It can detect the correct number of devices but i just cant add them in and from the live log i get this error’ error java.lang.NullPointerException: Cannot get property ‘value’ on null object

Some of the devices name is not correct.

1 things i observe that the existing devices i do not need to delete, i just need to refresh a few times and it can show online.

THe only problem now is unable to add in.

So what should i do?

TIA

I would still like the data on exactly when you get the null pointer exception. It would tell me where to look in the routines to determine where the error is occurring.

Helpful would be:
    a.  A capture of your smartphone's page when the error occurs.
    b.  Go to the IDE,
          1.  Select "My Locatoins" and your current location.
          2.  On the, toward the bottom, select "List SmartApps
          3.  Select the "TP-Link (unofficial) Connect (dev)" line.
          4.  Under "Application States", there is an area "Devices".  Copy this text and paste in a reply to me.
    c.  At the top of the above page, there is a field "List Events".  Select that and copy / paste those results in a reply.

Other notes:

  1. Since you have HS110 devices, make sure that the non-energy monitor device handler is in you SmartThings IDE device handler page.

  2. If all else fails: Assuming that is the case, then I think you have “confused” the state database and I will likely not be able to duplicate (you have a lot of devices). This will take several minutes and disconnect any routines you may already have, but it may be the only fix available.

A quick fix using the phone app.

a. DELETE ALL DEVICES.
b. Delete the Service Manager (Smart app)
c. Add the Service Manager back in
d. Run the service manager, get a token, and add the devices.

If you are uncomfortable on sharing this level of data on this blog, I can give you a temp e-mail to send to me.

How to send PM?

lol

sorry newbie

No problem. a temp mail address is

djguttemp@att.net