Class

HMHome

An HMHome object allows you to communicate with and configure the different accessories in a home. Homes are the central organizing object for HomeKit.

Overview

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.

Symbols

Information About the Home

var name: String

The name of the home.

var isPrimary: Bool

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

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.

Managing Actions

Managing Users

var users: [HMUser]

All users associated with the home.

Deprecated

Getting and Setting the Delegate

var delegate: HMHomeDelegate?

Delegate that receives updates on the state of 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