Ensure you are running HA version .94 or higher and disable the TP-Link discovery. That should never happen again if you do both of those things. I have never had that issue and running .97 right now, disabled auto-discovery and all my TP-Link switches are static.
This issue has nothing to do with Unifi or HA.
The only HA issue is that sometimes the device gets back online and still shows up as unavailable by HA, only by restarting or readding the integration they become available again.
These TP-Link switches seem to be VERY sensitive to interference.
I live in a condominium with high interference on 2.4Ghz, no issues on 5Ghz. Almost all channels are completely used except channel 13 on 2.4Ghz. If these switches used 5Ghz there wouldn’t be any issues but that’s not the case.
I am about to go slip under the door a few notices regarding this issue with people setting their WiFi signal to the max, I know my neighbor next door set their TP-Link router to the max.
Setting their AP to the max doesn’t help their devices connection or bandwidth within their property, it just causes interference for everyone else.
I am about to setup my WiFi Pineapple, turn the power all the way to 11 and start to deauth clients on these networks next door which cause the most interference, since they’re not into IT they will probably reset their router and play with the settings until the issue stops and that’s when their SSID cannot reach my pineapple.
I am even tempted to get a Cisco Meraki just because their performance and coverage which is a LOT better; and their secret sauce: The Air Marshall feature (basically contain all other SSID by deauth’ing all their clients).
Thanks, I’ve set discovery: false
in my config now, and double checked my IP addresses and so far so good.
Thanks for this - fixed the problem for me that no amount of router and HASS restarts would resolve.
Great to hear! I have many TP-Link light switches and plugs, and have always found it best to configure them as static reservations in DHCP, disable TP-Link discovery in HA, and statically define them in configuration.yaml. No issues once they are all setup as static. They are also prone to interference, so I try to use the least congested 2.4Ghz frequency for them to stay connected properly. I wish they could use 5Ghz and/or were not so susceptible to interference. Overall, I’m very happy with them and the integration in HA. Would love to see more TP-Link devices in HA (like the wall outlets) and I might have to start buying them too!
For all of you facing problems with unavailable state on tp-link switches…
My switch HS-110 loses connection every minute since day one…
I tried everything… Turn off discovery, fixed IP adders… etc, etc…
I am using Ubiquiti Power AP N Wifi router… And snce it is ROCK SOLID for years that would be the last thing on my mind… BUT…
I almost gave up… Then I rember that i have one cheap test wifi router from Edimax (about 10 $ worth) in hand.
I set up the router as AP in the same network and connect tp-link switch to that AP an guess what… ROCK SOLID connectinon. Since then I got not even one “unavailable” state ever.
It must be something with wifi chips that are not compatibile.
So for all having same issues first try with other wifi router/AP…It will solve all problems.
Sorry for my English…
Roman
It has been suggested before that WiFi signal too strong may be a problem for some TP-Link devices. Some people have achieved a stable link by turning down the power on routers that support that. Maybe that’s the explanation for your situation.
But again, the real issue here is HA marking the device permanently Unavailable and not recovering the connection when the device is back online a short time later.
Well I tested all possible scenarios. Turning power down, placing the switch on next floor… same problem. Constant “Unavailable” status every minute… 1min On then one minute Off.
Testing with different router (non-ubnt) the TP-Link switch was only 1m away with rock solid connection with not even one “unavailable” status…
I thought that It could help someone if I share what helped in my case.
Thanks for your advice. I received a switch today that was not working on my xiaomi router. It was working perfectly in the app but not in HA.
After reading your comment I changed AP and now it works (let’s see for how long ;p)
humm… i think its unacceptable to change AP or even reduce the range/power of the AP for the TPLink switch to behave normally.
I found the solution to this problem for myself, by replacing it with a shelly plug S.
It works perfectly with no alteration to my AP.
I was having the same problem with 6 smart plugs I bought from Amazon (model HS103P3).
PROBLEM:
They didn’t work remotely when I set them up in my desk at work with my office’s WiFi network.
I tried all 6 of them, reseting some of them multiple times. They only worked for a couple minutes and then showed “Local Only” in the Kasa app and could not be controlled via Alexa or if my phone was disconnected from that WiFi network.
SOLUTION:
I took them to my house and configured them to my home’s WiFi network and they started working as they should, including remote control and Alexa. I took some of them to my friend’s house for a couple days: they worked fine as well. They have been working fine for weeks.
CONCLUSION:
I’m not a networking expert, but I know the network in my office has some advanced settings, perhaps restrictions. For example, if you connect a new computer to the network, you would have to manually assign an IP address, gateway, DNS, and such. So I think it is safe to assume that these TP-Link Smart Plugs don’t work properly in this environment. I specifically mention the brand because in the same office I have an Amazon Echo and Amazon Smart Plug and they work well (the Amazon plug turns itself off when the connection interrupts, but that’s another issue some people are having).
Perhaps adjusting your network settings (maybe DHCP?) will help resolve this issuue until TP-Link comes up with a fix.
Hope this was helpful,
Cheers.
Just to add my voice to this - I’m in the exact same boat, and it’s bad enough on one of my 2 HS200 switches that I’m about ready to just call it a loss and replace them both. Here are examples pics that easily show the issue:
Good:
Not Good:
Same models, same wifi, same everything. Only difference is that the ‘Office Closet’ one is slightly further away from the access point, but still close enough that any other device gets ~3 of 4 bars signal wise, so nowhere near bad enough that it should cause this level of issue. Super stupid.
Hello i have 4 hs110 one still on box i plug the ligth comes up starts blue orange and i can not detect on phone android or iphone or labtop wifi !!!
I think you’re onto something. Come to think about it my TP link devices started playing up when I moved from my Linksys router to Ubiquiti. Also many on this thread demonstrating this problem seem to be on Unifi AP’s.
Don’t get me wrong the problem does not lie with the network, my WiFi has never been better, but there may be something we can change in the settings to fix this?
I’m using a Netgear router. All of my TP-Link WiFi switches and lights drop the connection to HA occasionally, but recover just as quickly … except for the HS200, which occasionally goes offline and stays offline, needing a reboot of HA to reconnect.
TP Link switches are just the worst. I’m in the process of replacing all of mine with Shelly’s and may use the TP’s for christmas lights but the bin is probably where they really belong
We had a power cut recently and after everything came back up I was having random issues with my two Tplink plugs and one of my dafang wifi cameras.
I checked my router and access point, and the wifi channels were the same as usual. However I used a wifi scanning tool on my android tablet and found that my neighbours wifi, after the power cut, had decided to select a wifi channel overlapping with my own (previously their wifi was on another channel, away from my own).
I changed one of my wifi channels to an unused band, so there’s no overlap with the neighbours, and everything has been hunky dorey since. Bit of a pain though that the neighbours router doesn’t just stick to one particular channel after a reboot.
I have an HS100 that was auto-discovered and was doing fine until it’s IP address changed after a number of things were rebooted.
WARNING (SyncWorker_0) [homeassistant.components.tplink.switch] Could not read state for 192.168.1.236: Communication error
I was able to get it back after disabling it and re-enabling (I might have had to do that more than once).
If the integration stores the IP address, it seems likely to break unless you’ve given the devices a static IP. Off the top of my head, it seems like the integration should re-run the discovery process if devices it has stored the IP address for have gone away.
Where does HA store configuration like IP address for auto discovered devices? It’s not in the config file, so I’m guessing it’s in the DB. Any semi-easy way to see those kind of details to get a clue?
Thanks
I have played a lot with TX power, lowering to 20, then to 17db. Nothing. I also tried to change the ACK timing to 0. Nothing. Everything done with static IPs.
The weird thing was that I have a second access point in my house and when I connect the device from there I have a solid green light. The problem was that the device i wanted to monitor was on my kitchen, far from that access point.
So, I just remembered that the ISP router also has the capability of creating a WIFI network, which is also in the kitchen with my main router. I created a different SSID on the kitchen router, and the HS110 connected without a problem with a solid green.
My main router is a Linksys EA8500 flashed with DD WRT. All the SSID I used were created as 20Mhz N-only WPA-Personal AES. My conclusion is that my main router has a feature or a specification that is not compatible with the HS110. I don’t know what feature is.
My access point that worked initially is a TP LINK and my ISP’s router is a Cisco.
I have the same experience. I also had a Linksys running DDWRT with TP Link drop outs but the TP Link device connected to my outside Netgear WiFi extender has never dropped out. I now have an Ubiquity set up inside the house but still run the WiFi ext. and have exactly the same issues as before