So my database for HA, 2 months is 3.3GB big. I took a look at the DB and saw that most of it is the states table and its indexes. I then run a count of rows of all the states entries grouped by entity_id and found that the basically 10-20 energy sensors account for +50% of all database rows (so i presume correlates to database size).
Given that these sensors tend to fluctuate a lot (as in decimal of watts is easy to fluctuate in normal idle devices)
- Do you see similar patterns?
- Is there any way to optimize, or reduce the amount of state changes?
I mostly have zigbee and shelly devices to track energy. But my main ‘culprit’ is a basic helper entity which sums the power of the devices so I can see the real-time total power used at home and see if i need to adapt usage patterns. Because that’s a helper entity, I have no way to manage it, but I understand it will update as many times as each of the underlying sensors does. Not sure if I can limit that to once per 2 seconds or something like that?
PS: I opened in Energy as those are the main entities culprits, but feel free to move to other categories.