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

TP-Link KS240 multiple switches #121567

Closed gmayfield09 closed 3 months ago

gmayfield09 commented 3 months ago

The problem

I have two KS240s installed in my house. Both connect to the Kasa app. One of them was discovered and installed in my HA TP-Link integration. The other was not discovered. When I try to add it by IP address it tells me it has already been configured (I tried both device IPs and got the same message for both)

What version of Home Assistant Core has the issue?

2024.7.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TP-Link Smart Home

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tplink

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 3 months ago

Hey there @rytilahti, @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 3 months ago

Hi, could you upload some core logs with debug enabled for the integration please?

sdb9696 commented 3 months ago

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

gmayfield09 commented 3 months ago

2024-07-09 06:17:29.481 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:17:31.198 DEBUG (MainThread) [kasa.klaptransport] Created KLAP transport for 192.168.86.77 2024-07-09 06:17:31.198 DEBUG (MainThread) [kasa.discover] [DISCOVERY] 192.168.86.77 << {'result': {'device_id': 'db7ffbfa9332b7219e3d9b6b7b1c3d70', 'owner': 'D05157D61CF79DAB2535A12DFF2DD84F', 'device_type': 'SMART.KASASWITCH', 'device_model': 'KS240(US)', 'ip': '192.168.86.77', 'mac': '98-25-4A-32-2D-42', 'is_support_iot_cloud': True, 'obd_src': 'tplink', 'factory_default': False, 'mgt_encrypt_schm': {'is_support_https': False, 'encrypt_type': 'KLAP', 'http_port': 80, 'lv': 2}}, 'error_code': 0} 2024-07-09 06:17:31.199 DEBUG (MainThread) [kasa.device] Initializing 192.168.86.77 of type <class 'kasa.smart.smartdevice.SmartDevice'> 2024-07-09 06:18:02.863 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:18:13.211 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:18:33.334 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:19:13.524 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:19:57.432 DEBUG (MainThread) [kasa.klaptransport] Created KLAP transport for 192.168.86.77 2024-07-09 06:19:57.432 DEBUG (MainThread) [kasa.discover] [DISCOVERY] 192.168.86.77 << {'result': {'device_id': 'db7ffbfa9332b7219e3d9b6b7b1c3d70', 'owner': 'D05157D61CF79DAB2535A12DFF2DD84F', 'device_type': 'SMART.KASASWITCH', 'device_model': 'KS240(US)', 'ip': '192.168.86.77', 'mac': '98-25-4A-32-2D-42', 'is_support_iot_cloud': True, 'obd_src': 'tplink', 'factory_default': False, 'mgt_encrypt_schm': {'is_support_https': False, 'encrypt_type': 'KLAP', 'http_port': 80, 'lv': 2}}, 'error_code': 0} 2024-07-09 06:19:57.432 DEBUG (MainThread) [kasa.device] Initializing 192.168.86.77 of type <class 'kasa.smart.smartdevice.SmartDevice'> 2024-07-09 06:20:34.014 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:21:54.185 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:23:14.353 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:24:34.659 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:25:54.859 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:27:15.061 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:28:35.598 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:29:56.027 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:31:16.215 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999) 2024-07-09 06:32:29.700 DEBUG (MainThread) [kasa.klaptransport] Created KLAP transport for 192.168.86.77 2024-07-09 06:32:29.701 DEBUG (MainThread) [kasa.discover] [DISCOVERY] 192.168.86.77 << {'result': {'device_id': 'db7ffbfa9332b7219e3d9b6b7b1c3d70', 'owner': 'D05157D61CF79DAB2535A12DFF2DD84F', 'device_type': 'SMART.KASASWITCH', 'device_model': 'KS240(US)', 'ip': '192.168.86.77', 'mac': '98-25-4A-32-2D-42', 'is_support_iot_cloud': True, 'obd_src': 'tplink', 'factory_default': False, 'mgt_encrypt_schm': {'is_support_https': False, 'encrypt_type': 'KLAP', 'http_port': 80, 'lv': 2}}, 'error_code': 0} 2024-07-09 06:32:29.701 DEBUG (MainThread) [kasa.device] Initializing 192.168.86.77 of type <class 'kasa.smart.smartdevice.SmartDevice'> 2024-07-09 06:32:36.380 DEBUG (MainThread) [kasa.iotprotocol] Unable to query the device: 192.168.86.77, not retrying: Unable to connect to the device: 192.168.86.77:9999: [Errno 111] Connect call failed ('192.168.86.77', 9999)

sdb9696 commented 3 months ago

Do you do any mac address spoofing on your router or have you updated the mac addresses on any of your devices?

gmayfield09 commented 3 months ago

no, not that I'm aware of

sdb9696 commented 3 months ago

Did you enter login credentials for the devices?

gmayfield09 commented 3 months ago

Yes, for the devices discovered. For the .77 device in question I haven’t been able to because I just get the message that it’s already been configured.

sdb9696 commented 3 months ago

I think you might need to try deleting all the config entries and the integration, restarting HA and trying to add them again. It seems like you're in a corrupted state somehow. We can think of alternatives if you have a lot of automations setup but that could be more laborious.

gmayfield09 commented 3 months ago

I did a hard reset on the switch and discovery was able to find it.