Homekit Siri

From Domoticz
Jump to: navigation, search

This wiki page describes the installation steps required to install Homekit with Siri support. This enables you to talk to your apple iPhone or iPad to control your domoticz installation (description is based on raspberry pi 2 running domoticz image)

BIG thanks to Joep ( Forum link ). I only followed instructions and wrote this down

Please note that the current Domoticz SDCard image has this included, and you can jump straight to Configure section.

Update your system

Make sure your system is up-to-date:

 sudo apt-get update
 sudo apt-get upgrade

Install dependencies

Node.js

mkdir node.js
cd node.js
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
node -v
sudo apt-get install libstdc++6
cd ..

This should display the version number of the installed node.js

Python

sudo apt-get install python

g++

sudo apt-get install g++

MDNS

sudo apt-get install libavahi-compat-libdnssd-dev

HomeBridge

Installation

git clone https://github.com/nfarina/homebridge.git
cd homebridge
git submodule init
git submodule update
npm install

Configure

Create config.json file in the HomeBridge directory:

cd ~/.homebridge/
nano config.json

Paste the following into that file: (this file assumes default install of Domoticz)

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080"
        }
    ],
    "accessories": [
    ]
}

It is recommended to create a 'Roomplan' in Domoticz and put all your sensors that you wish to control in this roomplan. Take a note of the roomplan IDX value. Once you created the roomplan, configure home bridge like (use "loadscenes": 0 or 1 depending if you wish to load your groups/scenes as well)

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080",
            "roomid": <IDX Value>,
            "loadscenes": 0
        }
    ],
    "accessories": [
    ]
}

First start

Go to the homebridge directory

cd ~/homebridge/
npm run start

Start at boot

Go to the homebridge directory

cd ~/homebridge/
sudo npm install forever -g
forever start app.js

Alternatively use PM2 instead of Forever; it can start HomeBridge at startup. Install instructions are in post http://www.domoticz.com/forum/viewtopic.php?f=36&t=6864&start=200#p51609

See PM2 documentation here https://github.com/Unitech/PM2/blob/master/ADVANCED_README.md

Using HomeKit API on the iOS Devices

Choose one of the App's in the App Store that can manage HomeKit devices.

Try some of the following..

Once you've gotten a HomeKit app running on your iOS device, you can begin adding accessories. The app should "discover" the accessories defined in your config.json file, assuming that you're still running the HomeBridge server and you're on the same Wifi network.

When you attempt to add a device, it will ask for a "PIN code". The default code for all HomeBridge accessories is 031-45-154. Adding the device should create some files in the persist directory of the HomeBridge server, which stores the pairing relationship.

Further Readme for homekit: https://github.com/nfarina/homebridge#adding-your-devices-to-ios

To delete all of the home data from your iOS device and iCloud, go to Settings > Privacy > HomeKit and tap Reset HomeKit Configuration.