[RELEASE] TP-Link Plug, Switch, and Bulb integration


#185

This has stopped working for me, any tips?


#186

fixed with a complete uninstall of devices and app and resinstall of v4.1


#187

Make sure your bulbs have reserved ip addresses.


#188

Version 4.1 is far better. Aaron suggested that you reserve the IP addresses. In case you did not know, that is done on your router. This is necessary in the rare occasion where a device is off-line and when coming back on-line is assigned a new IP address.

The Application (if you used it) also has the ability to update the IP address of the child devices. You only have to run it and it will automatically update each IP address. (I wanted to do this automatically, but it was a LOT of LAN traffic each time it occurs).

Also, note that if you desire, you can place the devices in local access only through the Kasa App.

dave


#189

This worked fantastic for me with my TP-LINK HS-100's, thanks a lot!


#190

I've got a little oddity that may be nothing, but... It's an HS105 and I think I've got Ver 4.1 installed but the device says 4.0.03. Please take a look:

Is that all as it should be? Or have I screwed up something? Thanks, Dave.


#191

Not to worry about. No impact on function; however, a Save Preferences should clear it up. You will also need to run the application (this will update the application version. Note, that some of the other data is legacy. There is no way to delete - but there is no impact.


#192

@djgutheinz

Hey Dave...so I am running into an issue after the update. My Aquarium; HS100, had a firmware update and now TP-Link Device Manager doesn't see it anymore. Also I am having a comms error. Looks as though I can't force the IP address anymore so I have no idea what maybe going on. Thoughts?

Aquarium HS100 device:

TP-Link Device Manager Status (notice no Aquarium listed)


#193

It looks like the app is NOT seeing the HS100 at all. I see you have another HS100 on the list - so if that firmware updated, it is not the firmware but likely something that is disabling the plug itself.

Was it working OK before the firmware update??? Things to try:

a. Open the Kasa phone app and see if it can control your aquarium.
1. If not, Unplug the plug and see again. Also try resetting the plug.
2. If this fails, look at the TP-Link forum.

b. Run the application with logging enabled. That will see if there are any errors involved.

Once the above is confirmed, then try the app again.

You can also (without deleting) do a manual installation of the driver. Create a Virtual device with a dni of "TEST-TPLINK" (can actually be anything). Then you will have access to the IP address field in preferences, (The automatic installation has the application managing IP addresses and updating automatically if there is a problem. The manual leaves this to you to look up the IP, etc.)


#194

I will look once I get home tonight. But answer to your question...yes both had firmware updates but only one works correctly.


#195

@djgutheinz

Unplugging and plugging back in worked. Odd the firmware upgrade caused that issue as I could still control through Kasa app.


#197

@djgutheinz

First of all, thank you so much for the amazing work on this application and the drivers!

The problem I'm trying to solve is that I'd like to set timers that start with some of my HS200 switches, but since there's no real-time or near-real-time triggers, the timers only start once a refresh updates the state. I've set all my refreshes to 5 minutes (1 minute refreshes gave too many errors), but that means a 5-minute timer may turn into a 10-minute timer if the switch was turned on right after the last 5-minute refresh.

  1. I have a timer to automatically turn the pantry light off after 5 minutes.
  2. I have timers to automatically turn the closet lights, garage lights, and toilet fans off after 15 minutes.
  3. I have timers to automatically turn the bathroom fans off after 60 minutes.

I can probably live with this up-to-5-minute delay, but it would be much easier on my OCD to have close to real-time event triggers. :wink:

Is there a way to incorporate device polling for events? I'm grasping at straws here, but I think the API exposes a plug.startPolling command and device.on events that may be useful for this instead of relying on obtaining device states during the refreshes. (I've been looking at the API examples at tplink-smarthome-api/events.js at master · plasticrake/tplink-smarthome-api · GitHub)

I'm more than happy to spend time on the code to try figure this out, but my coding skills with these languages are novice at best and I don't really know where to begin looking for this and how to add/enable/modify it. I'm up for the challenge though, if only I can get some pointers.

Cheers!


#198

I am confused on what you are asking. Are you using another solution (Kasa) to control lights outside of HE? If you are then I can understand you dilemma. If not HE should give you that triggered event which then you can use RM to do an action with.

I personally only use the Kasa app to connect new lights/outlets to my home and then all control happens through HE and @djgutheinz app/driver locally. I don’t even use the cloud connectivity option for this.


#199

I think you are discussing a manual switch on of the device. The event that is triggered when this is detected is the attribute "switch".

  1. Refresh does the polling you are discussing (it is the same function for these devices). It gets the current state of the bulb and triggers an event.

  2. The code allows refresh rates down to 1 minute. This would be an average latency of 30 seconds and for OFF timers (I think) would be quite acceptable. You could even adjust downward the timer duration by 30 seconds making the average your original values.

  3. More frequent refresh is possible; however, it causes a significant impact on hub resources to execute. I can provide some code for this; however, I do not recommend this polling frequencies.

Last: what version driver / app are you using?


#200

@djgutheinz Correct, I'm discussing manually switching on the devices. (@aaron Sorry for the confusion!) For example, the kids would turn on the bathroom fan and leave it on all day while everyone's out, or someone would leave a closet light on all day, or leave the garage/pantry light on all night.

Anyway, I've decided that the 5 minute refresh is just fine, and told my OCD to take a chill-pill and let it be. :wink:

As for the driver & app versions I'm using,

  • TP-Link Device Application, Version 4.1
  • TP-Link Plug-Switch Driver, Version 4.1

#201

Yeah if the kiddos/wifey hit the buttons manually then you are kinda SOL. I tend to hide the plug behind an object like furniture. If they really want it off they can use Siri or Alexa to ask for it to turn off. We are an iOS home so all phones and tablets have access through Siri to HE using HomeBridge. Even the 4yo can use her tablet to turn on/off lights which she often does in her own room or the play room.


#202

Change refresh to once per minute. Your hub should work OK unless you have a LOT of devices. And the wife will see an improvement - so you are a hero slaying those energy dragons.


#203

Happy wife, happy life! :wink:


#204

New Hubitat-user.. lots of TP-Link HS110 -- great user app!

The instructions for using an HS-110 with the App --

HS110 TP-Link Plug-Switch (Hubitat).groovy

But in code of the App:

tpLinkModel << ["HS110" : "TP-Link Engr Mon Plug"]

Took me a while to track it down. It works with the correct Driver file.


#205

I will update the instructions to be clearer. Note that the (Hubitat) is there to differentiate from my Smart Things integration within my system. Understand the confusion.