I don’t know why, but the code above keeps adding all my already known devices to known_devices.yaml over and over again. Now I have multiple duplicates of all my devices in that file.
are the names different? If so i’d fill in the MAC address fields if they aren’t already and then the device_tracker will update based on that versus hostname, thats hwat i did to stop it at least.
Do you have multiple trackers? The track_new_devices field only works to suppress things if it’s in the first one (no idea why - but that’s the way it works).
There was a bug several versions that was causing this but as far as I know was fixed. Are you using an older version of Home Assistant? This bug may have resurfaced.
There is this issue that may or may not have been fixed. Seems like there was some work but the last entry looks like it was closed without being resolved.
I’m running 0.62 and it’s also happening to me. Very frustrating. I have two device trackers in my configuration.yaml. I originally watched the youtube video from Ben at https://www.youtube.com/watch?v=EsBtyF5tZQ4 where he showed how to customize the dashboard.
I deleted my known_devices.yaml and restarted my home assistant. First scan found all my devices using the netgear (router) platform. The devices for the phones were duplicated as they were also found with owntracks. However, I modified the name: and icon: fields for several devices leaving the found device, and MAC addresses alone. I restarted the home assistant. The devices where I changed only the name: and icon: fields were were duplicated! When I changed the id:, name:, and icon: fields as the video showed, I had tripled the number of devices for the same device. So I went back and deleted the know_devices.yaml file and started over. First restart:
and after second restart, I had both entries for the same device with the icons not showing up on the dashboard for the device I modified.
I left the the MAC address alone in all cases. I started again only changing the name: and icon: fields. That didn’t work, either. I tried turning off the netgear discovery platform and used nmap platform and tried again from scratch. That didn’t work. I would sure think the find would key on the device MAC address because that will not change (except I changed if for this post). Is this a bug?
i found that following the suggestion by @jasondreher earlier, stopping HA before editing the known_devices file seems to stop the duplicates from being created.
was having the same issue on 0.62.0 finally i deleted the known_devices and rebooted the machine let the discovery happen and filled in the MAC address. Whatever I did fixed this.