Help! Problem with aggregation?

@lmilcent I just looked at the database you sent me, and I’m very surprised by its content :smiley:

You have device_feature_state values that are « NaN Â» (Not a Number). It’s very strange that this was inserted, given that the field is a « double precision Â», and « NaN Â» is not a double precision


Of course, this crashes the aggregation that expects numerical values, not a string.

After investigation, these values come from the Zigbee2mqtt integration.

I created a GitHub issue to fix the problem:

  • Add a DB migration to clean up these lines that shouldn’t be there
  • See why the validation and the DB accepted these values that are not Numbers.

In the meantime, @lmilcent and @Albenss, the SQL query to fix your DBs is:

DELETE FROM t_device_feature_state WHERE value = 'NaN';

@lmilcent More generally, I don’t know if you keep all your historical sensor data (you keep them all), but I would advise you to clean up some very verbose deviceFeatures, because currently to perform the aggregation on my Mac, some sensors contained so many values that it took more than 1.5 Gb of RAM to perform the total aggregation (since it’s a first aggregation, it starts from the beginning. This will not be the case later)

Otherwise, by removing the NaN, it works very well for me on your DB: