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.24k stars 30.59k forks source link

TP Link switches are unavailable #57297

Closed jfischerlaunch closed 3 years ago

jfischerlaunch commented 3 years ago

The problem

Since upgrading to Home Assistant 2021.10.0 today, most of my TP Link Kasa switches are unavailable now. I've done the basic troubleshooting of hitting the reset button the switch and restarting the TP Link integration, but hasn't worked this time. Most, but not all of my switches are unavailable.

My switches are all on the same network.

What other information can I provide? Thanks for looking into this.

I see this error in the log.

Logger: homeassistant.components.tplink.coordinator
Source: helpers/update_coordinator.py:219
Integration: TP-Link Kasa Smart (documentation, issues)
First occurred: 3:26:37 PM (66 occurrences)
Last logged: 10:34:38 PM

Error fetching 192.168.68.62 data: Unable to connect to the device: 192.168.68.62
Error fetching 192.168.68.65 data: Unable to connect to the device: 192.168.68.65
Error fetching 192.168.68.159 data: Unable to connect to the device: 192.168.68.159
Error fetching 192.168.68.157 data: Unable to connect to the device: 192.168.68.157
Error fetching 192.168.68.158 data: Unable to connect to the device: 192.168.68.158

What is version of Home Assistant Core has the issue?

core-2021.10.0

What was the last working version of Home Assistant Core?

the previous version 2021.9.7

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.tplink.coordinator
Source: helpers/update_coordinator.py:219
Integration: TP-Link Kasa Smart (documentation, issues)
First occurred: 3:26:37 PM (66 occurrences)
Last logged: 10:34:38 PM

Error fetching 192.168.68.62 data: Unable to connect to the device: 192.168.68.62
Error fetching 192.168.68.65 data: Unable to connect to the device: 192.168.68.65
Error fetching 192.168.68.159 data: Unable to connect to the device: 192.168.68.159
Error fetching 192.168.68.157 data: Unable to connect to the device: 192.168.68.157
Error fetching 192.168.68.158 data: Unable to connect to the device: 192.168.68.158


### Additional information

_No response_
shiang-luong commented 3 years ago

Did you see the breaking change in the release notes (https://www.home-assistant.io/blog/2021/10/06/release-202110/#breaking-changes)

jfischerlaunch commented 3 years ago

I did not see the breaking change yet, so thanks for showing me that. I set up the integration entirely from the UI though. I don't have anything in the configuration.yaml file related to the TP Link integration.

shiang-luong commented 3 years ago

I just updated mine and I only have switches and plugs and it seems to work

jfischerlaunch commented 3 years ago

As I looked at all my switches just now, about half of mine worked after the upgrade today. I know that inconsistency is tricky to debug. Is there anything additional that I could provide that would be helpful?

calisro commented 3 years ago

what models of switches/lights are they? The firmware version of them might help give clues as well. All of my lights, switches, plugs work correctly (so far) in 2021.10.1 (and even Kasa strip lights which weren't before).

I did have to remove the some of the entities from the prior integration and rename the new ones for the automations to pick them up though. Some were discovered with a different (appended "_2") entity ID.

https://www.home-assistant.io/blog/2021/10/06/release-202110/#release-2021101---october-7

probot-home-assistant[bot] commented 3 years ago

Hey there @rytilahti, @thegardenmonkey, 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! (message by CodeOwnersMention)


tplink documentation tplink source (message by IssueLinks)

jfischerlaunch commented 3 years ago

I think I found the issue. It appears that on this upgrade, the integration created a second entity, named on the area/room the switch is assigned to and disabled the first entity that was in use in my dashboard. I'm going to continue going through the rest of my switches, but the first three worked once I found the non disabled entity. So maybe this is not a bug, but not understanding a slight change in the integration.

jfischerlaunch commented 3 years ago

Yes, I found it. That was it. A new entity was created for the switch, based on the room for the name. My dashboards had the old entity name. I've now replaced the non working switches with the new entity created in my dashboards and everything works. Apologies for logging the bug and I guess I can close the issue as working. I'll disable the old entities so that the integration doesn't show them as error'd. Thanks for the comments and help and looking into this everyone. Love the great work you have done and are doing with Home Assistant!

rytilahti commented 3 years ago

Glad you got it working! This might be related to #57346 where dimmers are not migrated correctly.