WTH Does the TP-Link Integration still have the "unavailable" bug

That’s not entirely true, both me and @rytilahti (mostly him :wink: ) have been working to completely rewrite the GitHub - GadgetReactor/pyHS100: Python Library to control TPLink Switch (HS100 / HS110) Python library to be asynchronous. This new library is here GitHub - python-kasa/python-kasa: 🏠🤖 Python API for TP-Link Kasa Smarthome products.

There is an open PR here WIP: Convert tplink integration to use a new asyncio-enabled backend library by rytilahti · Pull Request #30719 · home-assistant/core · GitHub that attempts to implement using the new library, however, this is an ongoing work.

1 Like

Thank you!! From my perspective, it looked like that effort had died about a year ago. Glad to see there’s still work going on behind the scenes. I’d be happy to help test, if it didn’t take too steep a learning curve. Unfortunately, I have other priorities and can only dabble with HA intermittently.

1 Like

@basnijholt I noticed the KP400 (Kasa Outdoor Plug) is not in the list of supported devices. Will that be supported in the updated integration?

1 Like

Keep up the great work guys. Super noob here waiting patiently for a HomeAssistant-friendly fix to come out. These are nice, cheap smart plugs and it’s been frustrating to have them go unavailable in HA. We’ll get there someday!

1 Like

That fully depends on an enthusiastic contributor!

I hear ya. I wish I could help!

But the current integration does support the KP400. Maybe you could keep the existing code in place for devices that your new version does not yet support? Just to keep as much compatibility as possible.

Actually, the new package does also support it, see these lines. The README is just not up-to-date I guess.

Awesome! Thanks for the info. I’m looking forward to a production release of the new one! Do you have any estimated timeline?

I have the KP303 Strip/Plug and found that there is a new firmware update released by TP-Link today, which is version 1.0.10 in my case.

Changelog:

  1. Improved performance and fixed some minor bugs.
  2. Enhancements for WiFi stability.

I haven’t updated yet but maybe these issues are from the device firmware themselves and not necessarily the integration?

Interesting. I just looked at my HS110’s in Kasa, and it shows an update available from 1.2.5 to 1.2.6, dated the 25th of last month. The only change listed is “Optimized total performance.”

Obviously, these are different devices than your KP303, and your release notes sound much more promising than mine. But I’m thinking maybe we should all compare notes on what firmware versions we have, and what sort of fixes are being made.

Anyone else?

Adding the tplink files from TheGardenMonkey into custom_components seems to have helped a bit with my HS300. It seems more stable but i still see message like the following in my logs.

2020-10-22 22:58:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.washer is taking over 10 seconds
2020-10-22 22:58:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.freezer is taking over 10 seconds
2020-10-22 22:58:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.dryer is taking over 10 seconds
2020-10-22 22:58:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.wap_outside is taking over 10 seconds
2020-10-22 22:58:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.plug_3 is taking over 10 seconds
2020-10-22 22:58:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.weedwacker is taking over 10 seconds
2020-10-22 22:59:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.washer is taking over 10 seconds
2020-10-22 22:59:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.freezer is taking over 10 seconds
2020-10-22 22:59:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.dryer is taking over 10 seconds
2020-10-22 22:59:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.wap_outside is taking over 10 seconds
2020-10-22 22:59:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.plug_3 is taking over 10 seconds
2020-10-22 22:59:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.weedwacker is taking over 10 seconds
2020-10-22 23:00:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.washer is taking over 10 seconds
2020-10-22 23:00:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.freezer is taking over 10 seconds
2020-10-22 23:00:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.dryer is taking over 10 seconds
2020-10-22 23:00:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.wap_outside is taking over 10 seconds
2020-10-22 23:00:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.plug_3 is taking over 10 seconds
2020-10-22 23:00:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.weedwacker is taking over 10 seconds
2020-10-22 23:00:47 WARNING (MainThread) [homeassistant.components.switch] Updating tplink switch took longer than the scheduled update interval 0:00:30

I’m having the same problem, and when I tried the files from TheGardenMonkey, it didn’t load. I got and error about not setup file in the logs

Has there been any update to this? I’m just recently got some HS100 plugs to use with HA and today all of a sudden they’ve become unavailaible. I can no longer re-add them, as they’re not being detected using the UI or by manually added them to the config file.

Is there any way I can get these working again?

I’m also suddenly having this problem. I have an HS100 in my daughters room connected to a heater but has recently gone unavailable. I removed the integration from the UI and tried adding it manually but still not picking it up.

I hope it gets fixed because it’s a great device and does the job I need it to do easily.

I, too, have this problem. In my case I have 8 HS100 plugs, 2 HS110 plugs and 2 KL50 bulbs.

Everything bar 2 of the HS100s works as expected. Very occasional ‘unavailable’ on a HS100, but a HA restart fixes that.

Using the Kasa app I have found that of my 8 HS100s I have:

2 hardware version 1.0; firmware 1.2.5
4 hardware version 2.1; firmware 1.5.10
2 hardware version 4.1; firmware 1.1.0

Of these it is both the hardware version 4.1 sockets that have now gone totally unavailable.

I am on HA 0.117.6 on a Rasberry Pi. I have tried it with the release version and I have also tried it with @TheGardenMonkey files on github. And both those versions with and without explicit reference to the devices ip addresses in a tplink: section of config.yaml.

What I am seeing when monitoring the journal when using the custom components or the homeassistant components is

[pyHS100.discover] Unable to find the device type field!
...
[custom_components.tplink.common] Unable to communicate with device 192.168.1.141: Communication error
[custom_components.tplink.common] Unable to communicate with device 192.168.1.144: Communication error
[homeassistant.components.switch] Platform tplink not ready yet. Retrying in 180 seconds.
...

Continually repeated every 3 minutes. The .141 and .144 being the two version 4.1 sockets.

Prior to HA 0.117 it had been working, so I downgraded to 0.116.4, but now get the same issue as above. So it appears it maybe outside of HA.

Have tp-link changed their api for the newer devices?

seems so
https://community.home-assistant.io/t/tp-link-hs110-smart-plug-disappears-after-latest-firmware-update/244229/18

Firmware 1.1.0 for Hardware rev 4.1 will kill these plugs as far as the HA integration is concerned.It seems that the update was to fix a security vulnerability by locking the plug interface down.

Uggggh! Thank you, at least I understand now. Thank you Which? (and I’m a subscriber!!).

I will add my comments to tp-link and see if we can get a username/password or other ‘security access’ code added so that we can get our home automation automated again.

1 Like

KP-303 just stopped working this morning before I initiated the firmware update, now in an unavailable state again.

Have hit the Same issue very disappointing. One thing is for sure the access is not 100% secret as Amazon Alexa still works for me and I have Old and New firmware HS100’s (Not tried Google).