# State

> The current value of an entity, like `on`, `21.5`, or `playing`, together with its attributes.

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

- In code: `State`, `hass.states`, `native_value`
- Also: states, state object

States live in the [state machine](https://contributors.home-assistant.io/glossary/state-machine/). A state is always stored as a string, even when it is a number. When it changes, Home Assistant fires a `state_changed` [event](https://contributors.home-assistant.io/glossary/event/), and the recorder writes it to the history.

Two states are special: [unavailable and unknown](https://contributors.home-assistant.io/glossary/unavailable/).

## Related terms

- [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.
- [Attribute](https://contributors.home-assistant.io/glossary/attribute/): Extra information that comes with a state, like the brightness of a light or the list of effects it supports.
- [State machine](https://contributors.home-assistant.io/glossary/state-machine/): The part of Home Assistant Core that holds the current state of every entity.
- [Unavailable](https://contributors.home-assistant.io/glossary/unavailable/): A special state for an entity that Home Assistant can't reach right now. Its counterpart, unknown, means it can be reached but has no value yet.
