home-kit

HomeKit (Siri + Home App) And OpenHAB 2
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to connect Home Kit to your OpenHAB 2 System.
 
I love using home kit and think it is an awesome way to control your smart devices, especially with favorites where you can turn stuff on from control center. You can also use siri to control your home kit devices. In this video we will be connecting Home Kit to our openhab 2 system so we can control our openhab items. The only thing we are going to need for this video is a computer and your iOS device. For this guide I am going to assume you have the home app on your phone and have not deleted it. I am also going to assume that you have an items file. If you do not then go take a look at my video where I explain how to setup the configuration files in openHAB. I will not be making two seperate videos using Mac and PC because the process is really similar the only difference is that on mac you use Terminal to ssh and on PC you use putty.
 
The first thing we have to do is ssh into the OpenHAB Server.
 
I recommend having my website guide open when you do this so that way you can just copy and paste commands.
 
Now type in sudo nano /etc/openhab2/items/home.items and press enter.
Now we are going to add the tags that Home Kit supports to the items.
 
If you have seen my video where I connect the Amazon Echo to OpenHAB 2 then you will notice the tags are the same.
 
The tags go right before the bindingconfig.
 
Home Kit supports the following tags.
 
[ “Switchable” ] This tag is used with the Switch item type, Dimmer item type, and Color item type but you would not use this for a light that is what the next one is for.
[ “Lighting” ] This tag is used for lights with the Switch item type, Dimmer item type, and the Color item type.
 
[ “CurrentTemperature” ] This tag would be used with a device that reports temperature and has the Number item type.
 
[ “Thermostat” ] This tag is used with an item that has a Group item type and has the following devices in the Group
[ “CurrentTemperature” ]
[ “TargetTemperature” ]
[ “homekit:HeatingCooling” ]
 
I personally do not use the tags associated with the Thermostat and have never used them but if you want more information on them then check it out the openHAB Docs, link is on my website, which is in the description.
 
I just use the Lighting and the Switchable one, in the future we may be using the Current Temperature one. Alright let's take a look at my items file because I have already put in the tags. As you can see I put the Switchable tag next to the items that are the Switch item type but are not lights. I also put the switchable tag into the GarageDoorShutterDummy items because they are of the Rollershutter item type. But I did this for the amazon echo because the amazon echo supports rollershutters and home kit does not, if you do put the tag then you will only see an ON OFF switch in the Home App. You can also see I used the Lighting tag for the two light switches. If you guys have any questions on these tags leave them in the comments because chances are someone else probably has it too.
 
Anyway once all your tags are in place, press control x then y and enter to save.
 
Great! The items are now ready, so the next thing we are going to do is setup the Home Kit Binding.
 
First go to your web user interface and click on paper Ui.
Then click on addons in the left column.
After that click services.
In the top navigation click on MISC.
Then Click install next to where it says HomeKit Integration.
 
If it does not automatically say installed then wait a little and press refresh in your browser.
Anyway once it installs click on configuration in the left column and then services.
Next click the configure button in the Home Kit Integration box. 
 
Now we are going to configure the Home Kit Binding.
 
In the port field type in 9124
In the Pin field type in 031-45-154
Next decide whether you want fahrenheit for temperatures, if you do then turn on the switch.
In the Thermostat Cool Mode field type in CoolOn
In the Thermostat Heat Mode field type in HeatOn
In the Thermostat Auto Mode field type in AutoOn
In the Thermostat Off Mode field type in Off
In the network interface field type in the ip address of your openhab server.
Once all those are typed in, click save.
 
The Home Kit Binding is now configured! Now all we have to do is connect openHAB to our home app.
 
 So grab your mobile device that already has the Home app installed and open the app.
First on the message click get started.
Then Click add accessory.
After that click on the OpenHAB accessory.
It will warn you that is not certified, click add anyway.
It will then bring up the camera to scan a code, instead click enter code manually.
Type in 031-45-154.
It should say something like successfully added and let you configure it.
Name the OpenHAB accessory whatever you want, I will have mine as OpenHAB.
Then choose a location for it. I will keep mine in default room.
Then choose if you want to include in favorites, I will not.
After that click next in the top right.
It will automatically go through the items in your items file that you added the tags to and ask you the same thing as the openhab accessory so go through it change the settings if you would like and keep clicking next. I don't want to change anything so I will just keep clicking the next button.
Once you finish with the last item it should bring you back to the home app home screen and should see a couple items, the rest are in rooms tab. That is it the items are added to Home Kit and the Home app! I won’t go through the Home app and everything just because it is a separate service on its own with many, many features. I will let you know one thing though, your favorite items show up in the control center. So, if I hold down on MK Light and press details the switch Include in favorites is turned on, and as you can see if I pull up control center it is there. Before we close out the video let's test out the the light switch using the home app. As you can see when I press it the light turns On. Now let's turn it off using siri. “Hey siri, turn off MK Light” As you can see it turned it off! Great! Home Kit is connected and working! Now we can control our openHAB items with Home Kit! Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Share by: