myTselection / telenet_telemeter

Telenet Telemeter Home Assistant custom component HACS for Belgian ISP and mobile phone network traffic.
MIT License
31 stars 7 forks source link

Allow this custom integration to be set up more than once #20

Closed fanaticDavid closed 1 year ago

fanaticDavid commented 1 year ago

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.

myTselection commented 1 year ago

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.

fanaticDavid commented 1 year ago

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 🙂

geertmeersman commented 1 year ago

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

geertmeersman commented 1 year ago

image

myTselection commented 1 year ago

ok, fine for me.

myTselection commented 1 year ago

Should be fixed since R0.9.3