What is the recommended settings for Max Event/State Days?

At one point it was recommended one of them was not 10 or less, as it caused an issue (excessive database compression, or something like that?) Now I noticed that one of the latest versions changed the numbers to 365/365 (or was it 365/7). I have change mine so many times I forget what they were. Main goal is to minimize issues but record enough information to be useful.

As of recent-ish hub firmware versions (maybe a year or so ago?), I think the defaults have been set at 100 and 30 for event history size and state history size, respectively. So I guess that would be the recommendation, but I'm not sure if there's anything more official than that implication. :slight_smile: You can really set them as low as you want, though having at least a few things to look back on for device history may be helpful if you ever need to troubleshoot something. (You can also set them as high as you want, up to 2000, but they've noticed that larger databases tend to have a negative impact on hub performance, so I wouldn't unless you have a good reason.)

The "10 or less" issue you noted is no longer a concern as of hub firmware 2.2.8; with a value less than or equal to 10, a cleanup previously would have run on every event if it was at this limit to keep it under the value. That change was backtracked since it came with its own problems (so everything is now treated the same with the...I think hourly?...regular cleanup).

A short history lesson: back in the day, I recall that these defaulted to 1,000 for event history and....I don't even remember what for the rest, but probably similarly high. If you haven't set up a hub like new since that time, you may very well still have these values. As you may know, can check <hubIP>/hub/advanced/event/limit and <hubIP>/hub/advanced/deviceStateHistorySize to see what your defaults are currently set to. You can override this per-device on the device page or set new defaults (and overwrite any per-device changes) by adding /yourNewLimit (where yourNewLimit is 1-2000) to either of the URLs above. There is a UI for this on the "alerts" page if your database has grown large enough that you're getting such a warning, but I'm not sure it's exposed in the UI at any other time (that might have changed recently...I just don't see it if it did). I can say my original (2018) hub began performing way better after I adjusted my event history down from 1000 (originally to 250 and finally to the default of 100 or even less when I realized I didn't really need that information on any device) and staff began making the notable performance improvements that began around firmware 2.2.3 or so.

3 Likes

This is a different, now user adjustable parameter. It specifically addresses how many days max to keep event/state hx. Minimum is 7/7, which is what mine is set to.

3 Likes

Thanks, everyone. Still have no idea what reasonable settings are. :smiley: I guess I will adjust as needed if I see issues.

I would imagine that depends on your setup, how far back you may want to look if wanting to examine events, as well as how many and what type of devices you have installed. On my hub with mostly Zigbee lights and Echo Speaks installed, I keep it minimal, 5/5 and 7/7, because I’m not looking at what has happened. On my other hub with locks and sensors, I have a little more history available.

:+1:

That is the best we probably can answer. I set everything to 11 by default, however there are some things I have set to 1 as I don't care if I ever see something again. Why keep things like past weather alerts, or similar data? I could see if you are using history for some historic record, maybe something like a rental, but ordinarily I would default to "less is more".

2 Likes

I thought the suggestion was not below 10 (or maybe 11)? I'll have to find the post where I saw this...

That is no longer true as of 2.2.8. On 2.2.7, 11 is the magic number to not go below.

2 Likes

I am so last week.. :smile:

3 Likes

Hi, where can I find this specific setting, to set the number of days' worth of events that will be retained?