I’ll just throw in that I’ve had the same problem I have a number of TP-link devices and the probability of getting them all up on a HA reboot is now slim. The devices always work directly through the TP-link and confirm connection through my router. My next step is to put them in the config file and turn off auto discover. Kind of annoying as I bought a bunch of TP-link switches for the price and HA integration.
Okay, I did the manual configuration using static IP addresses. It has been stable for days. For me, it appears the problem is in HA with the automatic addition of TP-link devices.
My issue was caused by my Virgin media router changing the dhcp lease to 10 minutes!
I’ve changed it to 7 days and tp-link devices are now stable
I have been having the same problem with my TP-Link devices (35 of them) going unavailable. I really haven’t paid much attention to HA in the past year or so and now ‘suddenly’ (to me) I am having these problems. A couple of nights ago I rebooted my router and HA at the same time and every single device came up ok. Then this morning I did the 108.9 update and now have lost 3 devices.
Question: Is this related so some type of keep alive timeout? I remember back in the day when I was manually adding my devices in the configuration.yaml I didn’t seem to have this problem.
Any advise?
Thanks!
My 2c…
It seems there are valid concerns about the stability of this integration, but…
I too suffered from constantly unavailable TP-link smart lightbulbs.
I’ve been using DHCP reservations for most of the time I’ve had these bulbs (about 6 months), but our bedroom where I use these are quite far from the WiFi AP (access point), event though I thought the reception was decent. I then used one of the many WiFi analyser apps you can get for iOS (or Android) and noticed a severe drop-off in throughput as I moved from near the AP to the bedroom.
Yesterday, I pulled a cable through the room and installed a second AP, and voila!
Unless you’re willing to dig into the integration’s code, there are things under your control to improve on the situation:
- Use DHCP reservations (or very long leases)
- Make sure you have a reliable connection
Here you can see the unstable period where it jumps between off (red) and unavailable (grey). Since improving my network there was only one blip between 2 and 3 am.
I think it is bug in integration. Have switched back to configuration.yaml config for tplink and now they are no more unavalible
Just wanted to chime in here that I have 10 different TP-Link devices, mixture of light switches, dimmer switches, smart plugs, and enegry monitoring smart plugs. They would all randomly go unavailable, causing issues with automations to re-trigger. Very annoying.
I noticed too that if they’re unavailable during HA starting up, they just get stuck that way, never to come back. It doesn’t seem like HA ever re-triggers auto discovery of TP-Link switches, I wish it would, or at the very least have a service that triggers it so we can automate rediscovery if wanted to!
That being said, to try and combat the problem I’ve now done as others have, removed UI integration, setup via configuration.yaml, and turned discovery off and have set DHCP reservations for all switches and added them via IP. Fingers crossed this fixes the problem long term! It’s a solution I can easily live with!
It would be great to hear from you again soon whether it has helped.
I’m still seeing it dip into unavailable but so far at least it’s coming right back a few seconds later?
It’s odd, the ones that are seeing the most drops are in the same room as a UAP-AC-Pro
I was seeing a lot of drops from antoher switch far away from the AP but I ended up adding a UAP-AC-IW (in-wall) to the basement to extend coverage and that switch hasn’t dropped since, and is now in the same room as that AP.
Weird overall. The TP-Links are solid devices and I’d like to continue to purchase them so I hope this is the answer, as I DO use their cloud integrations too.
To add my experience, it doesn’t appear to be a networking or HA issue. The TP-Link switch ( 10x HS105 and 2x HS110 in my case) appear to go into some sort of sleep mode whenever the mobile application is dorment. When I open the Kasa Mobile App, all switches start as Local Only and slowly become re-enabled. Then my Home Assistant begins switching over from Unavailable to their current states.
It is not a coverage issue for me, I have all my switches on a dedicated 2.4 GHz WiFi channel connected on Meraki APs.
Thanks for the input, Dan. I hope you are wrong, however. I don’t have a lot of faith that TP-Link will address this for the benefit of the HA community. I use the power strips in addition to the HS105s and HS110s and I noticed that individual outlets go Unavailable while others are available, seemingly at random. Would this fit with your theory?
I hope to be wrong as well since TP Link tends to not fulfill their promises.
Some people do have problems with their wifi, especially if their WiFi is not a dedicated 2.4ghz channel. When I ran my WiFi on mixed mode (5ghz/2.4ghz) the switches would become unavailable more often. Even with traffic shaping and mac reservations the switches struggled to stay connected.
It is also possible that updates done by TP-Link changed the ‘wake up’ packet that is used to maintain a regular connection from HA to the devices. I have not looked in to this yet. I did pull up Wireshark to verify that there is regular attempts at communication between HA and TPLink.
Also, I am running HA on a RPi3 in a docker container. The stablest version I have found has been 81.x
Went into the states page, clicked on the HS110, changed the entity name, updated a few config files with the new name, restarted yet again, and it’s behaviour has gone back to normal.
Just an update, it’s been about 6 weeks now, and my HS110 has not gone ‘Unavailable’ once.
FWIW, I have been using the integration, not yaml config.
Just wanted to add my experience with this issue. It didn’t happen til I updated to 0.110.1 but I had multiple occasions where bulbs would go “Unavailable” without a reason, not sure if it happened to any plugs but I could probably check. Also, when I removed the integration and re-added it, it would struggle to find all of my devices (I only have 5 TP Link devices) and I’d have to keep trying til they all appeared.
Last night, whilst trying to find a solution to this issue (and after finding this thread) I went into the Kasa app and went into the Settings (under the hamburger menu) and into Firmware Update. After loading the devices, I discovered that all of my plugs and 1 of the 2 bulbs were running out of date firmware (and completely different versions) so I updated them all then re-added the TP Link integration. Happily, all 5 devices appeared straight away and none of them have gone unavailable today. I know one day isn’t much of a test so I’ll keep monitoring, and as another test, I removed the integration twice more just now and both times that I re-added it, all of the devices were found (I do have to give it a second on the screen that shows the devices that were found) and are all functional.
So my advice to you if you have problems with this is to update your firmware on the devices through the app and then remove and re-add the integration.
As I said, I’ll keep monitoring this and probably report back after a while! But hopefully this helps some people with this issue
I’ve been having this issue for a long time, often times seeing devices become unavailable dozens of times per day. I read on here that turning DOWN router transmit power might be a solution.
I’m going on about 5 days now where I might only have one or two “unavailable” events in a 24 hour period. This is a significant improvement. I have a higher-end Netgear router. I turned down the “max speed” on the 2.4GHz network to 217 Mbps and cut Tx power to 75%. Furiously knocking wood but it seems better. I pretty much only use the 2.4GHz spectrum for home automation uses, or if I’m out in the yard and need coverage. 5GHz is what I use on devices that can really make use of my gig fiber connection.
This was the fix that worked for me. One of my 7 plugs had the wrong time zone and that was the same plug that keep dropping from HA.
Thanks
Are they set with static IPs at least?
Just to add to this discussion, I went and checked and 6 out of my 10 devices had firmware updates available, but the energy monitoring ones did not and that’s one of the ones I WAS having the biggest problem with going unavailable. Not saying that the FW updates will not help, but in this instance it doesn’t apply to the issue I was having.
So far I still see a few random drops that do not last more than 30 seconds to a minute at most now. Prior to setting static IPs and setting them all in configuration.yaml I’d see drops last for HOURS or even days (until HA is restarted). So far this fix has been “so far so good” for me. I only notice the drops if I go look at the logs for specific devices.
Just wanted to chime back in. Just like others on this thread since I moved back to putting TP-Link in the configuration.yaml (back in late April) I have had zero problems (of my now 47 TP-Link lights and switches) go unavailable. STRONG evidence that somethings not right with the integration. Good luck all, I am sticking with the hard coded setup. Working configuration for me is 1. Great WiFi (3 hub mesh network with wired backhall) 2. Every device has a static/reserved IP address. 3. Every device is manually added in the .yaml.
Having issues with this, too. I do not think it is network related because my KP200 smart outlets (which are 1 device but 2 entities for separate plugs) show one of the two entities out while the other is online. Hoping this will help someone smarter than I solve this shared problem.
To echo others, all switches are accessible through Kasa mobile app and on static IPs and this occurs through the integration or YAML with discovery turned off in integration+YAML.