So many events in Home Assistant

Oh didn’t know you were referring to storage. I’m not sure about the details of the storage in Home Assistant’s recorder. If it is tracking the individual attributes as separate rows in the database that would be correct.

Should this be a bug report or feature request for Zigbee2Mqtt to only send updates on items that have changed?

My energy reporting settings are below. I believe that should reduce them but I am seeing power changes of 0.1. Have I set the values correctly?

BTW, I am running the very latest (as of last night) of the inovelli.js from GitHub as a custom MQTT addon.

Use the reporting tab rather than the exposes tab. There is an issue with the sliders there connecting to the reporting configuration that they were intended to represent.

1 Like

Thank you @nathanfiscus!

Here is what I changed…

I changed Min. rep. change to 100 which stopped the reports, I tried 10 and still no reports, then 1 and the reports started to work again. What is the units for this variable? Is this even the right report?

When does Min. rep. interval come into play? I take it that is in seconds.

Is there a guide somewhere on this somewhere? I looked at Usage | Zigbee2MQTT which describes many of the screens but I don’t see anything on reporting.

The unit is 0.1 Watts

1 Like

Something feels broken then. On a 10 watt load and setting to 10 reports stop.

I think the way it works is a setting of 10 will mean that a change of 1 watt create a new report. So if the current reading of 10 watts will have to change to more than 11 watts or less than 9 watts to create a new report.

Thank you @mike789!

The test I used was from off I turned on the load which is usually 10.1 or 10.2. I’m assuming off is 0, but I have seen 0.2.

Interestingly I could be right on the edge if the change is from .2 to 10.1, a change of 9.9.

So I can’t explain why a setting of 10 would not report.

What I would like to have is to report on a 1w change.

Curious how you’ve got your recorder settings setup in configuration.yaml? I have mine with 7 days retention, auto_purge set to true and only the bed scale entities disabled because they update every 0.2s. My DB hums along just under 2gb steady and that’s with a blue on there for several months now.

A quick workaround for now could be excluding the number domain.

recorder:
  exclude:
    domains:
      - number

That will at least keep most of the entities from writing to the DB to keep it from growing exponentially.

Yeah I’ve since added many exclusions and disabled hundreds of unnecessary entities and it’s OK now. I do believe there shouldn’t be a requirement to go dial back the fire hose especially when you don’t expect expect a couple switches to result in suddenly being out of disk space.

I normally keep 30 days of history and that’s been fine for years with everything else I have.

I believe this is just an end result because of how z2m operates. Basically anything under that “exposes” tab gets exposed to HA as an entity. This happens on all of my devices on z2m. It’s MUCH more noticeable with the blues because of the sheer number of options and configurability these devices have, especially with the individually addressable LED’s.

I’ve personally never noticed an impact on my DB through testing, but 130+ entities will definitely add to it. I’m also going to exclude the numbers domain because I don’t need to track history of any of them. I’ll see if it makes an impact on my DB size. I personally would prefer excluding from the DB rather than disabling the entity. The bonus of having the entity created is it allows easy configuration through HA’s UI or something that can be set or changed through an automation.

All of my sitches have “switch” in their name/enity_id so I use these excludes.

  exclude:
    entity_globs:
      - number.*_switch_*
      - sensor.*_switch_*
      - binary_sensor.*_switch_*

Hey all! I continue to scrub my data and find ways to reduce the overall messaging load. I have been doing a number of things, one of which is a feature request I opened against Zigbee2Mqtt.

Foremost I created a Python script that connects to Home Assistant over a websocket. The script takes a device name and a configuration of a list of entity names to be disabled. So, instead of disabling recorder entities I completely disable the entities I don’t want to see. This reduces clutter in UI and keeps my database clean. If people would like I can post the script on this thread. It’s required that you have Python installed somewhere where you can run a script.

The script is nice but whenever I add a new switch I will have to run the script again (I like fully automated solutions). The feature request I submitted to Z2M is to enhance a configuration item they already have. There is a feature in Z2M to suppress attributes that are published. The config I added to Z2M (which is just an example) is:

"device_options": {
            "filtered_attributes": [
                "^defaultLed\\d.*When(On|Off)$",
                "^dimmingSpeed.*$",
                "^led.*When(On|Off)$",
                "^rampRate(On|Off)To.*$"
            ]
}

This config means that any attribute that matches one of the regular expressions in the list will not be published by Z2M. This does what it is supposed to, however it does not suppress those attributes on the MQTT message that causes HA to create entities – which is what I would really like. Here is the GitHub issue if you want to follow along and/or comment: [Feature request]: Add support for filtered_attributes on device creation · Issue #15075 · Koenkk/zigbee2mqtt · GitHub.

Other things I have done are to reduce the reporting thresholds on energy and power. In the reporting tab for the device I changed haElectricalMeasurementactivePower to 10 and I changed saMeteringcurrSummDelivered to 10. AThe power change was very helpful as I have a device whose power reading would flip back and forth between 10.5 and 10.6 and each flip causes a update. (I still don’t understand the reason these are updated on the Z2M reporting tab versus the Exposes tab.)

I plan on automated my default configuration of a switch in the future. This will include defaults I would like for me as well as the reporting parameters. I believe everything I want to configuration as defaults can be accomplished using the MQTT publish HA service call. I know configuration parameters can be handled, I don’t yet know about reporting parameters. Still learning here and would be grateful for any tips.

1 Like

I would be interested in the script

Comment on the GitHub gist if possible.

5 Likes

Thanks to @nathanfiscus who posted the recommendation in another thread.

This will remove the duplicate attribrutes in all the entities. Just uncheck the box for “Home Assistant legacy entity attributes” then submit. After you must do a complete Home Assistant restart. Only restarting Z2M will not work.

1 Like

“Home Assistant legacy entity attributes” is already disabled for me, yet I still see the huge number of attributes.

This script works great! Thank you!

Is there a tutorial somewhere on how to enter this script? I’ve search and haven’t found anything yet.
Thanks Paul

Did you figure out how to actually run this?