TP-Link WiFi Switches

Forum rules

Questions about hardware that can be controlled by Indigo (but not through the interfaces and plugins listed). If Indigo doesn't support some bit of hardware you're interested in, and you don't find a 3rd Party Plugin for it, add it to this forum. Be sure to include links to as much information as you can find about it.

Note: adding it here does not mean we're going to add it - in fact it's possible one of our 3rd party developers may decide to write a plugin for it. We add hardware/features based on a lot of different factors beyond just having a request for it.

Posted on
Sun Sep 22, 2019 9:48 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: TP-Link WiFi Switches

CliveS wrote:
Due to the Alexa Hue being neutered (thanks Amazon!!) I decided to buy an HS110 and it works well but when I Send Status Request or Update I get the following error

Code: Select all
 TP-Link Device Error            Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 333, in actionControlUniversal
TypeError: not enough arguments for format string
Thanks. Looks like a bug. I'll check it out.

Posted on
Sun Sep 22, 2019 10:41 am
jtburgess offline
User avatar
Posts: 77
Joined: Jan 17, 2018
Location: NJ

Re: TP-Link WiFi Switches

New release 0.8.1 uploaded.
Thanks berkinet for the quick fix turnaround!

Posted on
Sun Sep 22, 2019 10:53 am
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: TP-Link WiFi Switches

jtburgess wrote:
New release 0.8.1 uploaded.
Thanks berkinet for the quick fix turnaround!


That fixed it, thanks Berkinet for that and great plugin from all 3 off you.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sat Dec 21, 2019 4:34 am
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: TP-Link WiFi Switches

Hi Guys
He work with HS100 but get this error continuously on idle:
Code: Select all
TP-Link Device Error (tpl_polling.py:run:118): Basement Outlet Subwoofer connection failed with ([Errno 57] Socket is not connected)

this one when I toggle on or off :
Code: Select all
TP-Link Device Error            (tpl_polling.py:run:118): Basement Outlet Subwoofer connection failed with ([Errno 57] Socket is not connected)
   TP-Link Device Error            Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 284, in actionControlDimmerRelay
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/TP-Link-Device.indigoPlugin/Contents/Server Plugin/protocol.py", line 124, in send
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
error: [Errno 57] Socket is not connected

   TP-Link Device Error            (tpl_polling.py:run:118): Basement Outlet Subwoofer connection failed with ([Errno 57] Socket is not connected)

Posted on
Sat Dec 21, 2019 10:45 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: TP-Link WiFi Switches

qcvictor wrote:
Hi Guys
He work with HS100 but get this error continuously on idle:
Code: Select all
TP-Link Device Error (tpl_polling.py:run:118): Basement Outlet Subwoofer connection failed with ([Errno 57] Socket is not connected)
...

It looks like your connection to the plug is not working. The error message Socket is not connected refers to an IP network socket rather than a wall plug.

Posted on
Sat Dec 21, 2019 11:32 am
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: TP-Link WiFi Switches

humm not sure to understand, when I toggle On or Off the plug through indigo, she is well controlled !

Posted on
Sun Dec 22, 2019 12:45 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: TP-Link WiFi Switches

qcvictor wrote:
humm not sure to understand, when I toggle On or Off the plug through indigo, she is well controlled !

The retry algorithm on a send may be different than that used to check status. But, in any case, it appears the problem is in your network and not the plugin. You might try moving the plug closer to a Wi-Fi his as a test.

Posted on
Mon Dec 30, 2019 3:42 pm
noeau offline
Posts: 2
Joined: Feb 01, 2019

Re: TP-Link WiFi Switches

Same here. I get the "socket not connected" error on 2 of 3 switches. The third one is in the same circuit and location as the other 2. I just updated to the newest plugin and re-added the 3 plugs. They work fine. I just get the error message every second or so.

Posted on
Tue Dec 31, 2019 3:25 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: TP-Link WiFi Switches

noeau wrote:
Same here. I get the "socket not connected" error on 2 of 3 switches. The third one is in the same circuit and location as the other 2. I just updated to the newest plugin and re-added the 3 plugs. They work fine. I just get the error message every second or so.

Please note, the physical electrical circuit to which the TP-Link plug is connected means nothing. All that matters is the quality of the Wi-Fi connection between the TP-Link device and the Wi-Fi network. The error you and @qcvictor are reporting is occurring in the section of the code where the plugin polls the device for its current state. If you are interested, here is the actual code involved.
Code: Select all
            try:
               result = tplink_dev_states.send('info')
               self.logger.debug("%s connection received (%s)" % (self.name, result))
               data = json.loads(result)
            except Exception as e:
               self.logger.error("%s connection failed with (%s)" % (self.name, str(e)))
The error occurs on the attempt to get the current state (result). The error reported is caused because no connection to the TP-Link is opened. This may be due to poor connectivity, network congestion or the target device being busy.

If you want to try a small experiment, and are comfortable editing Python code, you could try to increase the socket connection timeout value. The is located in tplink_smartplug.py on line 36
Code: Select all
s.settimeout(2.0)
You can try increasing the value to 3.0, 3.5 or even 4.0. If that works, please report back here and I can update the plugin.

Posted on
Tue Dec 31, 2019 3:07 pm
noeau offline
Posts: 2
Joined: Feb 01, 2019

Re: TP-Link WiFi Switches

I don't know if it makes a difference but the one that works has a hardware version of 2.0 and Firmware of 1.5.4. And the two that don't work are hardware version 1.0 with a firmware of 1.2.5

Posted on
Wed Jan 01, 2020 4:05 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: TP-Link WiFi Switches

noeau wrote:
I don't know if it makes a difference but the one that works has a hardware version of 2.0 and Firmware of 1.5.4. And the two that don't work are hardware version 1.0 with a firmware of 1.2.5

It might be a timing difference between the two versions of the hardware. But in any case it is still not really a plug-in issue, other than adjusting the socket connection timeout, which might or might not work.

Posted on
Wed Dec 09, 2020 6:33 pm
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: TP-Link WiFi Switches

Quick question: what all data is required to add another device? I looked on Amazon and found they had KL100s for under $15 apiece, so I ordered one for the heck of it... the plugin finds it and IDs the model number just fine, but when I try to save, it fails with a message that ChildID not found in dict... which I assume means it didn't find the model number and associated command information. If I could find any hints on what commands to put in the dict, I'd be willing to add it myself and post it back...

Posted on
Wed Dec 16, 2020 4:09 pm
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: TP-Link WiFi Switches

Any experience with the Kasa Smart HS220 Dimmer Switch by TP-Link? Seems like a great alternative to Insteon dimmers (which re not available right now anyway)

Posted on
Mon Dec 21, 2020 8:27 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: TP-Link WiFi Switches

My only experience is with the HS200 "on/off" switch, which works wonderfully (at least for the past week) in an environment where insteon signals are being trashed by a pump controller. But looking at the 0.8.1 TPLink, code while trying to add a KL110 bulb to the capabilities, it looked like the command set for the KASA devices did not include any commands other than on and off despite the fact that the devices are defined as Indigo dimmer devices. But I admit I could have missed it since I wasn't looking in that direction.

Posted on
Mon Dec 21, 2020 11:43 am
jtburgess offline
User avatar
Posts: 77
Joined: Jan 17, 2018
Location: NJ

Re: TP-Link WiFi Switches

The current TP-link device type is “relay”.
I will be defining a new “dimmer” device, once I figure out how to integrate new logic into the existing code.
The code I’ve found so far is python3, so I’m working on learning and back-porting it.
Stay tuned.

Who is online

Users browsing this forum: No registered users and 4 guests

cron