Open jeremysherriff opened 4 hours ago
Update; My edits to customize.yaml did what I was hoping from the point of view that the states are now seen as numbers and can be aggregated and fed into the statistics engine. Whether this causes the state changes to be stored more efficiently I am unsure (but I have some other very high-change stats that do not bloat the database like these were, so I am quietly confident...)
Configuration
Not applicable (I think?)
Describe the bug
Since v0.7 and the addition of the Global Bermuda device, my HA database has increased in size +15%. This seems to all be in the State table. My database is MariaDB so using phpMyAdmin I checked what the highest state counts are, grouped by entity_id:
The
sensor.bermuda_global_visible_device_count
has a state change count that is an order of magnitude higher than most sensors.I suspect a lot of the bloat is coming from the lack of
state_class
attributes for these sensors, which causes every state change to be recorded as a discrete value rather than being aggregated:I think the following attribute should be added to these sensors:
I have now manually added these attributes using the customize.yaml file and will update on success of this.
Alternatively, these sensors should perhaps be disabled by default?
Diagnostics
Not applicable (I think?)