TP-Link Switches going "Unavailable"

@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.

I’m running into a similar problem as you @YetAnotherDave and did exactly as you did with the switches, one by one until they all recognized and even got the problem with “strip” suddenly turning all of my existing devices to some kind of error, almost like unavailable, but more a communication error. I kept the “discovery: false” piece commented out still as that seemed to make it work better.

How did you get “strip” to recognize? Assuming you did nothing special based on your previous post. I’m trying to add a KP400 strip.

@kwong26 I did not do anything special.

After I upgraded to 0.115.1, I un-commented the strip & host lines shown above. This made ALL of my switchesonce again go UNavailable. I re-commented them, then ALL of my switches returned to AVAILABLE.

After I upgraded to 0.115.3, I un-commented the strip & host lines shown above. ALL of my switches remained AVAILABLE and my KP400 with 2 outlets also showed as AVAILABLE. It now all works as expected.

From my point of view 0.115.3 fixed the issue. I have no idea what explicitly fixed the issue. I am NOT rushing to install 0.115.4. I will stay at current levels until a compelling event occurs.

Core: 0.115.3
hassio: 4.13
Supervisor: 245

Thanks @YetAnotherDave. After you confirmed it all seemed to work for you, I tried again and it worked. I made the mistake of putting the wrong IP address for my KP400, but after correcting it all works beautifully now.

Now that it’s working, I’m with you on not rushing to change anything else. :smiley:

I’m having similar issues. All my TP-Link devices became unavailable yesterday. I was on 0.115.5. I tried upgrading to 0.115.6 and they are all still available. Multiple restarts of HA have not helped.

@pmd5700 You have reinforced my resolve to stay at 0.115.3.
In fact I am going to shutdown HA and make an SDcard image back-up right now… :grinning:

[edit] After successfully installing @MarkHofmann11 's github tplink custom_components I then upgraded to 0.116.2 successfully. All tplnk devices have remained available.

2 Likes