Only publish selected attributes in Zigbee2MQTT

My database is exploding due to a massive amount of useless attributes which comes with my device. The Z2M manual describes the option filtered_attributes to publish only the wanted/specified attribute of the device. Can someone help me how I should implement this? I unsuccessfully tried to add a description in my Z2M configuration.yaml file, and I don’t know how I could add this in the Z2M app itself (settings tab). Looking forward to your suggestions. Thanks.


You might be misunderstanding how the filtered_attributes works. It is not an include list, but a deny list.

You have two options here:

  • Either list each individual attribute in your filter. In your screenshot, it seems you’re filtering out voltage as an attribute, but did not add the rest of the attributes to be filtered out.

  • Otherwise, you can apply it globally for all your devices if you set legacy_entity_attributes: false under the Homeassistant settings tab.

I still fail to understand why your db is exploding with the default settings though. Unless you’ve set your recorder to keep more than 10 days (default) data, these entities’ data will be purged after 10 days (if they don’t have a state_class which writes to Long-Term storage)

Some power monitoring devices are stupidly chatty. Like multiple times a second. Bad for zigbee network congestion too.

:eyes: Looking at you Zemismart.