Automations associated with a device are marked as unavailable if you replace that device if it is faulty/stolen etc…
For state automations you just name the new entity_id the same as the old and… you’re done.
For device automations you have to search out all the occurrences of the old device_id and replace them with the new one. You cant just edit the new device id to be the same as the old one.
For people only using the UI this is daunting task and they would probably end up re-writing all their ‘missing’ automations.
Also gains some additional importance with the addition of the energy dashboard. Replacing a plug leaves one with the choice of either keeping the old plug in tracking or just losing the consumption data.
energy dashboard is based on entities. You can swap them out pretty easily. Integrate the new device. Rename the old device entity_id’s to something else. Rename the new device entity_id to what the old entity_id’s were. Delete the old device. Restart. It’s not perfect but it’s something you can do right now while waiting for an easier method.
PROBLEM: Light bulbs burn out. Switches and sensors break. I buy a new cell phone every few years!
SOLUTION: I want a wizard to replace an existing sensor with another one. The wizard needs to update / edit the exiting automations. It should replace the old device references / usage inside automations with the new device.
E.G. I have a rule turning a light bulb on 1/2 hour before sun-set. The light bulb dies. I buy a replacement. I want a way to replace / swap / exchange at the device level. This should;
New wizard asks to backup the system.
New wizard shows you a list of all automations it will update. It asks — Should I continue replacing old device name with new device name? [Y/N]
Put the new device into the same room as the old device
Update all existing automations to use the new device
Remove the old device from automation.
Move the old device to “unassigned” room.
Bonus Points: HA asks the admin — Should Home Assistant delete device? [Y/N]
Bonus Points: Rename new device name to the old device name
Sounds as if you’re using device ids in automations - could I ask why? Genuine question - a lot of people do and I must be missing something because I just don’t see the advantage (except maybe for physical buttons).
Honestly been using HA for 3 weeks. Don’t know if there is any alternative… My guess is lack of knowledge. What is your suggestion for device ID alternatives?
You are right. I am using entity_id: sensor.airvisual_pro_619s_carbon_dioxide it was something like sensor.airvisual_pro_mainflo_carbon_dioxide. Again, I would like a global search and replace for the old / new device