myTselection/telenet_telemeter

Allow this custom integration to be set up more than once

Closed this issue · 6 comments

This is a request for an enhancement that probably won't be very high on the priority list, but I figured I'd ask/suggest anyway. I tried to set up this custom integration twice: once for my own account and once for my parents'. It let me do it but only the first time actually worked and created sensors. The HA logs show the following:

2023-03-20 16:39:29.403 ERROR (MainThread) [homeassistant.components.sensor] Platform telenet_telemeter does not generate unique IDs. ID Telenet Telemeter already exists - ignoring sensor.telenet_telemeter
2023-03-20 16:39:29.404 ERROR (MainThread) [homeassistant.components.sensor] Platform telenet_telemeter does not generate unique IDs. ID Telenet Telemeter peak already exists - ignoring sensor.telenet_telemeter_peak

The use case is that I have a NAS at home, and I'm planning to put a second one at my parents' place for off-site backups soon. They have a capped plan so I'd like to keep track of their internet usage to make sure I don't cause their connection to get squeezed.

I see, valid use case.
Easy solution would have an impact on all users, as it would rename all existing sensors to make them unique. I'll see if I can find a solution to only make new sensors unique for second and later occurrences, eg by adding username in all new sensors.
But may take still some time as I'm currently putting focus on compatibility with new telenet backend.

Of course, I completely understand. The new Telenet backend should be the focus right now as that affects all users.
Thank you for considering my use case 🙂

Best thing would be to add the identifier to the sensor name, just a breaking change but the existing users will quickly notice and it's not a hard job to change it :-)

ok, fine for me.

Should be fixed since R0.9.3