What’s New in HomeKit 

Session 710 WWDC 2016

Learn what’s new with HomeKit in iOS 10 including support for new types of accessories such as cameras and doorbells, enhancements in remotely connecting with accessories, how set up of Wi-Fi HomeKit accessories has been greatly improved, and how to write HomeKit enabled tvOS Apps.

[ Music ]

[ Applause ]

Hello, everyone.

Thank you for coming.

Welcome. My name is Dennis Matthews, and I’m part of the HomeKit engineering team here at Apple.

So before we get started with what’s new in HomeKit, we’ll spend the first couple of minutes and talk about HomeKit, and I want to highlight some of the key features of what makes HomeKit.

HomeKit is a framework which provides a rich set of API’s that allow your applications to talk to different classes of HomeKit enabled accessories.

Your applications can use the same API’s to talk with accessories from different manufacturers.

HomeKit maintains the user’s home data in a common database.

Now this is great because all applications in the system have access to this exact same home data and configuration of the user’s home.

And if the user has multiple devices, all of them signed in to the same iCloud account, HomeKit takes care of synchronizing this home data over to the different devices that the user may have.

Now this is great because without any additional set up on the user’s part, the user can just pick up any of their devices and start communicating with the HomeKit accessories.

HomeKit also supports for sharing of a user’s home.

So a user can share their home and allow their family and friends also to control the accessories that the user has set up in their home.

Sharing is very simple.

All that a user has to do is invite additional users using their iCloud account, and once the user accepts the invitation, HomeKit automatically takes care of sharing the home data across to additional devices as well as configuring all the accessories in the home so that now the shared users can have access and control these accessories.

The owner, of course, can also revoke this control at any point in time.

HomeKit supports a common protocol for all the accessories to securely communicate with the Apple device.

So all HomeKit accessories, irrespective of their underlying medium of communication, use the same common protocol.

Now all this protocol Apple has also defined a rich set of profiles which describe many of the common accessories.

Now with this profiles, Siri support is built in.

This is great and it provides a very natural way for users to communicate and control their accessories just using Siri.

When the user is at home, communication between their Apple device and their HomeKit enabled accessories is direct.

So all that a user need is their HomeKit enabled accessories and their Apple device to talk to their accessories.

This communication is either using Wi-Fi or Bluetooth low energy.

When the user is away from their home, remote access to their accessories at home is provided via the Apple TV, which acts as a remote access gateway.

And Apple TV then securely channels the communication between the user’s device and their accessories, which are at home.

Security. We have built HomeKit with security in mind right from day one.

All HomeKit communications are end-to-end secure.

What this means is the keys that are used to secure this communication reside only on the user’s devices.

So even if the communication flows through intermediate devices or services, they cannot be decrypted.

Not even by Apple.

HomeKit provides for what’s known in the industry as perfect forward secrecy.

What this means is every communication session between an Apple user’s device and their HomeKit enabled accessory, user’s new session keys which are generated just for that session, and after the session is completed, these keys are then discarded.

Now this is great because even if in the future any of the device is compromised and a long-term key is compromised, that then cannot be used to decrypt any communication that would have happened in the past.

Home data is private.

We take care of privacy in our API’s as well as applications have to explicitly ask user’s permission to get access to their home data.

HomeKit supports a variety of accessories.

Working with our accessory partners, we have a variety of accessories in the market today, and many of our partners are bringing new and exciting classes of accessories to the HomeKit ecosystem.

So that was a very high-level overview of HomeKit.

With that background, let’s get started with what’s new in HomeKit.

So we’re going to cover three major areas.

First, platform.

We are expanding HomeKit capabilities through Apple’s platform for iOS, watchOS, and tvOS.

We are introducing support for new and exciting classes of accessories in this release.

And all this new functionality as well as several enhancements are available to your applications via updates to the framework, and we will cover the details there.

First, on platform, we are really thrilled to deliver an Apple app for HomeKit this year.

The home app provides a very simple interface for users to control their accessories as well as configure their accessories in their home.

It also enables users to set up automations that they have in their home.

Home app is supported on all iOS devices, iPod Touch, iPhone, looks beautiful on an iPad, and, yes, with watchOS 3, home app is also supported on the Apple Watch.

We think this is going to be a great experience for our users.

Not only that, we are also integrating HomeKit deep into the system.

Now HomeKit is also available directly on the control center.

So the user can configure their favorite accessories and can have control of the accessories as well as control to [inaudible] directly from the control center.

Second on platform is remote access and automation.

With tvOS 10, we are extending the cable, capabilities on the Apple TV so that in addition to remote access, now the Apple TV runs all the automations that the user has set up for their home.

[ Applause ]

Yeah, that’s great because now no matter where the user is, the virtual part of the world, they can be rest assured that all the automations now run from their Apple TV at their homes.

Apple TV also enables for additional controls for shared users.

Now it is also possible now to grant administrative access to a shared user.

So a shared user with an administrative access can change configurations in the home.

So they can add or remove accessories in the home, or they, in turn, can also invite additional users to the home and give them control of the accessories at home.

Now it is also possible to control per user remote access.

So it is possible to grant or deny remote access capabilities to your accessories at home using this functionality.

It’s the same set of functionality is now also supported by the iPad.

Not only that, if the user has multiple of these remote access capability devices in their home, like in this example, an Apple TV and an iPad or any combination of these devices, they will automatically work together and extend the HomeKit network within the home.

And to communicate with the accessories, they will automatically select the part to communicate.

No additional configuration from the user’s part.

This is all just automatic from HomeKit.

Third update on platform is on tvOS 10.

We are thrilled to bring the HomeKit framework to the tvOS.

[ Applause ]

Now with the HomeKit framework on the tvOS, your applications can view home configurations, control the accessories in the home as well as execute scenes directly from the Apple TV.

This also means that now Siri is available for HomeKit on the Apple TV.

[ Applause ]

So directly from your convenience of your Siri remote, you can control your HomeKit accessories at home.

So those were the major updates on the platform front.

Let’s just quickly recap.

First, home app.

An Apple-designed app for HomeKit that makes setting up of accessories as well as controlling common functions of the accessories very easy.

Second, remote access and automation.

We’re extending the capabilities provided by the Apple TV so that it now runs automation, and it also enables additional controls for shared users.

And the same capability is now also extended to the iPad.

And, third, on tvOS, we’re bringing the HomeKit framework.

So we are really thrilled to bring these capabilities to the platform.

The second area we will cover is new accessories.

First on new accessories, we are introducing popular class of air treatment accessories to HomeKit this year.

So now HomeKit can support air conditioners and heaters, air purifiers as well as humidifiers.

This is great because our users can now have these accessories which are also HomeKit enabled part of their HomeKit ecosystem in their home and add it to their automations and other things.

Next, we are really thrilled to bring, to bring a powerful class of camera accessories to HomeKit this year.

[ Applause ]

Now with camera accessories, your applications can display live video streams from the camera.

Display take and display still images from the camera.

Control all the settings on the camera as well as control the speaker and microphone settings.

Third, doorbells.

Now doorbell is a very simple accessory.

It generates and events once the doorbell is pressed.

Also the doorbell has control where it can control the volume settings of the doorbell chime, and also if the doorbell has a visual indicator settings, those can also be controlled by the doorbell accessory.

Now doorbells we are seeing are also integrated with other kinds of accessories.

So doorbell camera is popular category.

Now this configuration is also supported by HomeKit.

Not only are these powerful accessories supported by HomeKit, we are also tightly integrating the experience into the system.

So now, for example, if you have a doorbell, a door lock, and a camera which are all configured by the user to be part of a room, maybe the user called the room an entryway, HomeKit will automatically associate services from these different accessories, and they can provide contact-sensitive controls to the user.

This enables for some magical experiences like rich notifications.

So, for example, now here, when the doorbell rings, HomeKit will automatically take a snapshot from the camera, and the user is presented with a rich notification.

Also, there are controls directly on the notification where the user can press, touch on the intercom and start an audio session with the camera, or if the user so chooses, unlock the door, and the notification displays live video streaming from the camera.

And, yes, the same functionality is also available on the Apple Watch.

And, yes, touching on the, on the picture there will start a live video stream from your HomeKit camera to your Apple Watch.

And, yeah, you can unlock your door, if you so choose, directly from the Apple Watch.

Next, let’s look at the updates to the HomeKit framework.

So we’ll start off first with a, with few simple but very powerful enhancements that we have added to the framework that gives more context about the accessory to your applications.

First up is primary service.

Now this is an example of an accessory which has two services – a fan service and a light service.

So this is what your application today gets.

Now just by looking at these services, it is not clear what the user perceives this accessory as.

Is this a light with an exhaust fan, or is this a fan which also has a light?

Now, with update to the HomeKit protocol, the accessory can mark its primary service, and this is available back to your application using the isPrimaryService property on the HMService class.

Now this will be great for you because now you can show content-sensitive controls about the accessory to your users.

Second example is on linked services.

Here’s another example where an accessory has three outlet services and a switch service.

Now, again, by just looking at these services, it is not clear what the switch controls.

Does the switch control one of the outlet or any other combination of these outlets?

When a user looks at the accessory, it is clear that that switch controls all the three outlets.

Now with linked services, services can link with each other and communicate back their relationship to HomeKit, and this is available back to you.

So in this case, the switch is linking to these three outlets communicating a logical relationship that the switch has in controlling these three outlets.

So now for your users, when they, when they are looking at your UI, which is showing the outlet, you can now additionally show the state of the outlet, whether it is powered on or off based on the fact that it is linked to, from a switch.

Third is valid values.

To explain valid values, let’s take an example where we want to build an accessory.

Let’s say we’re building an air conditioner accessory, and as we’re building this accessory, we want to incorporate the Apple-defined characteristics for this accessory.

So we will pick a target and cooling state for our accessory.

So this is how it is defined in the specification.

Now the air conditioner that we are building doesn’t support, let’s say, heating.

So the heat and the auto state here is not valid for my configuration.

Now it is possible for accessories to mark enumerations in Apple-defined characteristics which are not valid for its configuration.

So in this case, the accessory marks the heat and auto as not supported, and this information is then, again, available back to your applications through the HMCharacteristicMetadata valid values property.

Now you can show controls that are only valid to that particular configuration of the accessory.

Next, setting up of HomeKit accessories.

Today, to set up a HomeKit accessories, which is probably the first step that your user will do, involves a few different steps.

First, you will start browsing for the accessories, and once a new accessory is found, which is already part of your Wi-Fi network, or if it is a Bluetooth accessory, which is in range, this is informed back to you via the accessory browser’s didFindNewAccessory delegate callback.

And once you have that accessory, you can then call the add accessory method on HMHome to start adding this accessory to the home.

But for Wi-Fi accessories that are not already part of the user’s Wi-Fi home network, you need to do some additional steps to get these accessories added and configured into the user’s Wi-Fi network.

You do that today using the [inaudible] framework.

So there are some additional steps required for that.

We thought we can do better.

So now in iOS 10, we have one simple API, add and set up accessories that completely takes care of all the steps that are required to configure the accessory and add it to the user’s home.

So on calling this method, addAndSetupAccessories, the user is guided directly using this UI to select the accessory.

So in this case here, it’s showing all the configured as well as accessory, new accessories that are part of the Wi-Fi network.

The user can select the accessories they want to add, and once it is selected, if it was not already part of the user’s Wi-Fi network, it is added to the user’s Wi-Fi network securely.

Then the HomeKit scan code is scanned, and HomeKit pairing is performed on the accessory, and then the user is prompted to name the accessory, select a room for the accessory.

And also in this case, since it’s an outlet which is generally kind of an accessory, the user is also prompt to associate what kind of accessory is connected to this outlet.

So in our example here, this outlet, let’s say, is being connected to a fan.

So we select the fan as the associated service for this accessory, and, finally, the user can also choose to show this accessory as part of their favorites, and using, doing that enables this accessory to appear as part of their control center controls.

So that’s it.

Just one simple API, and user is guided through this complete set up flow.

And now all applications then will also have this consistent experience.

We think this is going to be great for our users, and we really encourage all of you to start using this API.

[ Applause ]

Next, let’s talk about camera accessories.

So a camera is a rich and complex accessories.

It has many different controls and configurations.

So rather than exposing all the raw services and characteristics to your app, we are providing a very easy way for you to take advantage of this powerful accessory with cameraProfile objects.

A profile is nothing but a collection of related services that describe a general behavior for an accessory.

So cameraProfile objects provides you all the interfaces that is needed for you to control the camera accessories.

So on an accessory, you can get to the cameraProfile from the cameraProfile property on the HM accessory.

An accessory can support multiple cameras, and those are all supported by HomeKit.

So it will be one of the elements in this cameraProfile array.

Let’s look at what a cameraProfile provides.

A cameraProfile provides additional interfaces that allow you to control different aspects of the camera.

So you can display and control the camera stream, which is both the audio and video stream from the camera; display, take and display still images from the camera; control all the settings on the camera as well as control the speaker and microphone settings on the camera.

Let’s look at the HMCameraProfileClass that provides these interfaces.

First is stream control.

Let’s look at HMStreamControl.

So HMStreamControl provides some few simple methods that allow you to start and stop streams directly from the camera.

So you call the startStream method on the HMCameraStream to start a live stream from the camera.

Once the stream starts, it is informed back to you using the StreamControl delegate callback.

So once a stream starts, the camera stream control didStartStream informs you back that the stream has started.

Similarly, to stop the stream, you call the stopStream method, and, again, using the same mechanism it is informed back to you via the camera stream control didStopStream with error delegate callback.

Once the stream is started, your application has a reference to the stream using via the cameraStream property.

Let’s look at what the cameraStream looks like.

The cameraStream represents both the audio and the video parts of the stream.

So on the cameraStream class, you have additional controls whereby you can control the audio settings from the camera stream.

So using this, you can either mute the stream or fully allow incoming audio or allow bidirectional audio from the camera.

Now that you have a stream, what do you want to do with it?

Well, you would like to display it in your app.

How do you do that?

It’s simple.

On iOS 10 and tvOS 10, all that you need to do is create a HMCameraView.

And to the view and on the view we have a single property, the camera source, and you need to just assign the stream that you just got when you started the stream to this property.

That’s it.

All that is needed for your app to show live stream from the camera.

It’s very similar on watch OS.

You just create an HM WKInterface camera and call the setCameraSource method to show live stream directly on your Apple Watch.

So those were a few different objects for you to look to control your camera accessory, but in reality, it’s pretty simple.

Let’s look at an example call.

So first we get to our cameraProfile on our accessory, and in this case, we’re just picking the first cameraProfile that is there, and on the cameraProfile’s stream.Control, we call the startStream method which will start a camera stream.

And to display our stream, we’ll create a HMCameraView, and once our stream is started, it’s informed back via this delegate callback cameraStreamControl didStartStream, and all that we need to do here is assign the camera stream to the camera source property on the view.

That’s it.

Now your view in your application is showing live stream from the camera.

Next, let’s look at snapshotControl.

Snapshot control interfaces are also very similar to what we saw with streamControl.

So for snapshotControl we have one method, takeSnapshot, which once a snapshot is taken informed back to you via the cameraSnapshotControl didTake snapshot method callback.

And the most recent snapshot reference is available to you in this most recent snapshot property.

Let’s look at the SnapshotControl.

The SnapshotControl has just one additional thing which will show you the capture date of when this snapshot was captured.

It has both the time and date.

And, again, similarly, to display your snapshot into a view, all that you need to do is create a view and assign it to this snapshot.

So here’s an example to take and display a snapshot from the camera.

It’s very similar, core structure is very similar.

First we get to our cameraProfile.

On this cameraProfile’s snapshotControl, we call the takeSnapshot method.

We create a view to display our snapshot, and once a delegate is called back, it comes back with a reference of our snapshot.

We just take that and assign it to the camera’s source property on our view.

That’s it.

That’s all you need to show the snapshot from the camera.

Next, let’s look at settingControls.

So settingControl gives you HM characteristics which allow you to control all the settings that are supported by the camera.

So you have interfaces to control night vision, tilt, zoom, rotation, and mirroring on the camera.

So if the cameraSupport does not support any one of this, then that property will be nil.

Otherwise, you have full access to control all the settings of this camera from your app.

Last, we’ll look at camera audio control, which allows you to control both the speaker and microphone settings on the camera.

Again, these are also HM characteristic which will allow you to change the mute settings on the microphone, change the mute settings of the speaker, control the gain on the microphone, or control the speaker volume.

So those are all the key API’s that is available for you to take advantage of this powerful accessory.

So let’s summarize.

We covered three major areas.

First, platform.

We’re bringing the home app, an Apple-designed app for HomeKit.

For remote access and automation.

We’re extending the capabilities of the Apple TV as well as adding iPad to have the remote access and automation capability for users’ home.

We’re bringing HomeKit to the tvOS framework.

Next area on accessories, we’re adding the popular class of air treatment accessories.

We’re adding powerful camera accessories to the HomeKit ecosystem.

And we’re also adding doorbells and combination accessories, which are doorbell cameras.

On the framework updates, we covered simple but powerful capabilities that allow you to get more context about your accessory in your app.

So you can show rich and context-sensitive UI to your users.

We have greatly simplified the accessory setup flow.

Now with just one API call, all apps get the consistent experience of guiding the user through the complete setup for, for their HomeKit accessories.

And we introduced cam, camera profile objects that allow your applications to take advantage of this powerful class of accessories.

Now before I conclude, I want to leave you with this thought.

HomeKit accessories and your applications are changing the way that our users interact with their homes.

With system features like Siri, automations, and notifications, also combined with the rich set of accessibility features on Apple platforms like voiceover and others, these accessories are, for the very first time, becoming accessible to users with various kinds of disabilities.

This is powerful, and it is a life-changing experience for many of our users.

So I encourage you to check out all these different capabilities that are available to you on Apple platforms, and take full advantage and make your accessories and applications accessible to everyone.

For our MFi program members, a preview of the updated specifications will become available to you soon, and for new accessory manufacturers who’d like to join the program, this URL gives you more information, or please come and talk to one of us.

More information about this session as well as HomeKit and references are available via this URL.

These are some related sessions I’ll encourage you to watch on video if you have missed them.

The first one is really inspiring.

Thank you very much.

Have a great conference.

[ Applause ]

Apple, Inc. AAPL
1 Infinite Loop Cupertino CA 95014 US