[DEPRECATED] Kasa Plug, Switch, and Bulb integration

your work is certainly appreciated!

Dave and Anthony,

This is truly impressive. I just installed my Hubitate today and setup your new UDP driver for my three HS100s, worked perfectly.

Your work is much appreciated,
Ryan

Glad you like it. The instructions were for a upgrade install and did not include one step:

Assure you assign a static IP address (in your router) for the devices. Otherwise (rarely) you will loose connection.

1 Like

Working great on my HS105. Thank you!

This was the missing thing for me, came here to say it wasn't working, but had to pull the IP and enter it (and reserve it on the router).

1 Like

@djgutheinz This is working great for a couple HS100s I pulled out of the 'Not local device boneyard'. Works so good in fact, I got rid of the trace logs.:grinning:

Thanks for your hard work!

1 Like

Confirming it works great on the tunable white bulb (LB-120).

1 Like

Hello,

I been following your work, I must say it's great and a big thank you for it.

I know in some point you were involved in the Tuya/Smartlife driver, which is very similar with the node.js. Do you know if those devices could get a driver like this? With the UDP? That will be awesome for this community. Thank you.

That would be the decision of @cwwilson08. Looking at his implementation, the API is in java script. Difference, the TP-Link commands are embedded in the driver. Because of my original implementation, the work to go to UDP (i.e., nodeless) was limited to (1) implementing the encryption in the driver language, and (2) implementing the UDP send and initial parse. Not difficult.

To port, the relevant API elements would have to be coded into the Driver and UDP implemented to send the command. Not a trivial task.

I see, thanks for the explanation. By the way, the UDP driver is working with my HE with HS100, thanks!

So I actually did look at this. As @djgutheinz mentioned to port the api elements into the driver is not trivial. Well beyond anything i would be able to do.

Though I do think it is possible.

Hi, thank you for answering

You @djgutheinz and @cwwilson08 should team up!

Happy New Year!

I would not mind. However I think @djgutheinz has better things to do than spoon feed me information. The project was out of my league to begin with. It is a small miracle I got it working for me. I was really hoping I wold spur the interest of people with more skills than myself.

Dave - this is working brilliantly! Love it!

So two questions:

  1. Do we need the TP-Link HE app anymore?
  2. What is recommended refresh time from your initial experience?
  1. App is not necessary if you have set up "static" IPs for the devices through your router.
  2. The default 10 minute is great for normal operations. Faster would be desirable if you have (a) a rule machine that reacts to changes and (b) a lot of activity that does not go through Environment. These activities include google and amazon linked to the Kasa app instead of Hubitat integration, direct use of the Kasa App to change state.

The old smart app has code that will delete the child devices if you delete the smart app (do not delete). A new smart app will come out today or tomorrow (in final testing) with update instructions. It can be deleted after update w/o deleting child devices.

1 Like

Version 4.0 (UDP Version) Update Announcement

The full Version 4.0 UDP version with drivers and application have been completed. Installation files and Install/Update instructions can be found at:

9 Likes

@djgutheinz

Dave - I am absolutely AMAZED! So not only did you improve local execution using UDP but you also made to installation/upgrade SO easy. I didn't have to input IP addresses or anything. This is truly a work of art. Kudos to you for this incredible integration!

5 Likes

It was actually fun. I really enjoy trying new things (UDP) and actually getting them to work.

5 Likes

Hi @djgutheinz

I have been wanting to integrate my TP-Link plugs for a long time now but never got the time to setup the pi with node.js for it, this is awesome!!

That said, I'm unable to discover my devices (5x HS105). Looking at the code I realized that the discovery checks for every IP on the same subnet as the Hub and I have the plugs in a separate subnet for non-trusted IoT devices, so I hardcoded the networkPrefix to my IoT subnet but still, nothing gets discovered...

Do you know if these devices have some kind of restriction where they only accept UDP connections or commands from the same subnet or something like that?

The bulbs have no restrictions.
a. Try a manual installation for one device and see if it works.

b. Separate segment for untrusted devices. Not even sure if Hubitat supports separate subnets for devices??? I do know (in my router) you have to set up the router to allow cross access.

c. For the HS-105, if you move them to your trusted segment and then place them in Local only mode through the Kasa App, then they will no longer be accessible to the Kasa App. (Note, if you use Amazon, you can use the Hubitat integration to control.)

d Debug code. In the App and Driver are the following two lines:

def debugLog() { return false }

// def debugLog() { return true }

Reverse these to get full debugging.