home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.54k stars 30.72k forks source link

TPlink Authentication - Intermittent reauth error #117093

Closed millenniumy2k closed 4 months ago

millenniumy2k commented 6 months ago

The problem

I have had many TAPO devices for a long time, and I have never had any problems, before I used the integration present in HACS. Since I have been using native integration, every 3 or 4 days some devices lose connection and ask for authentication, with the error below (from TAPO app, they all work)

image

What version of Home Assistant Core has the issue?

core-2024.5.2

What was the last working version of Home Assistant Core?

core-2024.5.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TAPO

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 6 months ago

tplink_tapo documentation tplink_tapo source

home-assistant[bot] commented 6 months ago

Hey there @rytilahti, @thegardenmonkey, @bdraco, @sdb9696, mind taking a look at this issue as it has been labeled with an integration (tplink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tplink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tplink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tplink documentation tplink source (message by IssueLinks)

jaymunro commented 6 months ago

Possible duplication of #116089

millenniumy2k commented 6 months ago

I don't have TP-Link HACS installed, I removed it after the official integration came out.

sdb9696 commented 6 months ago

@home-assistant rename TPlink Authentication - Intermittent reauth error

sdb9696 commented 6 months ago

Hi @millenniumy2k, could you please upload some logs and diagnostics information? After you receive the SESSION_TIMEOUT_ERROR how do you get the devices working again?

millenniumy2k commented 6 months ago

After the error appears, the only way is to unplug the TAPO device from the power (but as I said in the TAPO app everything works), restart HA, authenticate, and then it works (for a few days, then other devices, random, they require it)

sdb9696 commented 6 months ago

So we definitely need to see some logs. You'll need to enable debug logging for kasa and homeassistant.components.tplink in your configuration.yaml.

sdb9696 commented 6 months ago

@home-assistant add-label needs-more-information

tyson-112 commented 5 months ago

Ich hoffe, da kommt bald ein Update für TP-Link Smart Home. Das ganze nervt nämlich ziemlich….

I hope there will be an update for TP-Link Smart Home soon. The whole thing is pretty annoying....

andrewginns commented 5 months ago

I am seeing the same error, here is a Home Assistant Core log after I enabled debug logging in the TP-Link integration and tried to reload and re-authenticate.

home-assistant_2024-05-22T10-01-14.555Z.log

192.168.3.22 is the static IP of the P100 plug I am using.

Unplugging the P100 and then plugging it back in fixes the issue. Reloading the integration and then re-authenticating works without issue. Here are the logs from that. home-assistant_2024-05-22T10-16-17.616Z.log

BillCrick commented 5 months ago

I also am getting the same Authentication error. I have my router set to restart every day at 5:15am. When it comes back on-line, the TP-Link Authentification fails and needs me to reenter my account and passord details.

rytilahti commented 5 months ago

This is potentially something that has already been fixed upstream, so I'll mark this as waiting-for-upstream. We are currently in the process of doing a major rewrite of the library and the integration, so the first updates on this issue will likely happen when that's done. If you want to get notified about the progress, feel free to follow the issues linked at the top of https://github.com/home-assistant/core/pull/111151.

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

rytilahti commented 4 months ago

This is still valid as I'm seeing it constantly during development. Unsure about the exact cause, but the integration should try to reauth using the existing encryption parameters w/o user input.

brettkp commented 4 months ago

I'm having the same issue. I find I have to reauthenticate almost daily. I've done all the updates, but the issue remains. It's been happening for a few months now. Before that it was fine.

hastingdevil81 commented 4 months ago

having the same exact problem with random TP Devices in HA. i de-installed the HACS integration and HA is up to date. still getting this relogin bug. Please fix, its getting annoying af

bdraco commented 4 months ago

Might be fixed in today's beta

https://www.home-assistant.io/faq/release/

MrEbbinghaus commented 4 months ago

@bdraco Hey, looks like the issue is not entirely resolved.

I added a brand new P110M yesterday (with HA 2024.7 stable installed). The plug did an automatic update overnight and this morning the integration prompted me to reconfigure the integration. In the flow it asked for credentials, although I didn't need them to add the device in the first place, nor did I ever add this plug to any tp-link account.

I was able to delete the device and re-add it, without credentials.

sdb9696 commented 4 months ago

@bdraco Hey, looks like the issue is not entirely resolved.

There are various reasons for the intermittent errors above, which should have now been resolved. The issue you describe is quite specific to the blank credentials provisioning and will probably be quite rare (i.e. when the firmware updates to a new authentication protocol, maybe every couple of years). If you want to pursue this specific problem could you please open a fresh issue with these details and some diagnostics information uploaded so we can discuss there.