Using HomeKit For Notifications

This document describes how to use Apple HomeKit to control external devices from our apps.

HomeKit

HomeKit from Apple provides a protocol that developers can use to interface to hardware devices that are on a home automation network. There are many devices that can be connected to a HomeKit network. At this time, the AudioTools suite of apps has integrated light bulbs, for the purpose of providing auxiliary notifications of SPL levels. The following modules now support HomeKit, and more are planned for the future.

Compatible Hardware

Any accessory that is in the Light Bulb category and supports color changes through the hue category should work fine. We have successfully tested the Philips Hue brand bulbs and hub, using a "White and color ambiance bulb starter kit".

This kit consists of a hub that plugs into the WiFi router and 4 LED color bulbs.

Setting up HomeKit

Please see Apple documentation for setting up HomeKit. It is fairly simple, and requires only an Apple ID. In our test case, this only involved installing and turning on the 4 bulbs, and then plugging the hub into the router, downloading the Hue app, and following the setup instructions.

Once the Hue app finished its installation, we switched to the Apple Home app and were able to assign the bulbs to rooms and name them. Note that these are the same names that will appear in our app.

Make sure you have iCloud enabled, and HomeKit enabled for iCloud, in the iOS device settings.

NOTE: At this time Apple does not allow HomeKit accessories to be controlled while an app is in the background. For HomeKit control to work, the app must be running in the foreground and not be minimized.

Enabling Light Bulb Notifications

In the app, navigate to the Settings page, for the module in use, and tap the HomeKit button on the bottom of the screen.

The available light bulbs will appear in a list. Tap a light bulb to select it, and then tap the Add (+) button.

To remove a light bulb, select it, and then tap the Remove button.

The status of each bulb will be listed in the table. If its status is "Unreachable", please check your HomeKit setup.

There is an "On/Off" button that will control the selected light bulb in the list, to assist in identifying the light bulb and confirming communication.

Note that Dual SPL Traffic Light uses different lists for each traffic light. Make sure you don't assign the same bulb to both lists, to prevent confusing results.

Practical Considerations

HomeKit communicates over WiFi and/or Bluetooth, and depending on the system configuration and traffic levels, delays may be observed between the time that the app sends out a lighting command, until the time that the light bulb reacts.

This latency, and the fact that the screen updates for the app happen in a different timing loop than the HomeKit, can result in temporary mismatches between the app screen and the bulb. These are minimized when measurements are set to Slow or Leq mode, and in real world situations should not present a problem.

Future Development

We plan to continue our HomeKit integration with support for more modules and more devices in the future.