# Unique ID

> An ID that an integration gives an entity or config entry, which never changes, so Home Assistant recognizes it after a restart.

Source: https://contributors.home-assistant.io/glossary/unique-id/

- In code: `unique_id`, `_attr_unique_id`
- Also: unique IDs

An entity with a unique ID gets an entry in the entity registry. Only then can users change its name, area, icon, and entity ID in the UI.

A unique ID comes from something that does not change, like a serial number or a MAC address. Not a name, IP address, or host name: those can change.

## 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.
- [Registry](https://contributors.home-assistant.io/glossary/registry/): Where Home Assistant keeps what it knows about entities, devices, areas, floors, and labels, and what users changed about them.
- [Config entry](https://contributors.home-assistant.io/glossary/config-entry/): One set-up instance of an integration, like one Hue bridge, with the configuration Home Assistant stores for it.
- [Entity ID](https://contributors.home-assistant.io/glossary/entity-id/): The ID of an entity: its domain and an object ID, like `light.kitchen`.
