[APP][Pro] TP-Link Smart Devices KASA - central topic

Hi Anne, yes will give the CLI method a go and get back when done.

Regards
John

Hi Anne, output of the install/run log below

C:\Users\John\Downloads\Homey Code\nu.baretta.tplink-master>athom app install
✓ Pre-processing app…
✓ Validating app…
✓ Homey App validated successfully against level debug
✓ Packing Homey App…
— App size: 1.68 MB
✓ Installing Homey App on Homey (https://192-168-2-109.homey.homeylocal.com)…
✓ Homey App nu.baretta.tplink successfully installed

C:\Users\John\Downloads\Homey Code\nu.baretta.tplink-master>athom app run
✓ Pre-processing app…
✓ Validating app…
✓ Homey App validated successfully against level debug
✓ Packing Homey App…
— App size: 1.68 MB
✓ Installing Homey App on Homey (https://192-168-2-109.homey.homeylocal.com)…
✓ Homey App nu.baretta.tplink successfully installed
✓ Running nu.baretta.tplink, press CTRL+C to quit
— Profile your app’s performance at https://go.athom.com/app-profiling?homey=5acb4fa942b2c4296e1626b2&app=nu.baretta.tplink
─────────────── Logging stdout & stderr ───────────────
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] device init
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] id: 453dff16-139b-9c91-7c88-8bdc0d0acecd
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] name: Lounge Light 1
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] class: socket
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] settings IP address: 192.168.2.54
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] dynamicIp is defined: true
2019-04-05 10:46:29 [log] [ManagerDrivers] [hs100] [0] settings totalOffset: 0
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] device init
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] id: 6c01d30c-2f38-8a97-168a-408c82b442fb
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] name: Quiet Room Light
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] class: socket
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] settings IP address: 192.168.2.31
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] dynamicIp is defined: true
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [1] settings totalOffset: 0
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] device init
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] id: bbd52ef2-86f2-5b63-1d11-406812bd8c6d
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] name: Hall
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] class: socket
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] settings IP address: 192.168.2.52
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] dynamicIp is defined: false
2019-04-05 10:46:30 [log] [ManagerDrivers] [hs100] [2] settings totalOffset: 0
2019-04-05 10:46:40 [log] [ManagerDrivers] [hs100] [0] getStatus device: 192.168.2.54
2019-04-05 10:46:40 [log] [ManagerDrivers] [hs100] [1] getStatus device: 192.168.2.31
2019-04-05 10:46:40 [log] [ManagerDrivers] [hs100] [2] getStatus device: 192.168.2.52
2019-04-05 10:46:40 [log] [ManagerDrivers] [hs100] [0] Relay state off
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.52:9999
2019-04-05 10:46:43 [log] [ManagerDrivers] [hs100] [2] Device unreachable. Unreachable count: 1 Discover count: 0 DynamicIP option: false
2019-04-05 10:46:43 [log] [ManagerDrivers] [hs100] [2] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.52:9999
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:46:43 [log] [ManagerDrivers] [hs100] [1] Device unreachable. Unreachable count: 2 Discover count: 0 DynamicIP option: true
2019-04-05 10:46:43 [log] [ManagerDrivers] [hs100] [1] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:46:50 [log] [ManagerDrivers] [hs100] [0] getStatus device: 192.168.2.54
2019-04-05 10:46:50 [log] [ManagerDrivers] [hs100] [1] getStatus device: 192.168.2.31
2019-04-05 10:46:50 [log] [ManagerDrivers] [hs100] [0] Relay state off
2019-04-05 10:46:50 [log] [ManagerDrivers] [hs100] [2] getStatus device: 192.168.2.52
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.52:9999
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [2] Device unreachable. Unreachable count: 3 Discover count: 0 DynamicIP option: false
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [2] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.52:9999
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [1] Device unreachable. Unreachable count: 4 Discover count: 0 DynamicIP option: true
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [1] Unreachable, starting autodiscovery
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [1] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:46:53 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:00 [log] [ManagerDrivers] [hs100] [0] getStatus device: 192.168.2.54
2019-04-05 10:47:00 [log] [ManagerDrivers] [hs100] [1] getStatus device: 192.168.2.31
2019-04-05 10:47:00 [log] [ManagerDrivers] [hs100] [0] Relay state off
2019-04-05 10:47:00 [log] [ManagerDrivers] [hs100] [2] getStatus device: 192.168.2.52
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.52:9999
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [2] Device unreachable. Unreachable count: 5 Discover count: 1 DynamicIP option: false
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [2] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.52:9999
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Device unreachable. Unreachable count: 6 Discover count: 1 DynamicIP option: true
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Unreachable, starting autodiscovery
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:03 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:10 [log] [ManagerDrivers] [hs100] [0] getStatus device: 192.168.2.54
2019-04-05 10:47:10 [log] [ManagerDrivers] [hs100] [1] getStatus device: 192.168.2.31
2019-04-05 10:47:10 [log] [ManagerDrivers] [hs100] [2] getStatus device: 192.168.2.52
2019-04-05 10:47:10 [log] [ManagerDrivers] [hs100] [0] Relay state off
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.52:9999
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [2] Device unreachable. Unreachable count: 7 Discover count: 2 DynamicIP option: false
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [2] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.52:9999
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Device unreachable. Unreachable count: 8 Discover count: 2 DynamicIP option: true
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Unreachable, starting autodiscovery
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:13 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:20 [log] [ManagerDrivers] [hs100] [0] getStatus device: 192.168.2.54
2019-04-05 10:47:20 [log] [ManagerDrivers] [hs100] [1] getStatus device: 192.168.2.31
2019-04-05 10:47:20 [log] [ManagerDrivers] [hs100] [2] getStatus device: 192.168.2.52
2019-04-05 10:47:20 [log] [ManagerDrivers] [hs100] [0] Relay state off
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Settings deviceId: 8006781E6111CA298AE7A545213F1D54186CD182
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Host: 192.168.2.54 deviceId: 800609A244C63B3C17896963D4E344AE1850EFF1
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.52:9999
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [2] Device unreachable. Unreachable count: 9 Discover count: 3 DynamicIP option: false
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [2] Caught error in getStatus / getSysInfo function: connect EHOSTUNREACH 192.168.2.52:9999
[undefined] device.send() Error: connect EHOSTUNREACH 192.168.2.31:9999
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Device unreachable. Unreachable count: 10 Discover count: 3 DynamicIP option: true
2019-04-05 10:47:23 [log] [ManagerDrivers] [hs100] [1] Unreachable, starting autodiscovery

Mmm. Clearly Homey can’t reach 192.168.2.31 and 192.168.2.52. 192.168.2.54 ([hs100][0] is OK.

For 192.168.2.31 ([hs100][1]) the ‘DynamicIP option’ is enabled, for .52 ([hs100][2]) it is not. It seems the app has at some point connected to .31, as the ID (8006781E6111CA298AE7A545213F1D54186CD182) is in the settings for the device. However, the autodiscovery only discovers the plug with the .54 IP, and not the one with the .31 IP.

I don’t know what the issue is. If you try to delete and add (pair) a device you will get some more output on the discovery process.

You mention ‘HS1000’ several times, you mean ‘HS100’, correct?

HI Anne, yes sorry HS100. You are correct in saying that .31 was connected and in fact all of the ones that now do not connect were connected at one time.

The problem started a couple of weeks ago when Homey lost connection to one and I could not re add it. I did then try and disconnect a further one and try to add it just to see if the problem was the switch. It now seems if I disconnect any of the HS100’s that I cannot re-add.

One thing I have not done is restart the router, which is a mesh Netgear Orbi, though I did have a power cut out at the weekend and have not run the set-up since so I am going to try the install of the app again and adding one of the uncontactable HS100’s.

Will let you know how I get on.

Regards

John

Hi Anne

Thanks for your assistance, seems like it was something to do with my router as after mentioning that the router had a restart at the weekend, I tried installing the app again through the CLI and got no errors.
I have since been able to add flows and control my TP-Link devices.

Regards
John

Glad to hear it :blush::+1:

@anne I just started using the app and up to now it works great and it is very easy to install devices. I was wondering how often the app is polling the devices to check what their status is? Or is this just only done at the moment you open the Homey app? I worried that if I add to many devices Homey is constantly polling devices and my wifi network will get slower.

The app polls each device every 10 seconds. The cpu load is minimal, I wouldn’t worry about it.

Don’t take my word for it, just have a look at https://insights.homey.app/ and check the CPU usage for the app. The highest peak I have seen is 0,03% (with four TP-Link devices), and generally it is much lower (so low the graph look weird, with values like 0,00015% :thinking:).

I’m not worried about the CPU load of Homey but more about my 2.4Ghz wifi network which gets a request every 10 seconds for each device.

Traffic/bandwidth wise it’s next to nothing, you won’t be able to see any impact on your network traffic.

Hi Anne,

The app is not working as expected. You asked me to post on the community forum. What information do you need?

Hi Laurens,

I don’t need anything, thanks, but through the forum we can communicate without the limitations imposed on the review comments in the app store. I will have an update you can test any moment, with a bit of luck later today.

Note that the app was not updated by the way, the appstore was updated an messed up many things, among others the date of the latest app update (which actually is 9 months ago or so). The app submission process has also changed with the new app store, it seems I have to option to let you test the new app before it is released to the public, I think I will get a link where you can go to download the app.

About this connectivity issues, before Homey V2 there were no issues at all. Since V2 there is an increase and, recently with 3.1.0rc3 there was another spike. It seems that I can’t/couldn’t catch the errors in the app due to a problem in the underlying library. I have now included an update of this library which may address this. Hopefully it helps.

Personally I never have connectivity issues with the TP-Link devices, and I know that one issue I can’t do anything about is the general stability issues that still plague Homey. Usually this is related to high memory and cpu usage, so you will know when that is the case for you.

Finally, I have stated this before, but the app development is purely a hobby, I don’t get anything for it.
Friendly feedback through the forum (positive or negative) tends to be a good motivator, whereas single star ratings (particularly with short uninformative comments…) in the store are not. So to all users with issues, please use the forum.

I’ll PM you a link for the test version once I get it, thanks,

Regards, Anne

Anne,

I understand. I will wait for your link. And i will remove my 1 star rating off course. It was only that i didnt knew the right way to communicate with you. No i do, so thanks for that!

Thanks! :+1::blush: And no worries, I understand it’s annoying when something breaks…

I have the updated app ready in the store for testing, only waiting for clarification on how to install it from the new appstore… :flushed:

Nice! I’m looking forward to install the new version of the app to see if our problems are solved. Should be great! Please let me know if you know any more about how to install the new version.

Hi Laurens,

The update can be installed here as a test (beta) version:

Note that I have done some basic testing for the powerplugs and bulbs (on/off, dim, change color), I have not yet tested all the flowcards (mainly for the bulb which has more options than the powerplugs…). It’s a case of ‘should work’ (famous last words… :wink:).

Hi Anne,

I installed it. It look all fine at first sight. But have to wait overnight as the problems that i had were happen randomly during the day. After restarting homey it was working again for a random time.

P.S. check your donation link. I found in your app.json that the paypal link should be paypal.me/baretta but on the app page it is linked to your e-mail address instead of /baretta

Hi Laurens,

I hope the update works for you. About the paypal link, I noticed this too. When the app is published the link will be corrected based on app.json. Thanks :+1:

@DaVoezzz you have just tripled the total amount of donations for my apps, thanks! :smiling_face_with_three_hearts:

Now I REALLY hope the update fixes the problem :sweat_smile:

1 Like

Anne, unfortunately it doesn’t work… the same problem as first.