Enthusiasts Guide to HomeKit

Apple’s smart home platform has grown in maturity quite rapidly since it’s inception in 2014. There are now many new technologies included, and these have contributed to security, usability, and automation capabilities that have arguably outpaced other major platform efforts.

As with any software product, growing feature sets lead to growing complexity, and it can become harder for users to know how to get things done, or even what those capabilities are. We’ve compiled a library of guides that will delve into these features so you can get the details on the aspects you’re interested in.

We’ll cover some general info up front about the structure and workings of HomeKit, but check out the Main Features section if you want to dive right in because you’ll find a series of comprehensive articles on each tent pole feature that will explain how to get the most out of the platform.

What Is HomeKit?

HomeKit is a smart home automation platform developed and maintained by Apple. HomeKit was created as an answer to the growing problem of smart home fragmentation that was out of control by the mid 2010s.

Every device maker had their own app, and their own automation system, and nothing worked together easily. Some older efforts had attempted to resolve this through proprietary communication protocols such as Z-Wave, Insteon, and Zigbee, but only with limited success.

Apple’s approach was to leverage their already large device footprint to provide a standardized foundation with which smart devices (called Accessories) could be controlled. HomeKit enforced the use of the communication protocols already on their devices, Wi-Fi and Bluetooth, which were both ubiquitous global standards already.

This was coupled with a stringent security model and a new application layer called the HomeKit Accessory Protocol (HAP) that provided a clear standard language for all devices to talk to each other. HAP has been open sourced as part of Apple’s contribution to the new Matter IoT standard in conjunction with the newer Thread IoT communications protocol being made available on newer Apple devices.

This approach was similar to Z-Wave and ZigBee in that devices were given classes and attributes to make it clear what commands they could accept, and what data they could provide, but unlike the older competition HAP enforced these details much more rigidly ensuring complete interoperability.

The cost of this approach is that only device capabilities specifically allowed by HAP could be used, which limited the kinds of devices HomeKit users could employ. This has improved over time as Apple has added more classes and attributes but remains a limitation in some areas.

HomeKit History

2014 - HomeKit Announced with iOS8
2017 - Software based accessory authentication
2017 - Expansion of supported accessory types
2017 - HomePod bring ambient voice control
2018 - Apple joins Thread group
2019 - Siri Shorcuts usable in automations
2019 - HomeKit Secure Video added
2019 - HomeKit Secure Routers added
2020 - Thread protocol support arrives with HomePod Mini
2020 - Apple joins Connected Home over IP consortium
2021 - Home Key and local Siri processing added
2022 - HomeKit architecture updated to support Matter and larger device numbers

In addition to these major events, automation capabilities and user interface improvements have trickled out with each major iOS version. These include features like an auto-off timer for automations, the ability to set conditions for when triggers should happen, more controls over notifications, and improvements to how accessories can be controlled and displayed in the Home app.

How HomeKit Works

At it’s most basic level, HomeKit uses an Apple device, typically an iPhone as the basis of a HomeKit ‘Home’. Each Home is securely linked to a specific Apple ID and the configuration data for the home is encrypted and synchronized to iCloud.

Any Apple device logged in to the Apple ID is able to synchronize the Home data which provides IDs and security keys for each Accessory. That device can then send commands to those Accessories via the HAP. This creates a decentralized smart home in that any logged in user device will have control and visibility of the smart home, iCloud only provides a means to sync changes between devices and doesn’t act as a controlling hub.

This also means HomeKit provides complete local control and does not require an internet connection in order to receive status updates from accessories or send commands to them.

While the use of only end-user devices for control does work, it significantly limits HomeKit’s capabilities. This is because the device must be on the same network as the accessories in order to communicate, and many automated features can’t function. To get around this, certain Apple devices can act as a hub. These are devices that are always online and connected to the local network such as Apple TV and HomePod.

Having such a hub allows for automated rules to trigger reliably, video cameras to be able to record, and remote access to the smart home via iCloud with the hub acting as a secure gateway. The hub still retains local control and everything will function normally during an internet outage, apart from remote access and video recording.

Additional Apple IDs can be invited to the HomeKit Home, and this allows them to be given their own secure key to synchronize the home data from iCloud. Such additional users will have full control of Accessories, with the ability to limit their access to cameras, remote access and changes to the home configuration.

A diagram of the data connections between accessories, the home hub, personal client devices, and iCloud

HomeKit device communications

HomeKit Accessory Structure

There are a few terms that you’ll want to be familiar with when dealing with HomeKit accessories. These define the basic structure of a device in the HAP and are used by apps and other accessories to access the relevant data and actions of our devices.

Each accessory will have a define Category. This provides the basic definition of what the device does. This includes this like Light, Garage Door, Camera, or Sprinkler.

Each accessory will then have a number of Services that define the actions that device can perform. Within a service are also a number of Characteristics. These are values that can be queried from the device.

As a simple example, we’ll look at a light bulb.

  • Category: Lightbulb

  • Service: Lightbulb

  • Characteristics: Power State, Brightness, Hue, Saturation

Any Accessory can contain multiple services, which is how some physical devices present multiple accessories in the Apple Home app. This could be a Garage door opener with a light, two power outlets in a multi-outlet socket, or temperature, humidity and air quality sensors in a single room sensor.

Each of those services can also have additional characteristics added by the device maker beyond the basic ones defined for that service. These are often used for holding additional custom data such as the current power consumption for a smart outlet, or the state of extra functions that device has that aren’t supported natively by the device category.

Discovery of accessories

Service Discovery is the method by which devices on your network are able to find each other and understand how to access the HomeKit functions that are available. HomeKit uses Apple’s Bonjour service for zero configuration service discovery, which in turn uses multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) to publish and broadcast these services.

Normally DNS would require a DNS server to host and resolve name records, but by using mDNS this can be done totally on the local network, specifically using the <name>.local hostname. By using a standard known multicast address, all devices know where to send queries for names and where to listen for those queries so they can answer if it’s for them.

The multicast address for mDNS is defined in RFC 6762 as 224.0.0.251 for IPv4. By sending a query for a given service name, a device is able to find all available instances of that service - A HomeKit accessory, for instance. For HomeKit specifically, the service name used in this process is called _hap._tcp which tells other clients on the network that a HomeKit interface is available on that device.

The service record contains relevant information such as the IP addresses and port number to use for contacting the service on that device, as well as other information such as model name, MAC address, version numbers and so forth. These values vary depending on the service being queried. The _hap._tcp service will be present on any HomeKit accessory, that is, any device that provides a native HomeKit interface.

This does not include home hubs, except in the case where they provide a characteristic that can be queried. The Home Pod Mini is such an example as it has temperature and humidity sensors exposed to HomeKit, so these are advertised under the HAP service. What you will also see on newer home hub devices with Thread is the _meshcop._udp service. This indicates the device is able to act as a Thread Border Router.

You can see the DNS-SD advertisements on your network using the free iOS apps Discovery or Flame. These tools can provide an extra troubleshooting step when dealing with unresponsive devices as it provides a way of seeing if they are advertising correctly on the network.

What about Matter devices?

Matter has a lot of similarities with HomeKit and service discovery is one of them. Like HomeKit, Matter supports Bluetooth, Wi-Fi, and Thread, and uses DNS-SD over mDNS for discovery. With the inclusion of Matter support there are some new DNS-SD service in play that may be of interest. There are two to look out for:

_matterc._udp is used be new devices advertising that they are available on the network for commissioning (pairing).

_matter._tcp is used by commissioned Matter devices for operational service discovery in the same way as native HomeKit accessories.

The problem we have with these service advertisements is the way Matter identifies nodes. Where HAP uses the device name in an easily identifiable way such as LIFX Beam 338FC, Matter uses the Fabric ID and Node ID as the name in the service record. This will look something like 2906C908D115D362-8FC7772401CD0696. This makes them very difficult to link back to an actual device. If there is an IPv4 address in the record we can link it that way, but for Thread devices, only an IPv6 address will be present.

HomeKit Features

HomeKit Automation Features

The automation rules that can be created in the official Home app afford a good base for many smart homes but fall short in allowing truly smart automation. HomeKit actually offers a lot more than the Home app exposes, and this guide goes into how to get the most out of your automation journey. Our other advanced automation guides provide further options to get more out of HomeKit:

HomeKit Home Hubs

Home hubs are officially option, but in any serious HomeKit home they are essential. This guide goes into what they do, why, and how to set one up.

HomeKit Secure Routers

IoT devices are notoriously prone to being hacked or allowing unwanted access to your home network. While HomeKit mandates end to end encryption and authentication, this feature goes further by enabling tight firewall control over what your accessories can access inside and outside your network.

HomeKit Secure Video

Smart security cameras are an easy and convenient way to get oversight of what’s going on at home, but they often use third party clouds to record video with no way to know if those videos are secure. This feature ensures all your videos are processed and encrypted locally before they ever leave your network.

Home Key

A convenience feature that works with compatible smart locks to enable quick unlocking by simply tapping your iPhone to the lock. This uses the iPhone’s NFC feature and works similarly to using Apple Pay in a store. Home Key improves the speed and reliability of using smart locks by dispensing with the slower Bluetooth methods used by most existing products.

Siri Configuration Options

There are now more options to configure how Siri sounds and how it interprets what you say. This guide covers the options available and the steps to use them correctly.

Voice control using Siri

Understand the various naming contexts in HomeKit and how you can best use them to make Siri voice control clear and effective.

Extending HomeKit beyond official accessories

Official HomeKit accessories are often best in class, but also expensive. This is due to the need for Apple certification on both counts. Sometimes we just want to use something we already have, or we need a product that no one has bothered to certify for HomeKit yet. This guide shows you how to create an interface for many non-HomeKit devices.

HomeKit Groups and Zones

See how these two different abstract groupings allow you to customize your HomeKit voice command experience. These features provide a great deal of flexibility in configuring your smart home so that you can control logical groups of devices with a single command when necessary.

HomeKit Notifications

Being able to configure meaningful alerts when things happen that you should know about is a valuable aspect of any smart home. Apple provides notification capabilities for a variety of accessory types, see what is available and what the limitations area. If you want to get more creative than the Home app allows, there are third-party tools that can help make your notifications more useful.

Supported Accessory Types

HomeKit now supports a much wider array of device types, with the more recent additions being Thermostats, Routers, TVs, Cameras, Faucets, and Sprinklers.

Each accessory type includes the ability to use a variety of attributes to determine the data that accessory can show. While this is more focused around sensors it is also important for device state information. For example, Thermostats can show the current and target temperature, whether it’s heating, cooling, or off, and may include humidity sensors as well.

The controls that are available are also determined by class, but not all controls need to be available on a given accessory. Following the Air Conditioner example you will have a temperature control, but you may optionally have one for fan speed, and oscillation.

The accessory classes currently supported are:

.A grid of icons representing each of the supported accessory types in HomeKit

List of HomeKit Integration Resources

Frequently Asked Questions

What can I do with HomeKit?

HomeKit allows you to control smart devices with your smartphone, through your Apple TV, with Siri voice commands, and to set up automation rules that allow your smart devices to react intelligently to what’s going on in the home. You can also use HomeKit to keep an eye on a wide variety of home status information, depending on the accessories you have. This includes things like viewing camera feeds, seeing the temperature, humidity and air quality in various rooms, checking if doors or windows are open, and seeing if any motion has been detected in different areas, to name a few.

Do HomeKit devices need to be on the same Network?

For HomeKit to work all hubs and accessories need to be on the same home network. If you have a Home Hub your client apps will be able to control the home and check on status data from anywhere with an internet connection, and you’ll get any notifications you’ve configured as well.

What is the best way to use HomeKit?

The best way to use of HomeKit is with a Home Hub. This can be a HomePod or an Apple TV device. iPads are supported too but are not recommended as the primary hub, and this support will likely go away now that the HomePod Mini provides a much more cost-effective alternative.

What apps work with HomeKit?

HomeKit uses a publicly available API which allows app developers to access most HomeKit functions. The official Apple Home app, along with a range of third-party apps such as Controller, Home+, Eve, and HomeDash can be used as clients to control your smart home. There are also many other third-party apps with more specific focuses that can utilize HomeKit data.

Does HomeKit work when the internet is down?

HomeKit sends commands from your iPhone or a Home Hub directly to the target smart devices over the local network, so it will continue to work normally when the internet is down. The only things you lose are Siri voice commands (which need Apple’s servers), and remote access.

How does HomeKit know when I am home?

HomeKit uses the geolocation of each member of the home as determined by their personal devices, either an iPhone or Apple Watch, to know who is at home. ‘Home’ is considered being within a fixed distance of the home’s specified address in the Home app. The distance is not configurable and is about 100ft/30m.

Conclusion

If you’re looking for a smart home platform that offers local control, capable automation rules, strong security and privacy protections, and ease of use, it’s hard to go past HomeKit. The key blocker for some will be the need to embed yourself in Apple’s device ecosystem as HomeKit only runs on Apple devices and requires iCloud for configuration management.

HomeKit is tightly integrated into that ecosystem, which is a real benefit for Apple users, and makes it even more compelling to adopt it as your main smart home platform. The cost of accessories can be high to ensure quality and security, however, cheaper devices can be easily integrated by those willing to go a little further down the rabbit hole.

Apple is continuing to focus on HomeKit development, with more new hires being sought for the team. That’s encouraging for the future of the platform and Apple’s commitment to see it grow.

David Mead

David Mead is an IT infrastructure professional with over 20 years of experience across a wide range of hardware and software solutions. David holds numerous IT certifications and has dedicated himself to helping others with technology throughout his career.

Previous
Previous

Enthusiasts Guide to Thread

Next
Next

5GHz Smart Plug? These models support faster Wi-Fi, but do you need it?