com.google.home

Interfaces

BatchScope

The scope for the lifecycle of a batch.

Batchable

The Batchable interface allows entities/objects to be batched together.

BitmapDescriptor

Bitmaps are effectively enumerations if you unroll the individual bits in the mask into their own enum values.

ClusterStruct

Interface for a Cluster Struct field.

CommandDescriptor

Interface implemented by every trait command.

DeferredResponse

Represents the response of a command which will be populated after the batch completes.

Descriptor

A tagging interface to describe a field, such as StructDescriptor

DeviceHistoryItem

A history item generated by a device.

EnumDescriptor

Descriptor representing an enumeration, with its name and a map of its numeric values to value labels.

Event

Interface tagging for events.

Field

Interface describing a Field of a Trait, Command, Event or Struct

GenericTrait

A Trait that contains data represented generically as a FieldMap

GhpCoreMetadata
HasComponentId
HasConnectivityState

Represents the state of a device (HomeDevice,Component,DeviceType,Trait).

HasCustomAppData

Interface for a Key-Value Controller.

HasDeviceTypes

This interface allows for getting device types from a Device.

HasEvents

Interface implemented by objects that have observable events.

HasGenericTraits

This interface is only present to allow the sample app to see all traits present on a device (even with TraitId collisions). flatMap + .toSet on the collection of traits from the genericTypes() isn't quite the same, since it doesn't contain traits outside of the type's defined set.

HasGenericTypes
HasHomeDevices

Query devices within the implementation context (HomeManager, Structure, Room) the caller has permissions to access.

HasId

Entities in the SDK present a stable ID for comparing Collections and retrieving entities directly.

HasRooms

Query Rooms the caller has permissions to access.

HasStructures

Query Structures the caller has permissions to access.

HasTraits

An entity with associated traits and trait metadata.

HistoryItem

The semantic representation of a history item.

HistoryItemsPage

Represents a page of history items.

HistoryItemsPage.Error

Represents a failed fetch of a history items page.

HistoryItemsPage.Success

Represents a successful fetch of a history items page.

HistoryManager

A manager for history items.

HomeClientWithProvidedAccount

Interface for Home APIs that provides access to provided account specific functionality.

HomeDevice

A device supporting traits, commands, and subscriptions.

HomeObjectChangeEvent

Base interface expanded into different events for the streaming API.

HomeObjectType

Tagging interface for all objects' types (Structure, Room or HomeDevice).

Room

An object that represents a Room in a Structure.

RoomHistoryItem

A history item generated by a room.

SearchableCameraEventType

A searchable camera event type for a history filter.

SearchableEvent

A searchable event for a history filter.

SearchableId

A searchable ID for a history filter.

SearchableItem

A schema for available history filters.

SearchableTrait

A searchable trait for a history filter.

StructDescriptor

Interface implemented by logical struct types.

Structure

The top-level organizing construct for the Home.

StructureHistoryItem

A history item generated by a structure.

Tag
Trait

Base class for traits and generated Matter clusters.

TraitProvider

A functional interface for returning a trait instance from the current data snapshot.

TraitStateInvalidation

This API provides the ability to invalidate state retrieved through subscriptions to the target device in the cases where state is not being reported correctly, either intentionally (e.g attributes in Matter traits with the "C" quality) or unintentionally due to poor implementations.

Updatable

This interface keeps the lifecycle of mutable objects within the scope of the update function.

UserAccount

User identifier to be used with Home.getClient to return a HomeClientWithProvidedAccount.

Classes

BaseHomeError

Base class for HomeError and MatterError.

BatchableCommand

Represents a command that can be batched with other commands.

CameraEventTypeFilter

Filter by Camera Event Type.

CustomFilter

Custom filter.

DecommissionEligibility

Sealed class that represents the eligibility of a matter device for decommissioning.

DecommissionEligibility.EligibleWithSideEffects

The device is eligible for decommissioning, but there could be side effects on other devices.

DecommissionEligibility.Ineligible

The device is not eligible for decommissioning.

DecommissionIneligibleReason

Sealed class that represents the reason why a device is not eligible for decommissioning.

DecommissionIneligibleReason.BridgedDevice

The device is a bridged device, and cannot be decommissioned directly (the primary bridge must be decommissioned first).

DecommissionIneligibleReason.Other

Other reason why the device is not eligible for decommissioning.

DecommissionSideEffects

Sealed class that represents the side effects of decommissioning a device.

DecommissionSideEffects.Bridge

The device is a bridge, and decommissioning it will affect other bridged devices.

DecommissionSideEffects.MultipleAffectedDevices

Decommissioning the device will affect multiple devices.

DeviceType

Abstract base class for all generated DeviceType classes.

DeviceType.Metadata
DeviceTypeFactory

Wrapper for companion objects to subclass to create shorter syntax.

EnumEntry
EventFactory

Wrapper for companion objects to subclass to create shorter syntax.

EventFilter

Event filter using the existing SDK event definitions.

FactoryRegistry

A registry of traits and device types to be used by the SDK.

FilterSchema

Schema for a history filter.

GenericDeviceType
GenericEventProvider
GenericTraitProvider
HistoryFilter

Base class for all filters.

HistoryFilter.DisjunctiveClause

A clause that can be part of a disjunction (OR-ed).

Home

Entry point for the Home API.

HomeConfig

Stores common config for configuring the behavior of the SDK.

HomeError

Representation of an error that happened during an API call.

HomeObjectAddedEvent

When a Structure, Room or HomeDevice is added to the corresponding top level flow, this event is issued with the newly added home object.

HomeObjectInitialEvent

Event issued during data priming.

HomeObjectRemovedEvent

When a Structure, Room or HomeDevice is deleted, this event is issued with the id of the deleted home object.

HomeObjectUpdatedEvent

When a Structure, Room or HomeDevice is modified, this event is issued with the modified home object.

HomeObjectsFlow

A Flow of a Set of home objects.

Id

Opaque holder for an ID.

IdFilter

Filter by ID.

MatterError
PermissionsResult

The result of a request for home permissions.

RoomType

Room type definition.

SourceConnectivity

Data source metadata for a single trait.

StructureType

Structure type definition.

TimestampFilter

Filter by timestamp.

Trait.TraitMetadata

General metadata common to all traits.

TraitFactory

Wrapper for companions to subclass to create shorter syntax.

TraitFilter

Trait filter using the existing SDK trait definitions.

TypeFactory

Wrapper for companion objects to subclass to create shorter syntax.

UserAccount.FederatedAccount

A federated account associated with a HomeClientWithProvidedAccount.

UserAccount.GoogleAccount

A Google account associated with a HomeClientWithProvidedAccount.

Exceptions

HomeException

The exception thrown if any issue is encountered during an API call.

Objects

Enums

ConnectivityState

Represents the state of a device (HomeDevice,Component,DeviceType,Trait).

EventImportance

The Event importance as reported.

HomeErrorDomain

Enum representing the domain of a HomeError.

LocalityType

The network locality of a request or route.

Operator

Operator for timestamp comparison.

PermissionsResultStatus

Statuses for a permissions request.

PermissionsState

The state of permissions to access home data for the requesting client.

Type

This enum lists the types of Kotlin variables which represent trait fields.

Type aliases

DescriptorMap

A Map of TagIds to Fields that represents a 'descriptor' for most types of encapsulated data in UDDM/WHDM (e.g. Structs, Commands, Events)

FieldMap

Field-Value map represents the format for generic trait content.

TagId
TagMap

Top-level functions summary

HistoryFilter

Creates a HistoryFilter using a type-safe DSL.

Extension functions summary

operator Boolean

Helper on sets of DeviceType to allow convenience syntax similar to DimmableLightDevice in types where types is a Set.

Any?

This converts specific field values to a more JSON-friendly representation.

Map<FieldAny?>

This converts a FieldMap to a JSON conversion ready map that can then be used with libraries like Gson.

operator T?

Direct accessor to the DeviceType that auto-casts the result.

operator T?
<T : Trait> Set<Trait>.get(factory: TraitFactory<T>)

Direct accessor to the Trait that auto-casts the result.

Collection<LocalityType>

Returns all distinct data source localities of this device type's traits.

Map<ULongEnumEntry>
Map<UIntField>
Map<ULongEnumEntry>
String
Flow<T?>
<T : Trait> Flow<DeviceType>.trait(factory: TraitFactory<T>)

Returns a flow of the trait of type T from this device type.

Top-level functions

historyFilter

fun historyFilter(init: HistoryFilter.Companion.() -> HistoryFilter): HistoryFilter

Creates a HistoryFilter using a type-safe DSL.

Extension functions

contains

operator fun <T : DeviceType> Set<DeviceType>.contains(factory: DeviceTypeFactory<T>): Boolean

Helper on sets of DeviceType to allow convenience syntax similar to DimmableLightDevice in types where types is a Set.

convertScalarToString

fun Field.convertScalarToString(value: Any?): Any?

This converts specific field values to a more JSON-friendly representation. Specifically:

ByteArray --> Hex string (for readability, and to distinguish from Array)

Enum --> Stringified with a concatenation of the enum name + enum value labels.

convertToJsonReadyMap

fun Map<FieldAny?>.convertToJsonReadyMap(): Map<FieldAny?>

This converts a FieldMap to a JSON conversion ready map that can then be used with libraries like Gson.

This specifically converts byte arrays, enums and bitmaps into a better representation for JSON (see Field.convertScalarToString for specifics).

get

operator fun <T : DeviceType> Set<DeviceType>.get(factory: DeviceTypeFactory<T>): T?

Direct accessor to the DeviceType that auto-casts the result. Returns null if the DeviceType with the requested type is not present.

get

operator fun <T : Trait> Set<Trait>.get(factory: TraitFactory<T>): T?

Direct accessor to the Trait that auto-casts the result. Returns null if the trait with the requested type is not present.

getLocalityTypes

fun DeviceType.getLocalityTypes(): Collection<LocalityType>

Returns all distinct data source localities of this device type's traits.

toBitmapDescriptor

fun <E : Enum<E> & ClusterBitmapFlag> EnumEntries<E>.toBitmapDescriptor(): Map<ULongEnumEntry>

toDescriptorMap

fun <E : Field & Enum<E>> EnumEntries<E>.toDescriptorMap(): Map<UIntField>

toEnumDescriptor

fun <E : Enum<E> & ClusterEnum> EnumEntries<E>.toEnumDescriptor(): Map<ULongEnumEntry>

toHexString

fun ByteArray.toHexString(): String

trait

fun <T : Trait> Flow<DeviceType>.trait(factory: TraitFactory<T>): Flow<T?>

Returns a flow of the trait of type T from this device type. Allows for convenience syntax similar to device.type(DimmableLightDevice).trait(OnOff).

Parameters
factory: TraitFactory<T>

the factory for the trait to get.

Returns
Flow<T?>

a flow of the trait of type T from this device type.