-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use IP address to identify devices (prefer MAC as identity) #89
Comments
Nice thoughts on how tasmobackup works. It doesn't use IP address to identify devices, and if your dhcp server is changing the ip address of your devices, you should fix your dhcp server, as this should only happen if you dont have enough ip addresses for all your devices, and that is a different problem. We cannot use mqtt to identify devices, as that is not any more stable than ip address, and you might not even be using mqtt. I will need more details about how it is messing up for you, to be able to fix it, cause I am not sure based on this limited description I will be able to reproduce the problem. But again, if your DHCP changes your devices ip addresses over time, that is broken. |
Sorry if I came across blunt. I'm sure there are many design considerations I am not aware of. Also, I am generally very pleased with this addon and appreciate your contribution. In the readme, it says, "No duplicates (based on IP, and MAC)". I'm not sure exactly what that means, but because I ended up with duplicates where only the IP was different (MAC and Name were the same), I assumed it was using the IP, in some way, to identify devices. In my case, I replaced my wifi router, so that is why all my devices received different IP addresses. While many devices were correctly identified, a handful of duplicates were created. If only the MAC were used to identify devices, then duplicates should never occur, and backup files should be correctly associated with the device. The only scenario where this would not work ideally is when replacing a device with an alternate device, say because it failed. That is why the device Name (I am using MQTT topic to populate name) might be a preferred identifier. However, I would vote to use the MAC address alone. I can always manually apply the backup to the new hardware if replacing a failed device. |
Yes, it attempts to do it by mac if it can figure out the mac address, then it should go by ip. I'll have to review the code and see if there are cases it should work, but isn't. |
I have this complaint as well. I repurposed some previously installed switches. When I went to re-add them they got an old IP for a device that also went away. When I went to back it up it said it existed. When I removed the device with the IP - it then let me add it so it wasn't hung up on mac address but IP. Ip isn't a reliable form of identifying devices. |
I just redid my network, and my iot network has whole new ip subnet, I had no issues, everything was mapped by mac correctly, as IP is only used if there is no mac address recorded in the database for the device. I am not sure what else I can do to attempt to replicate this, but will see. If I go into my tasmobackup database (tasmobackupdb.sqlite3) it shows every single one of my devices has a mac address saved. |
I use DHCP with my Tasmota devices, so their IP addresses will change over time. It looks like TasmotaBackup uses the IP address to identify devices. This results in two issues:
I suggest that only the MAC address be used to identify devices so that there is never any confusion. Alternatively, either the device name or the MQTT topic could be used. The IP address should NEVER be used to determine identity.
The text was updated successfully, but these errors were encountered: