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.21k stars 30.57k forks source link

TP-Link Kasa Integration not working. Device status shows "Failed setup, will retry". #109740

Closed aparker21 closed 8 months ago

aparker21 commented 8 months ago

The problem

All of my TP-Link/Kasa bulbs are intermittently reporting that they are unavailable. When I try to look into it further in the TP-link Integration they show as "Failed setup, will retry". I have forced the retry and they will eventually start showing as loaded. . . however, they are still unavailable in HA and intermittently become available for a little while and then unavailable again.

What version of Home Assistant Core has the issue?

2024.1.6

What was the last working version of Home Assistant Core?

2024.1.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TP-link

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 8 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)

sdb9696 commented 8 months ago

Can you paste some info from the logs? With debug logging for tplink in configuration.yaml enabled.

christophermichaelshaw commented 8 months ago

Not sure if this applies to this particular issue, but I've had similar trouble over the last 2-3 months that I've narrowed down to possible issues with firmware for UniFi UDM-Pro and/or U6-LR -- a quick reboot of the WAP seems to resolve the issue for the Kasa switches and bulbs in HA (2024.2b8 currently), even though they still appear to be working within the Kasa iOS app.

Unifi bit may be a red herring, but maybe check to see if your issue is resolved by rebooting your WAP? Just thought I'd add some additional info. Happy to provide logs next time I run into the issue if it would be helpful.

jbishop129 commented 8 months ago

Found this thread while searching for the same symptoms. For me, I did not have my TP-Link devices properly pinned to static IP’s in DHCP. Realized they all ended up on different addresses today. I had to remove each Device from the TP-Link HA integration, then re-add it by IP (now on static reservations ;) ) and now they’re all working normally. HTH.

rytilahti commented 8 months ago

If your devices are on the same network (broadcast domain) as homeassistant, the dhcp discovery should take care of automatically updating the IP addresses if they were to change. There may be some edge cases, like homeassistant being offline when a device changes its address, but those should correct themselves in time.

aparker21 commented 8 months ago

It turns out a reboot of the router is what was needed. All devices are showing online. Hopefully they stay as such. It has been intermittent that they have come and gone, but a router issue does seem more likely than the integration itself being that it has been so sporadic. Thank you @christophermichaelshaw for bringing that up! Im closing the issue and will reopen if it isn't fixed long term but it looks like my hardware is to blame on this one. Thank you all!

jbishop129 commented 8 months ago

Fair point, and applicable to much of HA and mDNS / Avahi based discovery. My devices all live on an isolated IoT network, and to be fair, my core router doesnt reliably re-broadcast mDNS, regardless of its’ documentation. An issue far outside of the scope of this issue, but none of us operate in a vacuum, and have our own network gremlins!

aparker21 commented 8 months ago

For sure! Im about to add some more by getting rid of my current router and going with pfSense and a switch and wifi access point so I can do more segmenting.