# Long-term statistics

> Hourly summaries of sensor values, like the mean, minimum, and maximum, or a running total, that the recorder keeps for good, for graphs over long periods and the energy dashboard.

Source: https://contributors.home-assistant.io/glossary/statistics/

- In code: `statistics`, `state_class`
- Also: statistics, LTS

Home Assistant keeps statistics for every sensor with a [state class](https://contributors.home-assistant.io/glossary/state-class/). Unlike the history, they are not cleaned up after ten days. Five-minute summaries are kept too, but only as long as the history.

## Related terms

- [Recorder](https://contributors.home-assistant.io/glossary/recorder/): The integration that stores the history of states and events in a database.
- [State class](https://contributors.home-assistant.io/glossary/state-class/): How the value of a sensor behaves, like `measurement` or `total_increasing`, so Home Assistant can keep long-term statistics for it.
