I’m almost sure I’ve just missed this in the documentation somewhere, but what I’d like to do is set up an alias for some device.trackers.
Why? We just went through a round of new phones for the family and I’ve been through a headache-inducing walk through my configuration to change the various references to each of the device trackers.
Last time that happened, I manually changed the device IDs so that device.tracker.sm986u was device.tracker.russ_phone and so on. In order to do the same thing this time, I’d have to delete the old device.tracker restart and then edit the new one to the old name and then restart again. (Or something like that.) Or, I have to find each instance of …russ_phone and change it to …sm986u. Neither is fun.
What I’d like to do is have one entry (in configuration.yaml?) that would equate device.tracker.sm986u to device.tracker.russ_phone and so on. Then, the next time someone gets a new phone, it’s just one change in one spot that’s easy to remember.
Is there a way to do this?
You’re basically describing a person.
- Go to Settings → People
- Make people entities for everyone
- Associate the device trackers with the right people
- Replace all references to device trackers with references to people and never directly reference the device trackers again
I mean unless you have to for #4. Device trackers do have some attributes that don’t make it to person
entities so sometimes you still have to directly reference them. But like 99% of the time you just reference people.
I knew there had to be a way to do that. I just didn’t think it was that easy.
I already have people defined with the appropriate trackers. It just didn’t occur to me to use the people instead of the trackers.
Thanks.
Sadly, there is a related, but entirely different entity created by the phone app for purposes of sending notifications to individual phone users. It’s of the form mobile_app_russ_phone.
As this is unrelated to the person, I can’t use that very elegant solution to make that work without editing.
I’ll have to see if there’s some sort of not-entirely-obfuscatory construction I can use to mean I don’t have to edit this final bit.
Extremely old thread, I know, but it’s the first search result for this question, so:
For notiification purposes, I have set up a Notify Group for each person. The group only contains one device, so it acts as an alias; and when someone gets a new phone (like my wife who is still on an “upgrade your phone automatically every 18 months, what do you mean ewaste” contract), I just need to replace the entity name in the notify group each time.