TP-Link Plugin - How To (v0.1.2)

Posted on
Wed Jul 25, 2018 9:22 pm
jtburgess offline
Posts: 24
Joined: Jan 17, 2018

TP-Link Plugin - How To (v0.1.2)

The TP-Link Plugin brings TP-Link SmartPlugs into indigo.
This is a trial release. I know it needs work and I'd appreciate your input.

A SmartPlug is a WiFi enabled plug, similar in behavior to an Insteon or X-10 plug, so it is modeled as a "relay" (on/off) type Device.

Download the plugin here: https://github.com/jtburgess/indigo-TP-LInk/releases/download/0.1.2/TP-Link-Device.indigoPlugin.zip.
Install by double-clicking the downloaded plugin.

You'll need to know the IP address of your SmartPlug, which you can get from your DHCP server, typically your gateway/Wifi Router.
It's a good idea to configure a static IP for SmartPlugs on the DHCP server if it supports that capability.
This will make sure it always gets the same address should the router reboot or otherwise has its DHCP cache cleared.

Then add a new Device. Select Type = "TP-Link Device", and Model = "SmartPlug".
Aside - There may be other TP-Link device types. If you know of any, let me know.
It will ask for the address.
That's it!
Click On to turn it on, and Off to turn it off.

Repeat for other SmartPlugs.

Since a SmartPlug can also be controlled by Alexa or the "Kasa" app, the "Send Status Request" button will update Indigo with the on/off state returned from the device itself. It also prints complete information about the device into the Indigo Log.

Known bug: The state value shows as" true"/"false" when you turn it on/off, but shows as "on"/"off" as returned by status. I'm working on it. Suggestions on a fix are welcomed.

Posted on
Mon Aug 13, 2018 7:44 pm
akimball offline
User avatar
Posts: 458
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: TP-Link Plugin - How To (v0.1.2)

Picked up a TP Link Kasa smart plug from Amazon.com. They were on sale for $10 (quantity one). I didn't even know there might be a plugin and your timing was great. This one...

https://www.amazon.com/gp/product/B01K1 ... UTF8&psc=1

Not sure if they are still on sale; if you've bought an Amazon Echo, ever, Amazon will let you buy one of these for $10 at checkout by entering the code "SMART10" ... but i think the sale may be over.

Thought I'd report no issues whatsoever. Worked first time and it's speedy. I suppose I can delete the TP-LINK app they made me download to get the unit online initially... I won't use it, we have indigo after all. Except for one contingency...

If I pull this thing out of the wall there is no way to force it into the same IP address on my DNS without doing a DHCP RESERVATION. I locked it down on my network. That required knowing the MAC Address of the TP Link device... which is what the APP gave me.

Using the MAC address I ID'd the device for your plugin and then also did the reservation.... very easy. Thanks for the plugin.

-Al

Posted on
Mon Aug 13, 2018 8:03 pm
jtburgess offline
Posts: 24
Joined: Jan 17, 2018

Re: TP-Link Plugin - How To (v0.1.2)

I did the same thing, bought one for $10 along with an Echo Dot, and that’s why I created the plugin.
For mine, I created a static DHCP mapping to solve the reboot problem.

I hadn’t thought about using MAC address. That’s a good idea, and I’ll look into it.
Another thought is that maybe it uses the name you give it in the Kasa app for the local DNS. That would be even easier, if it’s true.

I’m adding both to my ToDo list.

Thanks for the feedback.

Posted on
Mon Aug 13, 2018 8:41 pm
akimball offline
User avatar
Posts: 458
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: TP-Link Plugin - How To (v0.1.2)

I prefer in-wall devices mostly....but sometimes a roaming outlet fits the bill, like this tp link. That’s why I bought this and also why it’s likely to get unplugged and reassigned with another IP address when used again. The reservation works well. Typically I have about 25% of my network IP addresses populated with wifi devices so there’s plenty of reservation space on my network.

Thanks again. Your plugin does a great job. I love having such low latency.

-Al

Posted on
Tue Aug 14, 2018 9:45 am
jay (support) offline
Site Admin
User avatar
Posts: 14659
Joined: Mar 19, 2008
Location: Austin, Texas

Re: TP-Link Plugin - How To (v0.1.2)

akimball wrote:
I love having such low latency.


Big +1 for locally controllable WiFi devices!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Aug 14, 2018 7:49 pm
akimball offline
User avatar
Posts: 458
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: TP-Link Plugin - How To (v0.1.2)

So tonight I tried to do a little more with the pluging. I got it going easily with both Siri and Alexa. But not so good with indigo touch. I use a toggle control to turn on/turn off all my other plugs, with a little fake blue led on the indigo touch interface. Looking at the log, the off command is sent, but the fake glowing led in my interface stays on (no status reported I guess). The real led on the tp-link goes off as the event log showed. So it did get turned off. Trying to turn it back on with the same toggle switch control doen’t work since it always thinks its on. Even though it was clearly sent the off command and turns off. I can turn it back on by sending it a turn ‘on’ command from siri, alexa, indigo, but not my indigo touch user interface.

I know the work around is to not use the toggle commands and use two separate UI controls, one for off command and the other for on command....but wanted you to know something’s not reporting status on the plugin.

More information: From the device screen in Indigo 7, if I press the “send status request” button...this is what i get in the event log (see below).

Theory: i may have messed it up by giving it the name “roamIO Plug” in the KASA app initialization, the I renamed it to “Great Room Camera” in indigo for Alexa purposes.
Attachments
IMG_0428.jpg
IMG_0428.jpg (227.8 KiB) Viewed 153 times

-Al

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests