The Home APIs for Android present all devices in the Google Home ecosystem in a unified data model. This data model covers all types of devices (from Google Nest or 3rd party manufacturers), regardless of the underlying smart home technology (such asMatterorCloud-to-cloud), and provides a common API surface to build user experiences for bothsmart homeand mobile app developers.

## Device types

The device types presented in the Home APIs are a unification ofMatterandCloud-to-clouddata models. Some are derived directly fromMatter, some are an extension ofMatterdevice types, and some are derived fromCloud-to-cloud.

Device types contain traits that are used to control and manage devices. Like device types, traits are derived fromMatterclusters andCloud-to-cloudtraits and presented in a common format that is similar to that ofMatterclusters. In the Home APIs,Matter-derived traits are called*traits* , not*clusters*.

As such, device types and traits in the Home APIs are intended to beMatter-first. AMatterdevice type or trait takes precedence over aCloud-to-cloudanalog.

See[Supported device types on Android](https://developers.home.google.com/apis/android/supported-device-types)for a list of device types and their traits.

## Traits

Kotlin versions of traits are generated for use in the Home APIs, and contain additional features specific to the Home APIs (not found inMatterorCloud-to-cloud). For example, each trait has methods to check whether a trait supports a specific attribute or command. This is useful when determining whether reading of state or certain actions can be carried out on a user's device, since not all devices in a device type are expected to have all the same features.

Each trait is contained in its own namespace and must be imported individually for use.

For example, to use theMatterOn/Off trait and On/Off Plug-in Unit device type, import the following packages into your application:  

    import com.google.home.matter.standard.OnOff
    import com.google.home.matter.standard.OnOffPluginUnitDevice

For a[Garage device type](https://developers.home.google.com/reference/kotlin/com/google/home/google/GoogleGarageDevice)(from the Google smart home), include a mix ofMatterand Google traits:  

    import com.google.home.google.LockUnlock
    import com.google.home.matter.standard.DoorLock
    import com.google.home.matter.standard.GoogleGarageDevice

Android Studiohas auto-complete functionality and will often handle the full package names for you when adding`import`lines to source files in your project. However, package names are not consistent across all device types and traits. See the reference to verify the correct package name for each[`DeviceType`](https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType)or[`Trait`](https://developers.home.google.com/reference/kotlin/com/google/home/Trait).

<br />

| **Tip:** Device types that begin with`Google*`are Google smart home device types and are not Google-branded devices (such as Google TV).

<br />

Most traits are supported for use with Automations, and some traits are*only* available for Automations. For more details, see[Automation API trait support on Android](https://developers.home.google.com/apis/android/automation/supported-traits).

## Device type composition

The Home APIs support mostMatterapplication clusters as traits in the data model. Traits that don't correspond to device control or states and don't offer any utility for end users, such as Binding and Groups, are not exposed through the Home APIs.

Traits derived fromCloud-to-cloudsmart home traits typically have the same name betweenCloud-to-cloudand the Home APIs, such as in the example of OpenClose. Others are represented as extensions ofMattertraits, created usingMattermanufacturer-specific extensions. These traits bridge the gap for asmart hometrait where functionality is split between theMatterSDK and the Google Home ecosystem. A specific example of this are the`Google*`device types which come fromCloud-to-cloudbut don't have Matter analogs yet.

Device types are composed of traits from one or both sources,MatterorCloud-to-cloud.

For example, the[Fan device type](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/FanDevice)is composed of both and features three traits:

- The`Identify`Mattertrait provides all the functionality from theMatter`Identify`.
- The`FanControl`Mattertrait provides all the functionality from theMatter`FanControl`trait
- The`ExtendedFanControl`Google trait provides all the functionality from the Googlesmart home`FanSpeed`trait that is not covered by the`FanControl`Mattertrait

This type of trait composition provides a flexible model for complete device type functionality, abstracting the underlyingsmart homedata models.