Multiple Home Assistant Server Entries

Some how over time I have multiple server entries for Home Assistant within Node Red. How do I know which one to select or better yet, how do I remove the duplicates/extras?

I have a node right now that is complaining about the wrong HA url being used and there are 7 options all saying home assistant in the drop down.

That happens when you import a flow you downloaded. Iā€™m not sure why you can have more than one with the same name or how to remove the server before you export or import it.

On the top right menu select the 3-bar icon and select Configuration Nodes. Youā€™ll see all the server names along with a count of the number of nodes that are using each one of them. To remove them, click on the ones with zero nodes and hit the delete key.

1 Like

Thank you! Did the trick.

hi, sorry to necro this but I have a related question.
I also have duplicated servers and always delete the ones having 0 nodes associated. but I also have a couple actually being in useā€¦
my question is: how safe/dumb is to change the servers on the ā€˜in useā€™ nodes for the main one?
image

As far as I can tell, you can have as many Home Assistant (websocket) servers as you like.

Node-RED is very good and shows the count of connected nodes using each server node, and clicking on the number brings up a list of every connected node, so relatively easy to pick them off one by one and move them to a different server.

As most imported code uses the same server name, telling them apart is difficult, so a good idea is to rename each server node you donā€™t want first, keeping the one you do as Home Assistant.

I have two active server configuration nodes as I have two machines running HA, so one server I have named as HA1 for the local connection, and the other HA2 as remotely connected. I can move any given HA node from one server to the other, and effectively this just makes the node work on the other HA instance. I would see no issues at all in moving nodes to different servers so as to reduce the count to zero before deleting. Another approach I have used is to set the spare server configuration node to ā€˜disabledā€™, which highlights the specific connected nodes as they then error and stop working, and then I can go through my flows looking for these nodes and changing the server.

As always - take a backup copy of your flows before doing anything major or anything that you are unsure of first!

Multiple configuration nodes on the same HA might be useful, using different settings, but naming them differently is clearly helpful. I have also modified the Status date format - Separator to be [1] and [2], which means I can clearly see which server any HA node is using just by looking at the status line.

To avoid getting into this situation in the first place, exported code should ideally be scrubbed to remove the Home Assistant server and name. There is a facility to do this at

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/scrubber/

Also, when importing other code, I try to inspect the node list (import will tell you what it is importing) and in the list I can unselect the Home Assistant server configuration node - this neatly prevents bringing in duplicate configuration nodes, forces all the associated HA nodes to flag an error (as they no longer have a sever node connected) and it is a simple case of opening to edit each node, which automatically selects the pre-existing Home Assistant server.

Hope this helps!

1 Like

Iā€™ve done this, but they just keep coming back. I think it happens every time I copy a Home Assistant node. For example I have a node that gets the state of an entity. If I copy that node to another flow, I sometimes get a new, but identical server node.

Conclusion: you could delete the server nodes with one or two connected nodes and when a Deploy complains, point the complaining node back to the desired server node.

Or not.

Itā€™s just a node. A pointer to the server. A few bytes at the most. My MQTT broker is on a separate computer (it predates my adoption of Home Assistant by a year). I often copy working nodes often then modify them for their new purpose. And I have a lot of ā€œduplicateā€ nodes:

As you can see, I choose to ignore the multiple nodes. The only time I would ever need to edit the server nodes is if I change the MQTT broker address. Which is why I am reluctant to ever give up my separate MQTT broker.