# State class

> How the value of a sensor behaves, like `measurement` or `total_increasing`, so Home Assistant can keep long-term statistics for it.

Source: https://contributors.home-assistant.io/glossary/state-class/

- In code: `state_class`, `SensorStateClass`
- Also: state classes

Sensors without a state class get no [long-term statistics](https://contributors.home-assistant.io/glossary/statistics/). The energy dashboard only works with sensors that have one.

## Related terms

- [Long-term statistics](https://contributors.home-assistant.io/glossary/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.
- [Device class](https://contributors.home-assistant.io/glossary/device-class/): What an entity measures or is, like `temperature` or `door`. It sets the icon, the units, and how the frontend shows the entity.
- [Entity](https://contributors.home-assistant.io/glossary/entity/): One thing Home Assistant can show, measure, or control, like a light, a temperature sensor, or a switch. Every entity has a state.
