--- id: homekit label: HomeKit Add-on title: HomeKit Add-on - System Integrations type: io description: "This is an add-on that exposes your openHAB system as a bridge over the HomeKit protocol." since: 2x install: auto --- {% include base.html %} # HomeKit Add-on This is an add-on that exposes your openHAB system as a bridge over the HomeKit protocol. Using this add-on, you will be able to control your openHAB system using Apple's Siri, or any of a number of HomeKit enabled iOS apps. In order to do so, you will need to make some configuration changes. HomeKit organizes your home into "accessories" that are made up of a number of "characteristics". Some accessory types require a specific set of characteristics. ## Global Configuration Your first step will be to create the homekit.cfg in your conf/services folder. At the very least, you will need to define a pin number for the bridge. This will be used in iOS when pairing. The pin code is in the form "###-##-###". Requirements beyond this are not clear, and Apple enforces limitations on eligible pins within iOS. At the very least, you cannot use repeating (111-11-111) or sequential (123-45-678) pin codes. If your home network is secure, a good starting point is the pin code used in most sample applications: 031-45-154. Other settings, such as using fahrenheit temperatures, customizing the thermostat heat/cool/auto modes, and specifying the interface to advertise the Homekit bridge on are also illustrated in the following sample: ``` org.openhab.homekit:port=9124 org.openhab.homekit:pin=031-45-154 org.openhab.homekit:useFahrenheitTemperature=true org.openhab.homekit:thermostatCoolMode=CoolOn org.openhab.homekit:thermostatHeatMode=HeatOn org.openhab.homekit:thermostatAutoMode=Auto org.openhab.homekit:thermostatOffMode=Off org.openhab.homekit:networkInterface=192.168.0.6 ``` ## Item Configuration After setting this global configuration, you will need to tag your openHAB items in order to map them to an ontology. For our purposes, you may consider HomeKit accessories to be of two forms: simple and complex. A simple accessory will be mapped to a single openHAB item (i.e. a Lighbulb is mapped to a Switch, Dimmer, or Color item). A complex accessory will be made up of multiple openHAB items (i.e. a Thermostat is composed of Heating and Cooling thresholds, a mode, and current temperature). Complex accessories require a tag on a Group indicating the accessory type, as well as tags on the items it composes. A full list of supported accessory types can be found in the table below.
tag | child tag | supported items | description |
Lighting | Switch, Dimmer, Color | A lightbulb, switchable, dimmable or rgb | |
Switchable | Switch, Dimmer, Color | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps | |
CurrentTemperature | Number | An accessory that provides a single read-only temperature value. The units default to celsius but can be overridden globally using the useFahrenheitTemperature global property | |
CurrentHumidity | Number | An accessory that provides a single read-only value indicating the relative humidity. | |
Thermostat | Group | A thermostat requires all child tags defined below | |
CurrentTemperature | Number | The current temperature, same as above | |
homekit:HeatingCoolingMode | String | Indicates the current mode of the device: OFF, AUTO, HEAT, COOL. The string's value must match those defined in the thermostat*Mode properties. This is a homekit-specific term and therefore the tags needs to be prefixed with "homekit:" | |
TargetTemperature | Number | A target temperature that will engage the thermostat's heating and cooling actions as necessary, depending on the heatingCoolingMode |