Known devices multiple entries of the same devices

For almost 3 weeks I had my presence detection working quite fine with traccar, google maps location and nmap.

I’m using secrets for the mac address and I renamed some of the entities (just for the nmap devices) and I didn’t have any problem until yesterday. Since yesterday every time I’m restarting home assistant the same entities are getting added in the known devices files again and again. Right now I have the same devices 4 times in my known devices file.

I guess that home assistant reads just the last entry of the same device, that breaks my presence detection for the devices that I have renamed.

Anyone that has any idea what is going wrong? I read in other threads that maybe I shouldn’t use secrets, but that was working fine for me before. And if that was the case, I guess that a device would be added just once after a restart not every time I’m restarting home assistant and not for all the device trackers that I’m using.