I just got a new phone a Pixel 10. I have 48 instances of my existing Pixel 8 I found in automations.yaml. Can someone recommend the best way to handle the numerous text messages throughout your automation when getting a new phone? Maybe a template that I could just change the phone in that and not have to change it in every automation? Suggestions how to handle this would be greatly appreciated.
Name your phone in the companion app Bernie instead of pixel x.
So the next time you change phone you make that phone Bernie.
But now I would suggest a text editor and search and replace.
Or you rename your new phone to pixel 8
I use Ticker. It’s fantastic for situations like this.
I was not aware you could simply do a search and replace in the automations.yaml file. I just did that and it worked like a charm!
-Thank you
I would still recommend you changing the name to Bernie.
That will make it much simpler later
I’ve also found notification groups (even if it’s a group of one device) to be handy for this reason as well. Then you simply have one place to change things.
That’s the better solution IMO. Otherwise you can’t differentiate old phones and new phones which I find useful.
Thanks for the tip.
I was thinking of a group with my wife and son’s phones, but I have many notifications that I send only to my phone. And in some cases just my wife and myself.
I like that idea I’ll certainly keep it in mind.
Yep it’s a Pita the first time yoj realize this with HA. I do a version of H’s answer… I have a group for my phone(s). A group for family devices (general alerts very light) family devices verbose. (Same group more hits) and admin devices. When a phone changes I update the group. But when I update MY DEVICE I always change the name first the name I always use and ensure the entities match the old name. (because as you found ent_id is a key and can be search/replaced)
You can stop there and write your scripts to target those. I also wrote a notification router (postman tool in Fridays party) to let an LLM send the message to one of those above depending on current conditions. All this stuff relies on the names of the notify groups above being named something consistent and specific.
I will certainly keep the name change advice in mind! I took notes on this so I don’t forget the next time I get a new phone.
-Thanks
You can’t have two devices named the same, so you have to rename the old phone to Bernie_old.
And as Nathan say, it’s all the entity IDs, not just the notification.
If you use the wifi sensor or geolocation sensor. Whatever sensor you use, all of the automations must be renamed for your automations to work.
Then there is the scripts, and the templates, and perhaps Node red.
The lowest maintenance solution is to rename the phone to your first name.
Chances are pretty high that your name will outlive your phone.
Postponing it to the next phone will just make things worse, more automation/scripts etc. will be bound to your pixel 10 entity IDs.
Every problem in computing can be solved by another layer of indirection…
Unfortunately… Yes.
I didn’t experience any of the problems you mention with automations, entities, etc. What I did was install the pixel_10 phone as a new phone. Then in automations.yaml renamed all references from pixel_8 to pixel_10. Everything is working correctly with the new phone. I’ve tested ~ 10 automations.
Initially instead of just changing ALL instances of pixel_8 to pixel_10, I changed it for a couple of automations, confirmed they were working with the new phone, then changed them all. Of course I restarted HA afterwards.
Thanks for the notification group advice! I did what you suggested and created the notification groups shown below. Then created several scripts like the one below based on the notification groups. This should make changing cell phones much easier!
notify:
- platform: group
name: all_cell_phones
services:
- service: mobile_app_pixel_10_pro
- service: mobile_app_pixel_8
- service: mobile_app_iphone
- platform: group
name: bernie_and_karen_cell_phones
services:
- service: mobile_app_pixel_10_pro
- service: mobile_app_pixel_8
- platform: group
name: bernie_cell_phone
services:
- service: mobile_app_pixel_10_pro
- platform: group
name: karen_cell_phone
services:
- service: mobile_app_pixel_8
- platform: group
name: bernard_cell_phone
services:
- service: mobile_app_iphone
sequence:
- action: notify.bernie_and_karen_cell_phones
metadata: {}
data:
message: "{{ message }}"
data:
ttl: 0
priority: high
alias: "Notification: Text message to Bernie & Karen's Cell Phones"
description: ""
fields:
message:
selector:
text: null
required: true
Just FYI, notify groups are also services, so your person-based groups can be used in other notify groups…
notify:
- platform: group
name: bernie_cell_phone
services:
- service: mobile_app_pixel_10_pro
- platform: group
name: karen_cell_phone
services:
- service: mobile_app_pixel_8
- platform: group
name: bernard_cell_phone
services:
- service: mobile_app_iphone
- platform: group
name: all_cell_phones
services:
- service: bernie_cell_phone
- service: karen_cell_phone
- service: bernard_cell_phone
- platform: group
name: bernie_and_karen_cell_phones
services:
- service: bernie_cell_phone
- service: karen_cell_phone
Thanks, that’s even simpler!