Kasa TPlink integration wont authenticate

My Kasa tplink integration keeps saying authentication has expired. When I try to put in my credentials I get the following message

“ Unable to authenticate: Device response did not match our challenge on ip 192.168.20.179, check that your e-mail and password (both case-sensitive) are correct.”

I can use those exact credentials to logout and log back into the iOS Kasa app as well as to login into the Kasa cloud service. For some reason they will not work in home assistant. I have tried playing with different case in the username with no success.

Any assistance in solving this issue would be greatly appreciated

Thank you

Hi, welcome to the forum!

Have you seen this: TP-Link Smart Home - Home Assistant
I’ve seen quite some topics on this in the past but don’t have any info at hand to help you.
Check Search results for 'kasa tp' - Home Assistant Community

Thank you for your reply.

Yes I have taken a look at that link and looked for other forums detailing the same problem I am having but have not had any luck find a solution.

Thank you for the information

I think at this point I might have to delete all 37 of my kasa light switches in home assistant to fully delete the integration ?? And then reinstall?

Anyone have an update on this? I am having the same issue. Both issues are motion switches. I have probably 15 other Kasa devices that don’t seem to have this issue and working fine.

Just started having the same issue. I haven’t seen any resolution besides delete all devices, delete the integration, and start over.

I had this issue after two plug strips updated their firmware. I haven’t tried yet but I might factory reset them. I didn’t want to do this because I have the plugs integrated into routines already. These routines are failing now but if I factory reset, I’ll have to readd everything.

Here’s what worked for me from the tapo app:

Using Kasa app here. Are we supposed to migrate to Tapo?

This seemed to work for me:

  1. Install Tapo app (I have no Tapo devices) but the app now supports Kasa devices
  2. Login with TP-Link creds
  3. When asked to link Tapo with Kasa, agree
  4. In the “Me” section, go to “Third-Party Services” and toggle off/on “Third Party Compatibility” like in Jacof881 noted above.
  5. Re-authenticate to Kasa in Home Assistant.

Note that Tapo doesn’t recognize the home or room organization from Kasa (at least it did not for me), so you may need to reorganize your devices. (It’s not necessary if you will keep using Kasa app instead of Tapo).

Managed to get it working for me.

I had multiple Kasa devices working already so I went to the integration and “re-configured” one of my devices.

It asked for the IP address and I changed it to the device that wasn’t connecting. I submitted the changes successfully without affecting the original configuration for the working device.

I then went to add the device manually via the IP and this time it auto authenticated and has been working ever since.

FYI, in my experience the tplink integration does not handle device ip changes very well.

I have made sure that all my hs300 devices (the only tplink devices I have) all have static dhcp reservations and that has helped stabilize them for me.

Also, some of you may be interested in @ GitHub - python-kasa/python-kasa: 🏠🤖 Python API for TP-Link smarthome products for better local control/commisioning.

My hs300’s have never been authenticated with kasa/TPL, nor do I have an account or app.

We really need a solution to this problem. Because my automatic switches have STOPPED WORKING, I have gone back to the manual timer for my Christmas lights.

I have even tried the trick suggested above about assigning the device to a static IP address. I did this, power-cycled the device, it acquired the static IP address, but Home Assistant still WILL NOT COMMUNICATE WITH THE DEVICE. I’m looking at OpenHAB.

If you’re a bit tech savvy on the programming side of things, I highly recommend @Saoshen suggestion on using python-kasa to commission your devices. That’s what I did, too. Worth it to have full local control, not dependent on TP-link’s cloud. Granted, I did this nearly 3 years ago. Idk if any changes to the integration now “require” authentication using Kasa credentials nowadays. When I did it, the devices popped-up on their own in the Devices & services page of HA and allowed me to add them.

I program in python at work and at home.

Ubuntu uses a configured python environment, so I created a virtual environment. I activated that virtual environment then
pip install python-kasa
Ubuntu still will not let me install it, so the python kasa is NOT an option.

I have even reset the Kasa device (an EP40) and tried to re-add it to Home Assistant. It doesn’t work.

Has TP-Link disabled third-party control? Is that why it is no longer working.

Okay, after resetting the device I could not add in Home Assistant. After a few hours, it was addable. Now it is working, sort of.

That is, sometimes it will reply to Home Assistant control, but more than half of the time it does not.

That is at least better than before.

Just got past the problem using BigBHaller’s suggestion, except I did not install Tapo, I used the Kasa app, turning off third party compatibility and then turning it back on my next attempt through Home Assistant a few seconds later was successful.

Simply toggling third party support off for a minute or two and then back on within the Kasa app then reauthenticating in Home Assistant has consistently fixed this for me, for a short period of time, then it expires again.

For any Home Assistant core devs that come across this, I would suggest that maybe this isn’t a ‘Platinum’ integration while this most basic function doesn’t work on these devices. Sure, it is just the power strips that are affected as far as I know. But I would expect Platinum to work pretty universally and in this case, it certainly doesn’t. Even the most basic functionality is broken without fiddling around in the Kasa app every time the auth expires.
Perhaps it isn’t ‘Platinum’ until this is fixed?