Im starting a new home assistant installation because my old installation is becomming too unorganized.
But I dont want to do everything from scratch so of couse I want to copy elements from my old installation to the new one.
THE PROBLEM:
If i copy an automation from my old install to the new one it does not work. If I make an automation in the new installation i get a different device_id for my switch (switch.k_ikea)
How to get around this problem with unique device_id’s in different installations of home assistant.
If I can get a list of device_id’s from the old and the new installation I can write som code to change it around (but there must be an easyer solution outthere)
note: I know i dont need the device_id if i use old fashioned yaml for my automations. But apprently this is not the case for using the UI (or maybe im doing something wrong)
Actually very simple, you can always rename your device after the auto generate kick in. This way you dont need to replace all the changes on you code.
Im not sure i follow you. Im looking for the device_id not the name. The name is the same in both the old and the new installation (it is given by a third party integration)
I cannot find anywhere where I cange change the device_id.
If I could change the device_id for a device It would still be a tedious affire - since i have 70+ devices
br
Agree with tedious process, however in my experiences most of the time HA will generate the same name. Unless you are customize everything. Anyway there are no easy way.
When creating an automation using the Automation Editor, opt for Service Call instead of Device Action. A service call is more portable because it only references the entity’s entity_id and not device_id.
When creating an automation using a text editor, it’s more natural to use Service Call because it’s shorter and doesn’t require you to find the value of the entity’s device_id.
I tried it out and it looks like it is the way to go - even though there will be a lot of ‘redoing of automations in UI’ down the road . But if that is the case I will be better prepared for my next migration (which will come)
In this example I use a sensor to turn on a heating switch. Do u have a similar suggestion for this case? As u can see it works fine for the action part. I just need to figure it out for the trigger.
BTW, you should know that when you assign the Solution tag to a post (only one post in the entire topic can be marked with the tag), it’s typically the post that answers the original question and/or provides a means of solving the problem. The Solution tag’s purpose is to guide other users directly to the helpful post.
In this case, you marked your own post with the Solution tag but it doesn’t contain any information to help solve the problem.