hass-node-red icon indicating copy to clipboard operation
hass-node-red copied to clipboard

Node Red companion entities being duplicated on occasion after host reboot.

Open Shaolo opened this issue 9 months ago • 6 comments

Try

  1. unload the companion integration

  2. reboot HA

  3. remove all the entities that are associated with the exposed node

  4. reboot HA

  5. add back the integration

  6. check to see if a entity was created with the correct id minus the _2

  7. restart NR

  8. check if it created a new entity in HA or used the correct one

Originally posted by @zachowj in #126

This works to resolve the issue. But is there any way to prevent this from happening in the first place?

I'm on HA version: 2025.2.5 Companion version: 4.1.2 Node Red version: 19.0.2

Running HA inside a virtualbox VM hosted on a Windows 10 machine. This seems to happen when I reboot the VM. But it doesn't happen consistently. I always shut it down with an ACPI shutdown.

Shaolo avatar Feb 22 '25 08:02 Shaolo

I found I can reproduce this 100% of the time if I Rename the NR Companion Integration from "name" to something else. It has also happened/been triggered other ways, but this is the most reliable.

Restarting, then disabling, then restarting, then enabling, then restarting, seems to clear it (remove the _2 items) but it could be a fluke fix. I know the other issue/thread has more info on the fix.

amaisano avatar Mar 26 '25 04:03 amaisano

I see renamed if i just restart Node-RED Companion in Home assistant (config/integrations/integration/nodered) Can i fix it?

userosos avatar Apr 03 '25 05:04 userosos

Can Anybody fix it? I have Many devices and i need rename all them in HA everyday. It is crazy.

userosos avatar Apr 22 '25 08:04 userosos

Absolutely crazy bug this is... If you rename it in core.config_entries it doesn't make the duplicate entities. I'm guessing when you rename the config item it starts creating the new one with the new name before it has deleted the old one and its entities, resulting in duplicates.

daveyijzermans avatar Apr 22 '25 22:04 daveyijzermans

Absolutely crazy bug this is... If you rename it in core.config_entries it doesn't make the duplicate entities. I'm guessing when you rename the config item it starts creating the new one with the new name before it has deleted the old one and its entities, resulting in duplicates.

Can you create an manual how i need do it? I not understand where i can found core.config_entries.

userosos avatar Apr 25 '25 05:04 userosos

Is it possible to set the entity id number to be a portion of the hash of the entity id string?

csobrinho avatar May 31 '25 02:05 csobrinho

This bug is also triggered by renaming or deleting entities in NR. Another fix I've found is:

  1. Delete the old (original) entities using the recorder.purge_entities action in HA dev tools
  2. Restart HA
  3. Rename all NR entities to remove the _2

But it's a huge pain, especially if you have a lot. One of my setups has 68 NR entities 😩

thedanbob avatar Jul 16 '25 14:07 thedanbob

Nothing worked. I tried EVERYONE'S suggestions and there is no way to remove from the UI, and when I tried manually deleting the storage entity registry items they all came back again. I'm completely stuck please help!

ALL I DID WAS REMOVE A HA SENSOR FROM NODE RED!

amaisano avatar Aug 12 '25 23:08 amaisano

Same issue here... deleting the entities and adding NodeRed again still has _2 next to some of my entities...

1aranzant avatar Sep 28 '25 15:09 1aranzant

And here we are, Oct 2025 and this integration is still wobbly

Personally I've had it with the junk double entities it creates and never cleans up. The worst is that you can't even get rid of things manually and restart, reload does nothing.

Image

As a consequence I have begun migrating to MQTT based sensors, which I can still update from Node Red, and use HA helpers for everything else. It will be a nice day when I can nuke this integration for good 👎

MaxVonEvil avatar Oct 18 '25 05:10 MaxVonEvil