Zigbee2MQTT Update Doubled Entities, Lost History - Need Help!

Hi everyone,

I recently updated my Zigbee2MQTT installation, and I’m now facing a very frustrating issue: all of my Zigbee devices have had their entities duplicated in Home Assistant. The old entities are now “Unavailable,” and new entities have appeared with slightly different names (often with a number appended). Worse, I’ve lost the historical data associated with the old entities.

This is a major problem, especially as it affects my underfloor heating automation, which is now essentially broken.

Here’s a summary of what happened:

  1. I updated Zigbee2MQTT to the latest version 2.1.3
  2. After the update, I noticed that all of my Zigbee devices had duplicate entities in Home Assistant.
  3. The original entities are all “Unavailable”.
  4. The new entities are reporting correct values, but they have no history.

What I’ve tried (and why it didn’t fully work):

I initially tried renaming the new entities to match the old entity_ids. However, I encountered the “entity ID already exists” error, as the old (unavailable) entities still existed. I considered a suggestion to use customize.yaml to temporarily rename the entities, but I’m hesitant to make complex changes to my configuration while my heating system is affected. I’m also concerned about further data loss. I need a reliable, and ideally, simple solution. I’m now leaning towards a complete reinstall, but I want to understand why this happened and if there’s a less drastic solution.

My questions:

  • Has anyone else experienced this issue after a Zigbee2MQTT update?
  • What is the root cause of this entity duplication? Is it a bug in Zigbee2MQTT, a problem with Home Assistant’s discovery, or something else?
  • Is there a reliable way to restore the original entity_ids to the functioning entities without risking further data loss or instability? I’m very hesitant to edit internal Home Assistant files directly.
  • If a reinstall is the best option, what is the recommended procedure to minimize disruption and ensure I don’t encounter this problem again in the future?
  • Is there any way to restore the lost history, even partially?

I’ve attached a screenshot showing some of the duplicated entities. You can see the “Unavailable” entities alongside the new ones.

Any help or guidance would be greatly appreciated! I’m particularly concerned about getting my heating automation back online reliably.

Thanks in advance!

The history will be restored once you have the devices back to their original names. How you get there is up to you :slight_smile: not sure how many devices you have, but you could rename device to device_tmp and device_2 to device afterwards.

Have you restarted HA already?

This was the first thing I have tried. Renamed original to other name and the duplicates to original (even if I loose history) but it is not working. “there is already entity with this name” something like that error even if I renamed the original

Of course. Several times.

and there is no duplicate devices, there are duplicate entities

Delete the unavailable entity, and rename entity_2 back to entity