I for one would love to see a guide/ideas on properly treating history/stats based on what you want to know versus what HA thinks you want to know. I am just now digging into how best to set up things and I believe the majority of users just don’t know or don’t think it through.
Examples – I have a Sports Standings and Scores set of REST and template entities. History on this (to me) is meaningless. IMHO that applies to 90% of entities. I could care less about stats for these except possibly what was the state before that restart. But last week at 2:00am? I could care less.
Or my BBQ sensors for a TUYA based thermometer … or my media players … etc/etc.
It seems as though the standard in HA is record everything unless you tell me not to. Which to me personally is counter-intuitive unless I am wrong. I would think it should be record only the last state unless you want history like for Energy use or something. And the user should be assigned to select what those things are, not HA.
Just my thoughts … as I am only starting to think through this I might be way off.
I just took a peak at me DB and I see this:
Looks awful large to me for a lot of nothing. Has to impact the performance.
From the documentation on history I think it is not logically done from the start. It is “ON” for everything unless you tell me to not record. I think it should be the opposite UNLESS that impacts things like a reboot and a switch state is not known then. But I do not know and would appreciate someone telling me differently.
As in … “Is there a way to only record the last state without keeping a history of those states ?”
Filters are applied as follows:
No filter
All entities included
Only includes
Entity listed in entities include: include
Otherwise, entity matches domain include: include
Otherwise, entity matches glob include: include
Otherwise: exclude
Only excludes
Entity listed in exclude: exclude
Otherwise, entity matches domain exclude: exclude
Otherwise, entity matches glob exclude: exclude
Otherwise: include
Domain and/or glob includes (may also have excludes)
Entity listed in entities include: include
Otherwise, entity listed in entities exclude: exclude
Otherwise, entity matches glob include: include
Otherwise, entity matches glob exclude: exclude
Otherwise, entity matches domain include: include
Otherwise: exclude
Domain and/or glob excludes (no domain and/or glob includes)