Abstract Mobile

I use mobile notification through Node Red and some automation, and I just changed my phone and realized I have to change all the notifications.
Can I abstract the name of the entity?
Like I name haz_mobile: current entity name for my phone.
Then use haz_mobile for all automations.

So when I change my phone, I just change the name in one spot, and all my automations work.

Hello Haze,

You can set a ā€˜globalā€™ variable as text that you can template into your stuff. You can use a helper for that
Open your Home Assistant instance and show your helper entities.
Or this: Trigger based template sensor to store global variables.
There is also some magic I think if you name the new entity_id exactly the same as the old entity_id that the new one might just work. I havenā€™t tried that, but heard about it.

why not set the name of your mobile app client itself? such that it doesnā€™t get a new name each timeā€¦ thatā€™s part of the purpose of entity id friendly namesā€¦

just like if you light.kitchen phyical light breaks and you replace it with a new one, you wouldnā€™t go and change all your automation to light.kitchen_newā€¦ youā€™d name the new one light.kitchen

1 Like

Thatā€™s what I did, butā€¦

I installed the new app
I changed the friendly name to Haz Mobile
I see the device listed is indeed haz_mobile, with all of its entities

I am not able to get it in the drop-down of the Node Red ā€œEdit Call Service Nodeā€.
I restarted Node Red, restarted Home Assistant, still, donā€™t get it. I get the first device name which was set when I first installed the companion on the new phone.

So everything works on the HA side, but not Node Red yet. Am I missing a step to refresh the Node Red device list?

Not the friendly_name, the entity_idā€¦

1 Like

yeah, what @Sir_Goodenough saidā€¦ :slight_smile:

2 Likes

ok, changed the name. All device and entities have haz_mobile_ā€¦so all works on the HA side.

Restarted HA, Node Red still pulling the old name. No haz_mobile in the drop down of the notification.

Is there something I need to do to get it to refresh on the node red side? I restarted node red also.

iā€™m switching the category to node-red so that node-red gurus might see this and help out. i donā€™t use node-red so i donā€™t knowā€¦

1 Like

First deploy any ha node, then check the auto complete again. No? Go into any HA node the server dropdown, there is only one server? Yes, click the edit button next to the server and uncheck the cache autocomplete. deploy and then restart nodered.

1 Like

This is it. worked for me.
For some reason I could not mark it as solution for the thread.

1 Like

Nodered is the red headed step child of the forum and as such we are not allowed to mark threads solved.