Changing lights

I was wondering if there is any procedure for replacing a light and having it bind to the existing entity? I had a smart bulb die on me which I had to replace. The bulb had to be imported again, all my automations had to be updated, my homekit integration is still screwed up looking for the old bulb. I gave the new light the same name as before but obviously the entity in the db has changed.
Is there a way to replace a bulb and have it bind to the existing entity? I have both wifi Lifx and Zigbee Ikea bulbs for which I am using conbee

Thanks

Hi, I don’t use Lifx but for Zigbee devices I would do the following:

  1. Remove the device from the Integrations page (see below)
  2. Restart HA
  3. Pair the new device.
  4. Rename the entity of the new device to that of the old device (see below) so all your automations and Lovelace views/cards continue to work.

The problem is that each device has a unqiue IEEE address so unless you want to go editing the core registry (with all the risk that entails) then this is probably the safest route.

I’ve done this a few times. Though not for over a year so my memory is a bit rusty.

I think it went something like this:

  1. Delete the existing light/device form home assistant and the Lifx app.
  2. Set up the new light in the Lifx app with exactly the same name as the previous light
  3. Wait for home assistant to discover the light
  4. Add the light.
  5. There is no step 5 you are done.*

A few points:

  • If you have already set up the new light you can either turn it on and off slowly 5 times to reset it and try again, or…

  • If you get the name wrong in the Lifx app you can still edit the entity_id in home assistant (configuration / entities)

  • * This will only work if you don’t use device automations (which are the tool of the devil).

Device automations use a unique device identifier that you will have to search and replace (old with new) everywhere you have used the device in an automation. This is easy enough to do with a text editor (find/replace) but nowhere as easy as changing the entity id in one place.