[self writeBlog];

ESP8266 Special: Apple's HomeKit is now for everyone!

Two weeks ago Apple held it’s annual WWDC keynote announcing the latest updates to their platforms and technologies. The keynote lasted over 2 hours and you might would think that in that much time they have touched at least all technologies on the surface, but one thing especially seemed to have been missing almost entirely. HomeKit!

While Apple seemed to have not shown too much love to that topic during their Keynote, it seems as if they still have given that technology quite some thought leading up to WWDC as Apple quietly made quite a few changes.

Most notably Apple opened up their HomeKit specs outside their MFi (Made for iPhone) program. If you’re a registered developer with Apple you won’t have to Google the specs anymore and rely on 3rd party info about HomeKit.

Next in line are their changes to HomeKit’s requirements. Up until this point you had to have Apple’s Co-Processor á ka security chip installed in your HomeKit hardware to be able to produce HomeKit enabled hardware. They also dropped this, essentially removing licensing fees when releasing HomeKit hardware and making the process easier. Authentication that was done with Apple’s coprocessor can now be done via software authentication. You would still have to go through the MFi program if you intend to sell and publish HomeKit soft-/hardware but you would no longer have to buy Apple’s coprocess and pay licensing fees for those.

Personally, I value these two changes the most and think they’ll have a great impact in the availability of HomeKit enabled devices in the future.

Apart from that, Apple introduced changes to the featureset of their HomeKit platform, adding two new product categories (sprinklers and faucets), enhancements to the sunrise and sunset scenarios and adding temperature triggers.

This all might seem like basic stuff that doesn’t change much for us developers but it shows that Apple is aware of the huge IoT market and it’s potential.

To show off what this could potentially mean, let me bring back my ESP8266 based weather station that I introduce in my latest blog post installment here, part II and part III.

Let’s say we wanted to sell this weather station as a real product. After all, hardware costs are very minimal and the software is top notch, but we would want to add HomeKit support so Siri could pick up the temperature from our Weather Station when asked. If we wanted to do this before Apple’s HomeKit changes we would have had to apply for their MFi program, acquire Apple’s co-processors and after we would have done all that the biggest hurdle would have been to pay licensing to Apple which would have probably killed our product.

Now with these changes we could simply prototype HomeKit support ourselves. A good point to start off would be this GitHub project that we could connect to our MQTT server we’ve setup before, add a config for our weather station by creating a homekit2mqtt.json file with the following contents:

{
	"TemperatureSensor": {
		"service": "TemperatureSensor",
		"name": "TemperatureSensor",
		"topic": {
			"statusTemperature": "weather/temperature"
		},
		"manufacturer": "Generic",
		"model": "TemperatureSensor"
	}
}

Now all we have to do is to run the homekit2mqtt bridge and we can start to use our weather station with HomeKit.

If our server runs and the connection can be made, we can start to add accessory in HomeKit:

HomeKit Pair MQTT Bridge

The accessory is configured by default to be behind a bridge. Next is the actual temperature sensor:

HomeKit Pair Temperature Sensor

Once we’ve added that, our temperature sensor should show up in our accessory list:

HomeKit Showing Temperature Sensor

And we can ask Siri for the temperature in the room we’ve assigned the sensor to:

HomeKit Siri Query

HomeKit integration was that easy and if we really would plan to sell our weather station including HomeKit integration we could start to implement HomeKit without the homekit2mqtt bridge according to the HomeKit Specification that Apple released and start the MFi process afterwards.

Apple really did a great thing here making HomeKit integration easier! I’m excited to see more equipment integrating with HomeKit soon!