I’m working on a new integration so I make fixes or just change my mind about the best way to expose something fairly regularly. When I do that anyone running the integration sees the left over sensors etc. and has to manually delete them. In some cases the sensors collide on identity and HA automatically adds and _2 and in my experience of trying to clean that up by deleting the dead original and renaming the new sensor, it seems to persist knowledge and sometimes repetitively re-duplicates the sensor going forward. I’ve also had reports that renaming the device sometimes results in the entire device being duplicated but I haven’t been able to reproduce this myself yet.
I’m looking for a couple of pieces of advice:
- Is there a way / pattern to allow me to clean up dead/deprecated sensors?
- What might I be messing up that’s causing that duplicated device issue?
Code is at:
greghesp/ha-bambulab: A Home Assistant Integration for Bambu Lab Printers (github.com)