TP-Link Switches going "Unavailable"

Recently, I installed bluetooth and bluetooth_le for device tracking. My problems started there. I’ve just removed them and the issue has instantly gone away. Not sure why. Bluetooth tracking isn’t of huge interest, so happy to revert.

I always had random connection drops with my Kasa switches. However the amount and frequency of those drops were acceptable.
Just recently, I set up bluetooth presence detection via room assistant with the HA add on plus two Raspberry Pi Zero’s.
From that moment on, the Kasa switches went crazy. Switching room assistant off, think went back to normal.
So I can confirm, that bluetooth is a huge issue for the reliability of the Kasa switches. Of course, that’s not surprising since both use the 2.4GHz frequency. But I wasn’t expecting this much of an impact.

To double check this assumption see screenshot attached. Additionally to home assistant I track power consumption of all Kasa switches via Prometheus and Grafana. At 10:10 I switched off all room assistant instances. Immediately the drop outs stopped.

1 Like

Word from a noob. Same issue as everyone seems to have with these. Luckily I only have one plug -HS100 with 1.0.3 fimware - that disappears at random. It wont reappear in HA unless I restart HA, even though its in the Kasa App. Config wise HA is running on proxmox box with Gb ethernet to TP-Link C9 Wireless Router configured a a Repeater but only for 2.4GHz.(TP-Link acts as repeater (via gigabit) for BT Smart hub which does DHCP (all leases are reserved so effectively fixed IP), internet connection and provides 5GHz mesh. wont be buying anymore of these things.

I too am an HA noob.
HA Version: 0.114.3

I managed to get my 8 Kasa devices (Switches, Plugs(aka switches for HA purposes) and a KP400(strip) working with discovery: false and static IP addresses in the configuration.yaml file.

I moved my on/off times to automations.yaml (turned-off the schedules in the Kasa App).

Everything was fine. I took snapshots throughout the process. I was pleased with my progress…
…and then… I decided to change the address of my Raspberry Pi for Home Assistant to a static IP address. (No change for my TP-Link Kasa devices, they were already using fixed IP addresses. I made that change when I added them to the configuration.yaml file). “all” I did was assign the fixed IP address in my router (no changes to the HA configuration). Reboot HA … new fixed address assigned… badges, weather card, camera card, etc all work as before…

BUT all of my Kasa entities are GONE: (as shown on the lovelace dashboard)

missing kasa entity

The TP-Link Integration does not show any devices or entities.
kasa integration no entities no devices

I’ve deleted/reinstalled the TP-Link Integration (several times) reboots/shutowns/power-off/on etc.
No joy.
My next step is to re-install from scratch (having saved key config files for piecemeal restoration). Before taking the plunge, I thought I’d check to see if anyone else has had a similar problem.
(I believe this is a different kind of “Unavailable” problem. This “unavailable” problem is not intermittent, it’s “all or nothing”. It was working, now it’s not.).

Thanks!

Unfortunately I can’t help you with this, since I have never tried to change the host ip address.

Generally speaking I was struggling with Kasa Plugs for at least a year and then decided to replace 4 of my 15 plugs by Homematic HMIP-PSM switches. And so far absolutely no issues with these switches, even in monitoring them in Grafana. I will keep on replacing the rest soon. However you need an HMIP Stick but it doesn’t cost a fortune.

I hope that helps anyone who is looking for an alternative for Kasa and who is feed up like me with Kasa issues.

Best

1 Like

@pete123 I’m not ready to abandon Kasa just yet, but it’s good to know what alternatives have worked for others.

I’m zeroing in on the problem, but I can’t isolate the root cause.

I’ve rebuilt HA environment several times now. :wink:
I am now focused on only changing the configuration.yaml file.

When I add: (showing as image to highlight the “spacing”)
TP-Link Device Stanza

NONE of the devices/entities get created.

However, if I comment out all but the first 6 lines of the tplink stanza:
TP-Link Device Stanzacomment reduced
then my first device is added correctly. Likewise, when I UNcomment the next address on the list and reboot, it too works correctly. …and so on through address “108”.

Finally when I UNcomment the next strip: and - host: lines and reboot, my KP400 is NOT added AND all of the previous 8 switches have become UNavailable.

(update: I RE-commented the strip and host-109 lines, re-booted and now the previous 8 devices work as before, as hoped.)

So… it must be related to the strip: line… but I have no clue why it fails.

(update: I have deleted and re-typed (not cut/paste) these 2 lines just in case I had introduced a bad/non-displayed character into the mix. No improvement. Simply including the strip stanza “breaks” all of the other devices (makes them UNavailable). Removing the strip stanza returns the rest to working order.).

Any thoughts appreciated.

For what it’s worth, I’ve hard of issues with the KP400 in the past. I’m going to wager that’s your culprit. I have a KP200 (outlets) “strip” connected without any issue.

1 Like

For what it’s worth, I looked at the code on Github and didn’t find much code dealing with strips nor dimmers. Can someone try configuring a strip in the as a switch and report back? I think each plug should be an independent switch. So if the strip has four plugs the Home Assistant should have four devices. Don’t have any strips myself to test.

1 Like

I can validate with the KP200, HA does create two entities like the Kasa app.

And I just realized I do have a KP400 – just not using it. The KP400 is the outdoor duel plug strip. Maybe after we finish our patio out back, I’ll pug that sucker in for devices there.

1 Like

I commented out the strip: line, leaving the - host: line in. An unnamed device gets created as UNavailable:

no strip UNnamed device

The other odd part of this is that I really did have it working last week. Unfortunately, I can’t identify what I did differently.

For now I’ll leave the KP400 with the TP-Link app and forge ahead with the HS plugs and switches (aka switch: for home assistant) as I climb the HA learning curve.

Thanks.

Having the same issue with my HS110 Power Socket after a restart says unavailable do another restart and it normally appears. Seems to stay online until the next restart (due to various updates or Config change)

This ha been like this for a long time now.

Re Dave

1 Like

My HS100s, HS105s and HS200s all work so far. My KP400 does not (it works just fine from the Kasa App).

The weird thing is that adding the strip clause kills all of my working Kasa devices. Removing it, restores them.

apologies if I missed it and you’ve tried already but have you tried configuring the strip first in the yaml and the other stuff after?

Excellent question. I have tried strip: alone, before the switch: stanza and after the switch: stanza. All with the same effect. strip: kills all of my “switches”.

What happens if you put the ip of the strip in the switch section? And no strip section.
5310

When I put the strip ip address in the switch section I get an unavailable unnamed device as shown here.

just in case this helps someone, I used to have this issue with my HS110. It would intermittently go unavailable. Moreover, it would randomly stay unavailable for hours when I restarted HA, leading me to restart the system several times until it came back to available. This used to happen both with the stock Vodafone router and with an ASUS RT-AC86U I had. I recently purchase a Tenda Nova mesh system. One of the nodes is close to the switch and it’s been rock solid since, available 100% of the time.

I have the same issue, works ok with single switches but no luck with strips (K303), discovery will find them but they will often be unavailable. If I put them in the config file then the strip: section breaks everything. With strip: the singles work fine.

strip: now works for me after installing Release 0.115.3 · home-assistant/core
It did NOT work with 0.115.1 or prior versions. I did not test 0.115.2

The “uncommented” section here, now works for me as expected.