[SOLVED] Kasa wifi switches not connecting after upgrading Unifi network (VLAN)

SOLVED: I HAD TO MANUALLY RE-ADD EACH STATIC IP IN THE TP-LINK SMART HOME APP. SOMEHOW, THIS FIXED THE CONNECTION AND ALLOWED HA TO SUCCESSFULLY SEE THE DEVICE!

Over the weekend, I upgraded my Unifi network (swapped from a USG Pro-4 to a Dream Machine Pro). The new Unifi network was directly imported from the old network configuration (so, theoretically, all of the networks and configuration were exactly the same - just a new piece of hardware acting as the “router”). For reference, I keep all of my IoT devices on a separate VLAN. I have ~50 Kasa switches configured for use in Home Assistant - they are no longer working in Home Assistant.

My Kasa switches have static IPs (assigned by me in the Unifi controller). 192.168.20.xxx
My configurations.yaml file lists all of the

In the Kasa integration, all of the Kasa devices state “Failed setup, will retry” with the following error message:

You can see from the error message that HA is looking for a very different IP (192.168.1.xx). My normal gateway is 192.168.1.xxx. All of the Kasa switches are supposed to be managed on the 192.168.20.xxx VLAN.

I also find error messages like this in the log:

I don’t understand why HA is looking for 192.168.1.xxx IPs for these devices when they are hard-coded to 192.168.20.xxx and have worked previously. HA should not be looking for 192.168.1.xxx static IPs for these Kasa devices…

I tried restarting / resetting / re-adding a Kasa switch, but nothing shows up.

Sorry for the technical details - hoping somebody has run into this issue before or knows how I can fix it. I’m certain that this is related to the network controller change - but hoping that I can fix this in HA since it worked before.

Notes:
My Kasa IOS app can control the switches just fine - so I know that the network sees the switches and they can be controlled. They just aren’t accessible in Home Assistant.

Sounds like you are doing DHCP reservations for “statically” IP’ing the KASA devices. I have a ton, too, so I get it.

I assume Kasa subnet matches HA subnet so you are not crossing that Layer-3 barrier.

Have you tried restarting the Integration or even the entire HA box to force it to rediscover?

I’m not really sure what you mean by “Kasa subnet matches the HA subnet”. Only the Kasa devices are on the 192.168.20.xxx subnet (VLAN 2). My HA is my main subnet 192.168.1.xxx - but always was before this.

SOLVED:

Maybe my HA is out-of-date. Either way - your clue pointed me in the right direction and I was able to solve the problem. HA was definitely looking for the wrong configured IP (192.168.1.xxx when it should have been looking for the device on 192.168.20.xxx).

I solved the problem by clicking “ADD ENTRY” and pasting in the 192.168.20.xxx IP for each device.

HA would tell me that the “Device is already configured” and it would then successfully wake up and find the right connection.

Not sure how this worked behind the scenes, but I’m grateful that all of my switches are back and operational.