TP-Link Plugin v 0.9.9 / v1.0

Posted on
Mon Jul 04, 2022 2:19 pm
jtburgess offline
User avatar
Posts: 69
Joined: Jan 17, 2018
Location: NJ

TP-Link Plugin v 0.9.9 / v1.0

I'm posting a new python3 / Indigo v2022 compatible version of my TP-link plugin.

There is one notable , much-requested new feature: polling parameters that can be controlled at the plugin level, and/or overridden for specific devices.
See the Readme. The "Send Status " request reports on all settings, including what level the value comes from.

As you know if you've been using this plugin, I do _not_ have every device TP-link, kasa-compatible device type. Specifically I do NOT have any multi-outlet power strips, nor any device with energy reporting, nor any dimmer switches (only a dimmer bulb which uses a different protocol.) I would appreciate hearing from any of you with those device types so that I know they work before I promote this to an official v 1.0.0 :D

Thanks, and enjoy,.

-- John

Posted on
Sun Jul 24, 2022 10:54 am
sumocomputers offline
Posts: 238
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.9 / v1.0

I have several HS-110 smart outlets with energy monitoring, and have been running version 0.9.8.7 of the plugin.

While the energy monitoring has been working great since your recent fixes (thank you), I have noticed that the devices keep getting disabled within Indigo, and stay disabled.

I just installed 0.9.9 and will give it a go, but wondering if there were any fixes around devices becoming disabled/re-enabled between 0.9.8.7 and 0.9.9?

My guess is that these little low-end devices lose WiFi connectivity from time to time, and maybe they get disabled in this scenario, but never get re-enabled when they come back online.

Is there any way the plugin is able to re-enable a device once it is reachable again?

Thanks,

Chris

Posted on
Sun Jul 24, 2022 8:25 pm
sumocomputers offline
Posts: 238
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.9 / v1.0

I just saw the "Shutdown the device after these many missed polls" option and set it to a very large number of 99999999999999999999.

Seems like this will probably fix my issue.

Posted on
Sat Jul 30, 2022 1:48 pm
sumocomputers offline
Posts: 238
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.9 / v1.0

I am still having an issue where the TP-Link devices become disabled for some reason, not sure how long it takes after re-enabling it.

I did have WiFi down for a couple of days, but shouldn't that have been addressed by having the Shutdown the device after these many missed polls set to 99999999999999999999?

I haven't dug into the logs to see what is going on exactly, but will monitor the device every day, since I couldn't figure out a clean way to have Indigo send me an alert if one of the TP-Link devices becomes disabled.

Posted on
Sat Jul 30, 2022 2:17 pm
sumocomputers offline
Posts: 238
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.9 / v1.0

So I found a couple things:

1. If I unplug the TP-Link HS-110 device from AC Power (which disconnects it from Wi-Fi), within about 30 seconds, the TP-Link Plugin disables the device.
2. If I plug the TP-Link HS-110 device back into AC Power (which re-connects it to Wi-Fi), within about 30 seconds, the device is back on WiFi network, but the TP-Link plugin never re-enables it.

It would be great if the plugin could do that. Or maybe it should, but isn't currently working? I thought that was what the "Shutdown the device after these many missed polls" feature was supposed to do?

In the meantime, here are the Schedule & Trigger I setup to work around the problem:

Schedule
Monitors the TP-Link Device Stats and writes to a variable TRUE or FALSE
Code: Select all
dev1_enabled = indigo.devices[1656812175].enabled
indigo.variable.updateValue(1173808372, str(dev1_enabled))


Trigger
When variable becomes FALSE:
    Send a notification
    Re-enable communications (built-in TP-Link plugin action)

Posted on
Mon Aug 01, 2022 1:59 pm
gordonmad@icloud.com offline
Posts: 5
Joined: Apr 26, 2022

Re: TP-Link Plugin v 0.9.9 / v1.0

Hi-Im running TP-Link Plugin v0.9.8, since I can't find any later versions.
I have been using TP-Link smart smart power strips KP-303 v2.8.
Indigo v2022.1.2 loads these just fine and I can see them in the device window.
I can access them to turn the individual power ports off and on without any problems.
The trouble I'm having is not being able to include them as a responder to one of my 8 button multi switch's.
They do mot show up.
Am I doing something wrong?
All help is appreciated.
Thanks

Posted on
Mon Aug 01, 2022 4:19 pm
sumocomputers offline
Posts: 238
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.9 / v1.0

gordonmad@icloud.com wrote:
Hi-Im running TP-Link Plugin v0.9.8, since I can't find any later versions.
I have been using TP-Link smart smart power strips KP-303 v2.8.
Indigo v2022.1.2 loads these just fine and I can see them in the device window.
I can access them to turn the individual power ports off and on without any problems.
The trouble I'm having is not being able to include them as a responder to one of my 8 button multi switch's.
They do mot show up.
Am I doing something wrong?
All help is appreciated.
Thanks


Not sure if the newer 0.9.9 will fix your problem, but you can get it on GitHub here:

https://github.com/jtburgess/indigo-TP- ... master.zip

Posted on
Tue Aug 02, 2022 2:32 pm
gordonmad@icloud.com offline
Posts: 5
Joined: Apr 26, 2022

Re: TP-Link Plugin v 0.9.9 / v1.0

Thanks-Got it but when I go into manage my links for my 8 button switch to assign them to a button and select New Link to Responder they do not show up as an option. They don't show up under the New Link to Controller either.
Thanks

Posted on
Tue Aug 02, 2022 2:34 pm
sumocomputers offline
Posts: 238
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.9 / v1.0

Maybe create and “issue” on the developers GitHub page. I think he follows that more closely

Posted on
Tue Aug 02, 2022 2:46 pm
gordonmad@icloud.com offline
Posts: 5
Joined: Apr 26, 2022

Re: TP-Link Plugin v 0.9.9 / v1.0

Forgot to add that I installed the latest v but still no change.

Posted on
Fri Aug 05, 2022 5:23 pm
JustJack offline
Posts: 46
Joined: Feb 16, 2013
Location: Ca

Re: TP-Link Plugin v 0.9.9 / v1.0

Hi John,

You mentioned that you would like to know if anyone has tried a multistrip device. I have a H300(US) that I am trying to add. When I tried your plugin I incurred to issues and then a failure.

Issue#1 - plugin could not auto discover the device so I tried to add it by manually providing the IP address.. The device is on a different subnet than the indigo server is. its on my ioT subnet. The device is recognized my the Kasa app and I can control the strip and read power usage values.

Issue#2 is that after I try to add it by IP address the plugin seems to be able to find the device but some of the properties are wrong and it eventually just fails to add the device. Below is the debug output from your plugin.

Code: Select all
Aug 5, 2022 at 3:57:25 PM
   TP-Link Devices                 (plugin.py:selectTpOutlet:601): called for: , tplinkSmartPlug, 728641675.
   TP-Link Devices                 (plugin.py:selectTpOutlet:637): returned: OA=[]
   TP-Link Devices                 (plugin.py:getTpDevice:506): called for: , tplinkSmartPlug, 728641675.
   TP-Link Devices                 (plugin.py:getTpDevice:520): received {}

Aug 5, 2022 at 3:57:45 PM
   TP-Link Devices                 (plugin.py:selectTpDevice:540): called for: tplinkSmartPlug, 728641675, 192.168.0.0.
   TP-Link Devices                 (plugin.py:selectTpOutlet:601): called for: , tplinkSmartPlug, 728641675.
   TP-Link Devices                 (plugin.py:selectTpOutlet:630): outlets avail: 1
   TP-Link Devices                 (plugin.py:selectTpOutlet:632): loop 0
   TP-Link Devices                 (plugin.py:selectTpOutlet:637): returned: OA=[('00', 1)]

Aug 5, 2022 at 3:58:14 PM
   TP-Link Devices                 (plugin.py:selectTpDevice:540): called for: tplinkSmartPlug, 728641675, 192.168.20.76.
   TP-Link Devices                 (plugin.py:initializeDev:316):  called with: UiValuesDict : (dict)
     SlowDown :  (string)
     StopPoll :  (string)
     SupportsEnergyMeter : true (bool)
     SupportsEnergyMeterCurPower : true (bool)
     WarnInterval :  (string)
     actionButton :  (string)
     address : 192.168.20.76 (string)
     addressSelect : manual (string)
     devPoll : false (bool)
     displayManAddress : true (bool)
     displayManAddressButton : true (bool)
     displayOk : false (bool)
     energyCapable : false (bool)
     initialize : false (bool)
     manualAddressResponse : true (bool)
     multiPlug : false (bool)
     newDev : true (bool)
     offPoll :  (string)
     onPoll :  (string)
     outletNum :  (string)
     outletsAvailable : 1 (string)
     simpleSeparator1 :  (string)
     totAccuUsage : 0 (string).
   TP-Link Devices                 (protocol.py:debugLog:220): Sent:  {"system":{"get_sysinfo":{}}} == info
   TP-Link Devices                 (plugin.py:initializeDev:329): new device at 192.168.20.76: InitializeDev 3 got b'{"system":{"get_sysinfo":{"sw_ver":"1.0.12 Build 220121 Rel.175814","hw_ver":"2.0","model":"HS300(US)","deviceId":"80067CE8F98FB8BE6F49F4B9200591F21F39F636","oemId":"32BD0B21AA9BF8E84737D1DB1C66E883","hwId":"955F433CBA24823A248A59AA64571A73","rssi":-37,"latitude_i":373861,"longitude_i":-1220429,"alias":"TP-LINK_Power Strip_8AD4","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM:ENE","mac":"6C:5A:B0:6D:8A:D4","updating":0,"led_off":0,"children":[{"id":"80067CE8F98FB8BE6F49F4B9200591F21F39F63600","state":1,"alias":"Laptop ","on_time":337304,"next_action":{"type":-1}},{"id":"80067CE8F98FB8BE6F49F4B9200591F21F39F63601","state":1,"alias":"Plug 2","on_time":339160,"next_action":{"type":-1}},{"id":"80067CE8F98FB8BE6F49F4B9200591F21F39F63602","state":1,"alias":"USB3 Charger ","on_time":339160,"next_action":{"type":-1}},{"id":"80067CE8F98FB8BE6F49F4B9200591F21F39F63603","state":1,"alias":"Plug 4","on_time":339160,"next_action":{"type":-1}},{"id":"80067CE8F98FB8BE6F49F4B9200591F21F39F63604","state":1,"alias":"Plug 5","on_time":339160,"next_action":{"type":-1}},{"id":"80067CE8F98FB8BE6F49F4B9200591F21F39F63605","state":1,"alias":"Plug 6","on_time":339160,"next_action":{"type":-1}}],"child_num":6,"err_code":0}}}'
   TP-Link Devices                 (plugin.py:initializeDev:332): new device at 192.168.20.76: InitializeDev 4 got {'system': {'get_sysinfo': {'sw_ver': '1.0.12 Build 220121 Rel.175814', 'hw_ver': '2.0', 'model': 'HS300(US)', 'deviceId': '80067CE8F98FB8BE6F49F4B9200591F21F39F636', 'oemId': '32BD0B21AA9BF8E84737D1DB1C66E883', 'hwId': '955F433CBA24823A248A59AA64571A73', 'rssi': -37, 'latitude_i': 373861, 'longitude_i': -1220429, 'alias': 'TP-LINK_Power Strip_8AD4', 'status': 'new', 'mic_type': 'IOT.SMARTPLUGSWITCH', 'feature': 'TIM:ENE', 'mac': '6C:5A:B0:6D:8A:D4', 'updating': 0, 'led_off': 0, 'children': [{'id': '80067CE8F98FB8BE6F49F4B9200591F21F39F63600', 'state': 1, 'alias': 'Laptop ', 'on_time': 337304, 'next_action': {'type': -1}}, {'id': '80067CE8F98FB8BE6F49F4B9200591F21F39F63601', 'state': 1, 'alias': 'Plug 2', 'on_time': 339160, 'next_action': {'type': -1}}, {'id': '80067CE8F98FB8BE6F49F4B9200591F21F39F63602', 'state': 1, 'alias': 'USB3 Charger ', 'on_time': 339160, 'next_action': {'type': -1}}, {'id': '80067CE8F98FB8BE6F49F4B9200591F21F39F63603', 'state': 1, 'alias': 'Plug 4', 'on_time': 339160, 'next_action': {'type': -1}}, {'id': '80067CE8F98FB8BE6F49F4B9200591F21F39F63604', 'state': 1, 'alias': 'Plug 5', 'on_time': 339160, 'next_action': {'type': -1}}, {'id': '80067CE8F98FB8BE6F49F4B9200591F21F39F63605', 'state': 1, 'alias': 'Plug 6', 'on_time': 339160, 'next_action': {'type': -1}}], 'child_num': 6, 'err_code': 0}}}
   TP-Link Devices                 (tplink_relay_plugin.py:initializeDev:60):  called with: UiValuesDict : (dict)
     SlowDown :  (string)
     StopPoll :  (string)
     SupportsEnergyMeter : true (bool)
     SupportsEnergyMeterCurPower : true (bool)
     WarnInterval :  (string)
     actionButton :  (string)
     address : 192.168.20.76 (string)
     addressSelect : manual (string)
     devPoll : false (bool)
     deviceId : 80067CE8F98FB8BE6F49F4B9200591F21F39F636 (string)
     displayManAddress : true (bool)
     displayManAddressButton : true (bool)
     displayOk : false (bool)
     energyCapable : false (bool)
     initialize : false (bool)
     manualAddressResponse : true (bool)
     model : HS300(US) (string)
     multiPlug : false (bool)
     newDev : true (bool)
     offPoll :  (string)
     onPoll :  (string)
     outletNum :  (string)
     outletsAvailable : 1 (string)
     simpleSeparator1 :  (string)
     totAccuUsage : 0 (string).
   TP-Link Devices                 (tplink_relay_plugin.py:initializeDev:65): 192.168.20.76 has child_id
   TP-Link Devices Error           Error in plugin execution UiAction:

  File "plugin.py", line 587, in selectTpDevice
type: name 'dev' is not defined

   TP-Link Devices                 (plugin.py:validateDeviceConfigUi:216): called with typeId=tplinkSmartPlug, devId=728641675, and address=192.168.20.76.
   TP-Link Devices                 (tplink_relay_plugin.py:validateDeviceConfigUi:35): called with typeId=tplinkSmartPlug, devId=728641675, and address=192.168.20.76.
   TP-Link Devices Error           Error in plugin execution UiValidate:

  File "plugin.py", line 230, in validateDeviceConfigUi
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/TP-Link-Device.indigoPlugin/Contents/Server Plugin/tplink_relay_plugin.py", line 38, in validateDeviceConfigUi
type: key deviceId not found in dict

   TP-Link Devices                 (plugin.py:selectTpOutlet:601): called for: , tplinkSmartPlug, 728641675.
   TP-Link Devices                 (plugin.py:selectTpOutlet:609): 1 in dictoutlets avail 1
   TP-Link Devices                 (plugin.py:selectTpOutlet:611): 2 in dictoutlets avail 1
   TP-Link Devices                 (plugin.py:selectTpOutlet:613): 3 in dictoutlets avail 1
   TP-Link Devices                 (plugin.py:selectTpOutlet:637): returned: OA=[('00', 1), ('01', 2), ('02', 3), ('03', 4), ('04', 5), ('05', 6)]


I would be happy to help you out if you could point me in the right direction

Jack

Posted on
Fri Aug 05, 2022 5:25 pm
JustJack offline
Posts: 46
Joined: Feb 16, 2013
Location: Ca

Re: TP-Link Plugin v 0.9.9 / v1.0

forgot to tell you than I am running you latest version, not the one that the store points you to.

Jack

Posted on
Mon Aug 08, 2022 2:45 pm
gordonmad@icloud.com offline
Posts: 5
Joined: Apr 26, 2022

Re: TP-Link Plugin v 0.9.9 / v1.0

Hi John,

Had ordered two more TP-Link 303 3 plug power strips but can't even install these. Getting the following error messages in Log:


Aug 8, 2022 at 2:39:41 PM
TP-Link Devices Error Error in plugin execution UiAction:

File "plugin.py", line 587, in selectTpDevice
type: name 'dev' is not defined

TP-Link Devices Error Error in plugin execution UiValidate:

File "plugin.py", line 230, in validateDeviceConfigUi
File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/TP-Link-Device.indigoPlugin/Contents/Server Plugin/tplink_relay_plugin.py", line 38, in validateDeviceConfigUi
type: key deviceId not found in dict

Hope that helps.

Gordon

Posted on
Mon Aug 08, 2022 4:24 pm
gordonmad@icloud.com offline
Posts: 5
Joined: Apr 26, 2022

Re: TP-Link Plugin v 0.9.9 / v1.0

I went back to v9.8 and they were allowed.....

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron