Page 4 of 5

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

PostPosted: Sat Oct 12, 2019 8:30 pm
by arthurdaire
I have been using this plugin for a while to control a water feature in the hallway (on and off with movement in the hallway). It suddenly stopped working yesterday . the plug has a static IP address. I have reloaded it multiple times and restarted the server, but no luck.

Here is the log:

13 Oct 2019 at 10:27:40 am
Z-Wave received "motion sensor -Kitchen " status update is on
Trigger Start variable timer
Z-Wave received "Motion Sensor-Main entrance hallway " status update is on
Trigger Water feature on and off
Trigger motion in main hallway between 7 am and 6 pm
TP-Link Device (plugin.py:actionControlDimmerRelay:247): called with: actionValue : 0
configured : True
delayAmount : 900
description : turn on device
deviceAction : TurnOn
deviceId : 1382865271
replaceExisting : True
textToSpeak : for water feature plug.
TP-Link Device Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 250, in actionControlDimmerRelay
KeyError: key multiPlug not found in dict

Sent Hue Lights "Hallway lights" on to 100 at ramp rate 5.0 sec.
Sent Hue Lights "Hallway lights" on to 100 at ramp rate 5.0 sec.

13 Oct 2019 at 10:28:12 am
Z-Wave received "Motion Sensor-Bedroom lounge" status update is on

13 Oct 2019 at 10:28:30 am
TP-Link Device (plugin.py:actionControlDimmerRelay:247): called with: actionValue : 0
configured : True
delayAmount : 900
description : turn on device
deviceAction : TurnOn
deviceId : 1382865271
replaceExisting : True
textToSpeak : for water feature plug.
TP-Link Device Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 250, in actionControlDimmerRelay
KeyError: key multiPlug not found in dict

TP-Link Device (plugin.py:actionControlUniversal:333): Action: actionValue : 0
configured : True
delayAmount : 900
description : status request device
deviceAction : RequestStatus
deviceId : 1382865271
replaceExisting : True
textToSpeak : for device: water feature plug.
TP-Link Device (plugin.py:getInfo:316): Called for: water feature plug.
TP-Link Device Error (plugin.py:getInfo:323): water feature plug: Device not reachable and states could not be updated. u'192.168.86.170'
Z-Wave received "Pantry door sensor 1" status update is on
Trigger Pantry door-on
Z-Wave received "swimming pool Tamper Switch" status update is off
Error ElementNotFoundError -- could not find action group with element ID 1421157122
Sent Hue Lights "Pantry hue" on to 100 at ramp rate 2.0 sec.
Z-Wave received "Motion Sensor-Main entrance hallway " status update is off
Trigger motion in main hallway between 7 am and 6pm -off
Sent Hue Lights "Hallway lights" off at ramp rate 5.0 sec.



Your help will be appreciated.

Arthur

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

PostPosted: Sun Oct 13, 2019 4:52 pm
by madscientist
arthurdaire wrote:
I have been using this plugin for a while to control a water feature in the hallway (on and off with movement in the hallway). It suddenly stopped working yesterday . the plug has a static IP address. I have reloaded it multiple times and restarted the server, but no luck.


Try deleting and re-adding the TP-Link device. I was having a similar problem and that worked for me.

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

PostPosted: Sun Oct 20, 2019 9:15 pm
by arthurdaire
Thank you ! That worked. :D !

Appreciated

Arthur

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

PostPosted: Thu Nov 14, 2019 1:06 am
by MarcoGT
Which the status of the plugin regarding this wall plug?

https://www.amazon.de/gp/product/B06W58 ... 1195&psc=1

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

PostPosted: Thu Nov 14, 2019 7:43 am
by jtburgess
I don’t know about that particular device, but if it works with the “kasa” app, it should work here.
Let us know how it goes.

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

PostPosted: Tue Feb 04, 2020 9:28 am
by jacobsen
I'm adding my first TP-Link devices to a working Indigo 7.4 setup. I installed version 0,8.1 of the plugin,

An HS300 power strip (6 outlets) seems to be working fine. It has hardware version 1.0 and firmware version 1..0.10

But the two HS110 plugs don't seem to work. They both report hardware version 1.0 and firmware version 1.2. 5 When I define the HS110 plugs with polling enabled, the log shows:

TP-Link Device Polling started for Kitchen Fridge@192.168.42.103.
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: [Errno 57] Socket is not connected. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:118): Kitchen Fridge connection failed with ([Errno 57] Socket is not connected)
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: [Errno 57] Socket is not connected. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:353): Error attempting to update Kitchen Fridge: 'power_mw'. Will try again in 10 seconds
TP-Link Device Error (tpl_polling.py:run:348): Unable to update Kitchen Fridge: after 10 attempts. Polling for this device will now shut down. ('power_mw')
TP-Link Device Polling stopped for Kitchen Fridge@192.168.42.103.

These lines come very fast; despite what the log says, it is definitely not waiting 10 seconds to retry.

If instead, I define it will polling disabled, it seems to start OK, although the messages are a bit confusing:

TP-Link Device Polling thread not started for device Kitchen Fridge, 192.168.42.103. It has polling disabled
TP-Link Device Polling started for Kitchen Fridge@192.168.42.103.

and I can turn the device off OK. But when I then try to turn the device back on the Indigo log reports an error:

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

Any suggestions on what I can do to debug this further?

Thanks in advance!

Bob

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

PostPosted: Mon Feb 24, 2020 12:05 am
by jacobsen
The problem above with the single-outlet Kasa plug seems to be because it's reporting

states : States : (dict)
accumEnergyTimeDelta : 0 (integer)
accumEnergyTotal : 0 (integer)
alias : Fridge 1 (string)
curAmps : 0 (integer)
curEnergyLevel : 0 (integer)
curVolts : 0 (integer)
curWatts : 0 (integer)
onOffState : on (on/off bool)
rssi : -69 (integer)
totWattHrs : 0 (integer)

(I've attached the debug log) when the plugin is looking for

# totAccuUsage = float(dev.pluginProps['totAccuUsage'])
curWatts = data['emeter']['get_realtime']['power_mw']/1000
curVolts = data['emeter']['get_realtime']['voltage_mv']/1000
curAmps = data['emeter']['get_realtime']['current_ma']/1000
totWattHrs = round(float(data['emeter']['get_realtime']['total_wh'])/100, 1)
# totWattHrs = round( float( (data['emeter']['get_realtime']['total_wh'])/100) - totAccuUsage, 1)

Note "power_mw", which is what threw the exception, vs curEnergyLevel or curWatts; see also voltage_mv and current_ma

It's not clear to me whether this is how all HS110 devices behave, or just ones with the more recent firmware. Does anybody have a HS110 working? If so, what version is it?

The TP-Link Plugin is working with HS200 in-the-wall switch

PostPosted: Thu Mar 05, 2020 2:25 pm
by stanleykrasnow
I just installed an in-the-wall Kasa Smart Light Switch by TP-Link (item number HS200) and it is working well with the Indigo TP-Link plug-in. Thank you to all who worked on the plug-in.

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

PostPosted: Wed Sep 23, 2020 10:35 am
by godzuki
hi all, just bought some kasa/tp-link smart plugs (the single socket ones) and they become disabled in the console every few days. the checkbox for "enable indigo communications" becomes unchecked for some reason.

anyone had this happen before... know how to fix?

tia

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

PostPosted: Wed Sep 23, 2020 5:49 pm
by jtburgess
It needs a static IP address. I notice when the IP address of my device changes I lose communication with it.
Go into your DHCP server and assign it an address so it doesn’t change..

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

PostPosted: Mon Nov 23, 2020 12:33 pm
by jay (support)
Anyone know if the KP400 dual outdoor plug works with the plugin?

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

PostPosted: Mon Nov 23, 2020 12:41 pm
by jtburgess
Jay:
No clue. But if you use the Kasa app to control it, it probably will work.
Search prior posts for how to deal with multiple outlet devices.

-- John

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

PostPosted: Tue Nov 24, 2020 3:00 pm
by jay (support)
jay (support) wrote:
Anyone know if the KP400 dual outdoor plug works with the plugin?


Answer - yes. I've confirmed the following work with the plugin:

KP400 (outdoor plug-in)
HS105 (single outlet plug-in)
HS107 (dual outlet plug-in)

If you are using anything else from TP-Link (Kasa), please post the model number here along with what it is. I'm going to add these to the Compatible Devices database for easier discovery.

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

PostPosted: Tue Nov 24, 2020 3:18 pm
by FlyingDiver
HS100 plug
HS107 dual plug
HS200 light switch

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

PostPosted: Tue Nov 24, 2020 6:16 pm
by jay (support)
Thanks, I've added all of these. Anyone else try any of the others?