Class

HMHome

A home and its accessories.

Overview

Homes are the central organizing object for HomeKit. Homes have three main purposes:

  • Organize accessories into a number of rooms, which are themselves optionally grouped into zones.

  • Serve as the main access point for communicating with and configuring accessories.

  • Allow the user to define sets of actions that can be performed with a single operation, and triggers that can cause an action set to be performed at a specific time.

You don’t create homes directly—instead, you create them with the addHome(withName:completionHandler:) method of HMHomeManager.

Topics

Information About the Home

var name: String

The name of the home.

var uniqueIdentifier: UUID

A unique identifier for the home.

var isPrimary: Bool

A Boolean value that indicates whether the receiver is the primary home for its home manager.

var homeHubState: HMHomeHubState

Specifies the state of the home hub.

Managing Rooms

var rooms: [HMRoom]

An array of the rooms in the home.

func roomForEntireHome()

A room that represents all parts of the home that don’t have a more specific room to represent them.

Managing Zones

Managing Services

func servicesWithTypes([String])

Returns an array of all services provided by accessories in the home that match the specified types.

var serviceGroups: [HMServiceGroup]

An array of all service groups in the home.

Getting and Setting the Delegate

var delegate: HMHomeDelegate?

Delegate that receives updates on the state of the home.

protocol HMHomeDelegate

A set of methods that define the communication method for configuration changes to a home and for the state of executing action sets in the home.

Constants

User Failed Key

Key for retrieving details of what accessories failed to add or remove a user.

Relationships

Inherits From

Conforms To

See Also

Home Setup

class HMHomeManager

The manager for a collection of one or more homes.

class HMUser

A person in the home who may have access to control accessories and services in the home.

class HMHomeAccessControl

The access privileges of a user associated with a home.