Blue 2-1 & z2m - we should remove entitiy's attributes that show every other entitiy's state in each sensor

I have 30+ Blues setup on zigbee2mqtt, and have them all in Home Assistant via the MQTT integration. While I have disabled most of the entities (as I stated here), each of the remaining entities still contains the state of all the other entities in it’s Attributes.

This creates the following problems:

  1. Every time one of those entities changes state, an MQTT update for every entity goes out, as they are attributes of all other entities.
  2. Since Home Assistant stores the state and attributes of all of it’s entities in its Recorder database (default is SQLite, but many use MariaDB), we are growing the size of that database exponentially instead of linearly with each switch and it’s entity’s updates.

I think we need to make a change to how the Blue 2-1 switch is handled in zigbee2mqtt by removing these attributes and just leaving the standard attributes in there.

I’ve attached an image that just shows a full entity and part of another one from the same switch, which shows the crazy duplication of data in its current implementation.

I think @nathanfiscus may be interested in this as well

1 Like

I personally run ZHA. Sounds like you need to change your HA Integration configuration. Make sure legacy_entity_attributes is turned off.

1 Like

that was a great suggestion! I had it enabled due to an old blueprint from the Aqara Cube. It did help get rid of many, but there are still a lot of duplicates that exist in every entity.

Not a Z2M expert, but those look like they are parameters that had values prior to you turning off the legacy attributes. There isn’t any rhyme or reason to the ones that are still in there. You could confirm by changing one of the parameters that show up in the attributes of the entities and see if they all receive the update or just try deleting and pairing the device again.

Interesting, it does seem to be stale data. I wonder if there is a way to clear that without deleting and repairing the device (will be a pain for 30+ of them.

Looks like a simple restart of the home-assistant docker container fixed it up!

1 Like

Can you make sure to mark as resolved for future users?

2 Likes

For sure!