Framework

HomeKit

Communicate with, configure, and control home automation accessories.

Overview

HomeKit enables your app to coordinate and control home automation accessories from multiple vendors to present a coherent, user-focused interface.

Diagram showing an iOS device wirelessly interacting with devices in the home automation network.

Using HomeKit, your app can:

  • Discover HomeKit-compatible automation accessories and add them to a persistent, cross-device home configuration database.

  • Display, edit, and act upon the data in the home configuration database.

  • Communicate with configured accessories and services to get them to perform actions, like turning on the lights in the living room.

Topics

Essentials

Enabling HomeKit in Your App

Declare your app’s intention to use HomeKit, and get permission from the user to access home automation accessories.

HomeKit Entitlement

A Boolean value that indicates whether users of the app may manage HomeKit-compatible accessories.

Key: com.apple.developer.homekit
property list key NSHomeKitUsageDescription

A message that tells the user why the app is requesting access to the user’s HomeKit configuration data.

Name: Privacy - HomeKit Usage Description

The Home Manager

Configuring a Home Automation Device

Give users a familiar experience when they manage HomeKit accessories.

Testing Your App with the HomeKit Accessory Simulator

Install the HomeKit Accessory Simulator to help you debug your HomeKit-enabled app.

class HMHomeManager

The manager for a collection of one or more of a user’s homes.

Accessories

Interacting with a Home Automation Network

Find all the automation accessories in the primary home and control their state.

class HMAccessory

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

class HMService

A controllable feature of an accessory, like a light attached to a garage door opener.

class HMCharacteristic

A specific characteristic of a service, like the brightness of a dimmable light, or its color temperature.

Action Sets

class HMActionSet

A collection of actions that you trigger as a group.

class HMTimerTrigger

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

class HMEventTrigger

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

Errors

struct HMError

An error returned from HomeKit.