The primary unit of living space, typically composed of rooms organized into zones.
SDKs
- iOS 8.0+
- tvOS 10.0+
- watchOS 2.0+
Framework
- Home
Kit
Declaration
class HMHome : NSObject
Overview
An 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
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 add
method with a name that the user supplies. To get a list of existing home instances, use the homes
array of the home manager (an instance of HMHome
).
Because HomeKit gives your app access to a shared database of home automation information, other apps can change the home’s configuration. Adopt the HMHome
protocol in your app to stay informed of any such changes that happen outside your app.