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.23k stars 30.58k forks source link

TP-Link Switch HS110 found with auto discovery and manually disabled is found over and over again #110460

Closed rolandsteinmeyer closed 8 months ago

rolandsteinmeyer commented 8 months ago

The problem

Since core-2024.2.X HA auto discovery finds a TP-Link Switch HS110 in my network which I have previously disabled. Disabling it again does not persist: It is shown as new discovered device shortly after.

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

core-2024.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

tp-link

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

bdraco commented 8 months ago

Its likely a bug in the mac address formatting and we have a unique id mismatch with mac address formatting

To fix this we need to write code to:

  1. migrate all existing unique ids using format_mac
  2. Use format_mac on the incoming data in config_entry.py for both discovery method. I thought we didn't need this but it turns out dhcp has to strip : for historical reasons.