I know. That’s why I used the wink emoticon. My bad. I’ve been on the internet for 30 years and still haven’t learned that irony usually falls dead in text-based interactions.
But maybe we should stop going so far off topic before a moderator steps in and gets mad at us
![]()
I think working around a dead device by adding a new one with the entities named the same is possible through some sort of careful exercise (it even can continue picking up the old one’s long-term stats if you don’t delete them). You just have to make sure that the entities corresponding to the future name are deleted.
But today I have just run into a conundrum I don’t I can solve. Old radiator valve died, new one doesn’t fit. So I have to move one functioning device to replace the dead one and introduce the new one in place of the old one. For this I think keeping the correct long-term statistics is just not possible currently.
Even something where you could run a bulk find and replace tool which would find all instances of sting a and replace it with string b.
Options for whole word searches, or being able to review the change before it’s made would be really helpful too.
Yeah I keep thinking of my poor wife who would just junk HA if I wasn’t there to maintain it. Easy for us but Greek to others. It should be easy to replace a device to a non-techie.
For example I have a mobile device, with automations and triggers setup, utility meters for data use, device tracking.
If I reinstall the companion app, or reset the phone, let alone get a new one, I have to set everything up again from scratch.
this means going through a list of hundreds of sensors and diagnostics to see which entities I want to enable or disable, recreating each of those utility meters which take dozens of clicks and a minute each. Have to find the old ones because they will be orphaned but it won’t show up in any errors.
Same thing if I have a Power Point with stats, I will have utility meters set for all of them and if it breaks and I get a new one I have to set everything up again from scratch
I think there should be an easier way to replace a device.
Not if you name the new phone the same as the old phone. Then it is just a matter of deleting the old phone before adding the new one.
Nope, I did that yesterday and all the utility meters were orphaned
and that really doesn’t help me select which of the ~100 sensors and diagnostics I want enabled or disabled.
BTW, where is the root place to rename a phone? I can only see places where I can add a custom name to cover the name. I had to delete the new phone an added again w/ the name to get it set properly.
and i’ve got another phone and watch to replace
On your phone.
We should be able to replace a device by another one with similar entities, in case of failure, upgrade or non-static IDs when batteries fail (rfxcom sensors for example) and still retain most history and automations.
I know some integrations can do it, like rfxcom, but it seems like a ugly hack (HA logs are often complaining) and is quite limited (same model).
There should be a migration helper, listing all entities from the old device, all entities from the new device, and a way to map or ignore them, and retain history.
Listing linked automation and incompatibilities, with migration, would be nice too.
The current way to easily replace devices is to not use device triggers/conditions/actions in automations and scripts but use entities only. Then, when replacing it, you only need to rename the entity_id to what the old one had, and you are done. You will retain automations and history.
This is the workaround that advanced users know. To regular users, device triggers are the recommended way (A great place to start!). Also, this WTH is clearly wider than that, since the workaround you mention does not work if you replace a device by a similar one from a different manufacturer, that may have a different name for its sensor values etc
I agree a device migration wizard would be a great tool to include in HA
I agree. I want to be able to migrate from any vendor to any vendor, not just replace a phone.
I agree it is a workaround. And even as an advanced user I am all for making things easier for starting users, moving towards the UI etc. I too started with device actions, but unfortunately I learned to regret it. These regrets were not just about renaming/replacing ( although a big part of it). So if I would think those regrets would go away when renaming is fixed, I would cheer along with you.
But this is not the case. The way devices are now, more would need to change to bring the benefits that were hoped for when they were introduced. So I disagree with the “great place to start” and would keep advising to stay away from device actions if this is implemented until device based automation are rethought.
Maybe related, but what I would love to see is HA do the grunt work of replacing the old entity names with the new one across automations, scripts, groups, templates etc when you manually rename an entity. Basically, instead of seeing the message that everything will break when you rename, why don’t we use software to do the manual work for us. Science!
I’m with you. My wife told me yesterday that when I die she’s calling an electrician to replace all of the light switches.
WTH why cant we simply replace one entity with another (everywhere)
If I have a new device to replace an old, I will want it to be replaced in automations, scripts, dashboards etc.
you can just name it the old entity name.
That gets very confusing if your old entity name was related to the name of the device and you replace it with a similar device from another brand.
I’d love to avoid device ids. But why then uses the UI them? When turning a UI created script/automation into a manual one I always are annoyed with unreadable ids instead of my nicely crafted entitiy ids.
This should be a WTH by itself. ![]()