I’m actually testing on how to control things in a house or flat with Apple HomeKit. It seems to be a pretty nice solution as one would expect from apple but it takes time for the vendors to adopt. After googling around I found out that there are already some projects on github using the HomeKit API which could be pretty nice. First of all I will give homebridge a try.
A testing environment
I started with a small docker container but failed since one of the basic technologies of HomeKit is MDNS. This is implemented with the Avahi Daemon in Linux. This is not hard so far and pretty much standard but this daemon needs systemd to run. Furthermore it is not a good practice to have different processes running within a docker container. So I decided to setup a small and simple Debian 8 VM on my machine. Needs some minutes but is pretty much the easiest solution. Ensure you use bridged networking for your VM. In a NAT or host-only mode, your network devices won’t see the bridge which seems obvious but may need some time to recognize.
You should have a relatively new node.js version installed. One solution is to use nodesource packages. You will also need some utils like make so installing build-essential is a good start:
aptitude install curl git build-essential libavahi-compat-libdnssd-dev
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
You’re now free to install homebridge:
npm install -g --unsafe-perm homebridge