TP-Link Plugin v 0.9.3

Posted on
Wed May 11, 2022 1:41 pm
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: TP-Link Plugin v 0.9.3

I had to quit using Kasa devices - for me, they fall off the network every couple of months and require power cycling to get them back (unplug, wait a while, then plug them back in). I think their WiFi implementation is sketchy...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed May 11, 2022 2:44 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: TP-Link Plugin v 0.9.3

Yeah, basically I have the same problem Jay has

Posted on
Thu May 12, 2022 2:37 pm
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.3

@jtburgess

Any chance you will be updating the plugin for Indigo 2022.1 with Python 3 support on macOS 12.3?

I get the following errors in the log and assuming it is a Python issue? This is on an HS110 which does support Energy Monitoring.

Code: Select all
TP-Link Devices Error           (tpl_relay_poll.py:run:322): Error attempting to update new device: 'power_mw'. Will try again in 2 seconds
TP-Link Devices Error           (tpl_relay_poll.py:run:317): Unable to update new device: after 10 attempts. Polling for this device will now shut down. ('power_mw')
Last edited by sumocomputers on Thu May 12, 2022 9:13 pm, edited 1 time in total.

Posted on
Thu May 12, 2022 7:49 pm
Ramias offline
Posts: 272
Joined: Nov 24, 2015

Re: TP-Link Plugin v 0.9.3

I have updated Indigo to 2022.1 (but have not yet updated MacOS to 12.3) and my TP-Link Kasa devices are working normally.

Posted on
Fri May 13, 2022 7:36 pm
Ramias offline
Posts: 272
Joined: Nov 24, 2015

Re: TP-Link Plugin v 0.9.3

Following up to add -- I upgraded to MacOs 12.3 and Indigo 2022.1 and this plugin is working fine.

Posted on
Fri May 13, 2022 7:38 pm
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.3

Just curious if you have devices with energy monitoring?

And do you have polling turned on?

Posted on
Fri May 13, 2022 9:35 pm
Ramias offline
Posts: 272
Joined: Nov 24, 2015

Re: TP-Link Plugin v 0.9.3

Hs300 power strips. Yes polling on. And I have the issue wheee the drop from wifi and get disabled but that predates 2022.1.

Posted on
Fri May 13, 2022 9:51 pm
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.3

I found that if I turn Polling on and Energy monitor off, everything is fine.

As soon as I turn Energy monitor on, it gives the errors and disables the plugin.

Posted on
Sat May 14, 2022 10:14 am
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.3

I also tried going back a few versions all the way to 0.9.3, but still can't get the plugin to work...

Posted on
Sat May 14, 2022 3:18 pm
Ramias offline
Posts: 272
Joined: Nov 24, 2015

Re: TP-Link Plugin v 0.9.3

Maybe the issue is unique to the HS110? Can you ping it reliably? These devices are known for poor wifi.

If it helps here's a sample log entry:

Code: Select all
TP-Link Devices                 (tpl_relay_poll.py:run:78): TV Room Apple TV connection received ({"system":{"get_sysinfo":{"sw_ver":"1.0.21 Build 210524 Rel.161309","hw_ver":"1.0","model":"HS300(US)","deviceId":"REDACTED","oemId":"REDACTED","hwId":"REDACTED","rssi":-62,"longitude_i":-REDACTED,"latitude_i": REDACTED,"alias":"TP-LINK_Power Strip_78C1","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM:ENE","mac":"REDACTED","updating":0,"led_off":1,"children":[{"id":"REDACTED","state":1,"alias":"TV Room Camera HDMI","on_time":156364,"next_action":{"type":-1}},{"id":"REDACTED","state":1,"alias":"TV Room Dash","on_time":70754,"next_action":{"type":-1}},{"id":"REDACTED","state":1,"alias":"TV Room Apple TV","on_time":3836365,"next_action":{"type":-1}},{"id":"REDACTED","state":1,"alias":"TV Room Yamaha","on_time":156377,"next_action":{"type":-1}},{"id":"REDACTED","state":1,"alias":"TV Room Sonos","on_time":70732,"next_action":{"type":-1}},{"id":"REDACTED","state":1,"alias":"TV Room Mini","on_time":3836365,"next_action":{"type":-1}}],"child_num":6,"err_code":0}}})

Posted on
Sat May 14, 2022 3:25 pm
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.3

I have been polling these HS110 devices for years with a Python Script to get real-time energy usage, and I have never had them drop (I have a Unifi AP very close to them). I have maybe 3 years of Grafana data, with no hiccups due to Wi-Fi.

Problem is that the reliable script I was using is Python 2, and since I am not a developer, I am not sure how to convert it to Python 3. Jay said in another thread it would be non-trivial.

Turns out the developer of the original script ported it to Python 3, but I can't quite figure out how to make it work, since they are a lot of improvements and additions to the script.

In any case, I am hoping the original developer of this plugin is still alive and willing to take a look.

Posted on
Fri May 20, 2022 9:39 am
jtburgess offline
User avatar
Posts: 78
Joined: Jan 17, 2018
Location: NJ

Re: TP-Link Plugin v 0.9.3

Sumocomputers: As we discussed, your device has a different set of attributes (e.g., power, voltage). I now recognize those, without dividing by 1000.

Ramais: It recognizes the original attributes (e.g., power_ma, voltage_mv) as mill values, and divides the result by 1000 before saving to normalize as the original code did.

This is available on GitHub as 0.9.8.7. I will create an indigo tag once the next topic is resolved.

All : I can change it so that it never disables polling, but just slows down the polling rate and report lack of response every 5 tries.
It will resume normal polling when the device does eventually respond. What say you? Would this be a better behavior than arbitrarily disabling the device, which I too have seen and agree is annoying.

Posted on
Fri May 20, 2022 5:50 pm
Ramias offline
Posts: 272
Joined: Nov 24, 2015

Re: TP-Link Plugin v 0.9.3

I like the polling changes. Instead of 5 for reporting interval, can it be made configurable? Reporting interval and time interval (and if you want to increase the time by X for eachre try, that would be cool too).

Posted on
Sun Jun 05, 2022 2:32 pm
Gangotti offline
User avatar
Posts: 81
Joined: Dec 23, 2014
Location: Las Vegas, NV

Re: TP-Link Plugin v 0.9.3

I am seeing the same thing as others where it will work fine for a couple of months and then randomly the communication is disabled in indigo. at first, I thought it was a Network issue since their address would change on a power cycle so I gave them a fixed IP address in the Unifi switch and that seemed to keep everything happy after a power cycle, Now I am seeing usually 1 or 2 will randomly have their communications check box get magically unchecked. re-enabling communications makes them work again. I do not have any triggers, schedules, or scripts that are disabling communication. Any ideas or is this a bug?

Mac OS: High Sierra
Indigo: 2021.2
PLugin Ver: 0.9.8

Posted on
Sun Jun 05, 2022 3:28 pm
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: TP-Link Plugin v 0.9.3

Gangotti wrote:
I am seeing the same thing as others where it will work fine for a couple of months and then randomly the communication is disabled in indigo. at first, I thought it was a Network issue since their address would change on a power cycle so I gave them a fixed IP address in the Unifi switch and that seemed to keep everything happy after a power cycle, Now I am seeing usually 1 or 2 will randomly have their communications check box get magically unchecked. re-enabling communications makes them work again. I do not have any triggers, schedules, or scripts that are disabling communication. Any ideas or is this a bug?

Mac OS: High Sierra
Indigo: 2021.2
PLugin Ver: 0.9.8


Grab the latest version from GitHub:

https://github.com/jtburgess/indigo-TP-Link

I think it’s version 0.9.8.7

Who is online

Users browsing this forum: No registered users and 21 guests