# State machine

> The part of Home Assistant Core that holds the current state of every entity.

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

- In code: `hass.states`, `StateMachine`

Integrations write states to it, and everything else reads from it: automations, templates, dashboards. Writing goes through the entity, not straight to the state machine.

## Related terms

- [State](https://contributors.home-assistant.io/glossary/state/): The current value of an entity, like `on`, `21.5`, or `playing`, together with its attributes.
- [The hass object](https://contributors.home-assistant.io/glossary/hass/): The `HomeAssistant` instance that integrations get, with access to the state machine, the event bus, actions, and the configuration.
- [Event](https://contributors.home-assistant.io/glossary/event/): A message on the event bus that something happened, like a state change or a button press. Any code can listen to events.
