<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMHome",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMHome"
  },
  "title" : "HMHome"
}
-->

# HMHome

The primary unit of living space, typically composed of rooms organized into zones.

```
class HMHome
```

## Overview

An [`HMHome`](/documentation/HomeKit/HMHome) instance is a top-level container in HomeKit representing a structure that a user considers as a single home. Users might have multiple homes that are far apart, like a primary home and a vacation home. Or they might have two homes that are close together, but that they consider as distinct units—for example, a main home and a guest cottage on the same property.

An [`HMHome`](/documentation/HomeKit/HMHome) instance:

- Is the main access point for communicating with and configuring accessories, like a garage door opener or a thermostat.
- Organizes accessories into a number of rooms, which are themselves optionally grouped into zones, such as the upstairs.
- Allows the user to define sets of actions that can be performed with a single operation, and triggers that cause an action set to be performed at a specific time.

You create a new home only in response to a specific user request, but you don’t do it directly. When the user asks your app to create a new home—for example, by tapping an Add button in your interface—your app calls the home manager’s [`addHome(withName:completionHandler:)`](/documentation/HomeKit/HMHomeManager/addHome(withName:completionHandler:)) method with a name that the user supplies. To get a list of existing home instances, use the [`homes`](/documentation/HomeKit/HMHomeManager/homes) array of the home manager (an instance of [`HMHomeManager`](/documentation/HomeKit/HMHomeManager)).

Because HomeKit gives your app access to a shared database of home automation information, other apps can change the home’s configuration. Adopt the [`HMHomeDelegate`](/documentation/HomeKit/HMHomeDelegate) protocol in your app to stay informed of any such changes that happen outside your app.

## Topics

### Keeping track of home configuration changes

[`delegate`](/documentation/HomeKit/HMHome/delegate)

A delegate that receives updates on the state of the home.

[`HMHomeDelegate`](/documentation/HomeKit/HMHomeDelegate)

An interface that communicates changes to a home’s configuration.

### Identifying a home

[`name`](/documentation/HomeKit/HMHome/name)

The name the user gives to the home.

[`-  updateName:completionHandler:`](/documentation/HomeKit/HMHome/updateName(_:completionHandler:))

Updates the name of the home.

[`uniqueIdentifier`](/documentation/HomeKit/HMHome/uniqueIdentifier)

A unique identifier for the home.

[`primary`](/documentation/HomeKit/HMHome/isPrimary)

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

### Dividing a house into rooms

[`rooms`](/documentation/HomeKit/HMHome/rooms)

An array of the rooms created and managed by the user.

[`-  roomForEntireHome`](/documentation/HomeKit/HMHome/roomForEntireHome())

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

[`-  addRoomWithName:completionHandler:`](/documentation/HomeKit/HMHome/addRoom(withName:completionHandler:))

Creates a new room with the specified name.

[`-  removeRoom:completionHandler:`](/documentation/HomeKit/HMHome/removeRoom(_:completionHandler:))

Removes a room from the home.

[`HMRoom`](/documentation/HomeKit/HMRoom)

The smallest subdivision of a home’s space.

### Grouping rooms into zones

[`zones`](/documentation/HomeKit/HMHome/zones)

An array of all the zones in the home.

[`-  addZoneWithName:completionHandler:`](/documentation/HomeKit/HMHome/addZone(withName:completionHandler:))

Adds a new zone to the home.

[`-  removeZone:completionHandler:`](/documentation/HomeKit/HMHome/removeZone(_:completionHandler:))

Removes a zone from the home.

[`HMZone`](/documentation/HomeKit/HMZone)

A collection of rooms that users think of as a single area, like upstairs or downstairs.

### Managing accessories

[`accessories`](/documentation/HomeKit/HMHome/accessories)

The collection of accessories that are part of the home.

[`-  addAndSetupAccessoriesWithCompletionHandler:`](/documentation/HomeKit/HMHome/addAndSetupAccessories(completionHandler:))

Finds and adds nearby accessories to the home.

[`-  addAndSetupAccessoriesWithPayload:completionHandler:`](/documentation/HomeKit/HMHome/addAndSetupAccessories(with:completionHandler:))

Finds and adds nearby accessories to the home using a HomeKit code provided by your app.

[`-  addAccessory:completionHandler:`](/documentation/HomeKit/HMHome/addAccessory(_:completionHandler:))

Adds a new accessory to the home.

[`-  assignAccessory:toRoom:completionHandler:`](/documentation/HomeKit/HMHome/assignAccessory(_:to:completionHandler:))

Assigns an accessory to a different room.

[`-  removeAccessory:completionHandler:`](/documentation/HomeKit/HMHome/removeAccessory(_:completionHandler:))

Removes an accessory from the home.

[`supportsAddingNetworkRouter`](/documentation/HomeKit/HMHome/supportsAddingNetworkRouter)

A Boolean that indicates whether a home supports all of the requirements for adding a network router.

[`-  unblockAccessory:completionHandler:`](/documentation/HomeKit/HMHome/unblockAccessory(_:completionHandler:))

Unblocks a blocked accessory.

[`HMAccessory`](/documentation/HomeKit/HMAccessory)

A home automation accessory, like a garage door opener or a thermostat.

### Grouping services

[`-  servicesWithTypes:`](/documentation/HomeKit/HMHome/servicesWithTypes(_:))

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

[`serviceGroups`](/documentation/HomeKit/HMHome/serviceGroups)

An array of all service groups in the home.

[`-  addServiceGroupWithName:completionHandler:`](/documentation/HomeKit/HMHome/addServiceGroup(withName:completionHandler:))

Adds a service group to the home.

[`-  removeServiceGroup:completionHandler:`](/documentation/HomeKit/HMHome/removeServiceGroup(_:completionHandler:))

Removes a service group from the home.

[`HMServiceGroup`](/documentation/HomeKit/HMServiceGroup)

A collection of accessory services.

### Querying the state of a home hub

[`homeHubState`](/documentation/HomeKit/HMHome/homeHubState)

The state of the home hub.

[`HMHomeHubState`](/documentation/HomeKit/HMHomeHubState)

The possible states of the home hub.

### Creating action sets

[`actionSets`](/documentation/HomeKit/HMHome/actionSets)

An array of the action sets in the home.

[`-  addActionSetWithName:completionHandler:`](/documentation/HomeKit/HMHome/addActionSet(withName:completionHandler:))

Adds a new action set to the home.

[`-  removeActionSet:completionHandler:`](/documentation/HomeKit/HMHome/removeActionSet(_:completionHandler:))

Removes an action set from the home.

[`-  executeActionSet:completionHandler:`](/documentation/HomeKit/HMHome/executeActionSet(_:completionHandler:))

Executes all the actions in a specified action set.

[`-  builtinActionSetOfType:`](/documentation/HomeKit/HMHome/builtinActionSet(ofType:))

Retrieves the builtin action set for the specified type.

[`HMActionSet`](/documentation/HomeKit/HMActionSet)

A collection of actions that you trigger as a group.

### Triggering an action set

[`triggers`](/documentation/HomeKit/HMHome/triggers)

An array of triggers defined in the home.

[`-  addTrigger:completionHandler:`](/documentation/HomeKit/HMHome/addTrigger(_:completionHandler:))

Adds a trigger to the home.

[`-  removeTrigger:completionHandler:`](/documentation/HomeKit/HMHome/removeTrigger(_:completionHandler:))

Removes a trigger from the home.

[`HMTimerTrigger`](/documentation/HomeKit/HMTimerTrigger)

A trigger to activate an action set based on a periodic timer.

[`HMEventTrigger`](/documentation/HomeKit/HMEventTrigger)

A trigger to activate an action set based on a set of events and optional conditions.

[`HMTrigger`](/documentation/HomeKit/HMTrigger)

An abstract base class for triggering actions based on a set of conditions.

### Managing users

[`-  manageUsersWithCompletionHandler:`](/documentation/HomeKit/HMHome/manageUsers(completionHandler:))

Presents a view controller to manage users of the home.

[`currentUser`](/documentation/HomeKit/HMHome/currentUser)

The current HomeKit user.

[`HMUser`](/documentation/HomeKit/HMUser)

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

### Controlling user access

[`-  homeAccessControlForUser:`](/documentation/HomeKit/HMHome/homeAccessControl(for:))

Retrieves the access level of a user associated with the home.

[`HMHomeAccessControl`](/documentation/HomeKit/HMHomeAccessControl)

The access privileges of a user associated with a home.

[`HMAccessControl`](/documentation/HomeKit/HMAccessControl)

An abstract superclass for accessing user privileges.

[`HMUserFailedAccessoriesKey`](/documentation/HomeKit/HMUserFailedAccessoriesKey)

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

### Deprecated symbols

[`users`](/documentation/HomeKit/HMHome/users)

All users associated with the home.

[`-  addUserWithCompletionHandler:`](/documentation/HomeKit/HMHome/addUser(completionHandler:))

Adds a user to the home.

[`-  removeUser:completionHandler:`](/documentation/HomeKit/HMHome/removeUser(_:completionHandler:))

Removes a user from the home.

### Instance Properties

[`matterControllerID`](/documentation/HomeKit/HMHome/matterControllerID)

[`matterControllerXPCConnectBlock`](/documentation/HomeKit/HMHome/matterControllerXPCConnectBlock)

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)