What is a Device?
A device is a physical piece of hardware that can have one or more entities associated with it. For example, a smart thermostat device might have:- A climate entity for temperature control
- A temperature sensor entity
- A humidity sensor entity
- A battery sensor entity
Devices help organize entities and provide context about the hardware they represent.
Device Registry
The device registry (homeassistant/helpers/device_registry.py) maintains information about all devices in Home Assistant. It provides:
- Persistent storage of device information
- Unique device identification
- Device-to-config-entry relationships
- Area assignment
- Device metadata (manufacturer, model, firmware version)
Device Entry Structure
Each device in the registry has aDeviceEntry with the following key attributes:
Key Properties
Device Identification
Devices are identified using one or both of these methods:Identifiers
Domain-specific unique identifiers:Connections
Physical connection identifiers:DeviceInfo
Integrations provide device information using theDeviceInfo TypedDict:
Creating or Updating Devices
Devices are typically created automatically when entities are registered, but you can also create them explicitly:Device Types
Devices can have different entry types:Device Relationships
Hub Devices
Devices can be connected through a hub usingvia_device:
Area Assignment
Devices can be assigned to areas for logical grouping:Device Disabling
Devices can be disabled through several mechanisms:Configuration URL
Devices can provide a URL to their configuration interface:http://https://homeassistant://
Retrieving Devices
Deleted Devices
When devices are removed, they’re moved to a deleted devices collection and can be restored if the same device is discovered again:Best Practices
Unique Identification
Always provide unique identifiers or connections that persist across device resets and Home Assistant restarts.
Meaningful Names
Provide clear manufacturer, model, and device names to help users identify their devices.
Version Information
Include software and hardware version information when available for diagnostics and troubleshooting.
Hub Relationships
Use
via_device to properly represent hub-connected devices for better organization.Connection Types
Common connection types:Example: Complete Device Setup
Related Resources
Entities
Learn about entities and their relationship to devices
Config Entries
Understand how devices relate to config entries