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

Posted on
Sat Oct 12, 2019 8:30 pm
arthurdaire offline
Posts: 5
Joined: Dec 07, 2016

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

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

Posted on
Sun Oct 13, 2019 4:52 pm
madscientist offline
Posts: 80
Joined: Jan 05, 2007
Location: Ontario, Canada

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

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.

Posted on
Sun Oct 20, 2019 9:15 pm
arthurdaire offline
Posts: 5
Joined: Dec 07, 2016

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

Thank you ! That worked. :D !

Appreciated

Arthur

Posted on
Thu Nov 14, 2019 1:06 am
MarcoGT offline
Posts: 728
Joined: Sep 11, 2014
Location: Germany

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

Which the status of the plugin regarding this wall plug?

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

Posted on
Thu Nov 14, 2019 7:43 am
jtburgess offline
User avatar
Posts: 43
Joined: Jan 17, 2018
Location: NJ

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

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.

Posted on
Tue Feb 04, 2020 9:28 am
jacobsen offline
Posts: 2
Joined: Feb 03, 2020

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

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

Posted on
Mon Feb 24, 2020 12:05 am
jacobsen offline
Posts: 2
Joined: Feb 03, 2020

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

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?
Attachments
KasaDebug.txt
Debug log file section
(4.07 KiB) Downloaded 10 times

Posted on
Thu Mar 05, 2020 2:25 pm
stanleykrasnow offline
Posts: 11
Joined: Dec 10, 2018

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

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.

Who is online

Users browsing this forum: No registered users and 1 guest