Smart Home – Homebridge
Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of “smart home” devices.
This is going to be the brain of the whole smart home thing. This directly connects with any Apple device ( iPhone, iPad etc ) and will contains all the necessary plugins and commands to control the wireless endpoints we will be making.
You can read more information and get it from its git repo – https://github.com/nfarina/homebridge
If you don’t have a Raspberry Pi or any other device, you can simply install it on your PC / Laptop. If you are worried about all the packages it installs, you can simply run it inside the linux vagrant box.
It might not work out of the box by following the simple installation mentioned there. atleast it didn’t for me, had some issues with npm versiona and permission, etc etc. after hours of research, here’s what I did. You can simply run the below commands and you should get the homebridge up and running in your device/VM in few minutes.
sudo apt-get update
sudo apt-get upgrade
wget https://nodejs.org/dist/v5.3.0/node-v5.3.0-linux-x86.tar.gz
tar -xvf node-v5.3.0-linux-x86.tar.gz
cd node-v5.3.0-linux-x86
sudo cp -R * /usr/local/
node -v
"v.5.3.0"
npm -v
"v.3.3.12"
cd
sudo apt-get install git
sudo apt-get install libavahi-compat-libdnssd-dev
sudo npm install -g homebridge
sudo npm install -g homebridge-legacy-plugins
homebridge
"Couldn't find a config.json file [snip]"
"Added config.json to ./homebridge folder. SUCCESS!!!"
Source: https://github.com/nfarina/homebridge/issues/347#issuecomment-165886271
If you have succesfully installed, you can simply run it using homebridge command and you should get something similar,
---
Loaded config.json with 0 accessories and 0 platforms.
---
Loading 0 platforms...
Loading 0 plugins...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
┌────────────┐
│ 031-45-154 │
└────────────┘
Homebridge is running on port 51826.
This means you are lucky. Go to your HomeKit App on your iPhone or iPad and it should detect your VM/Device as a Homebridge device.
There won’t be any accessories at the moment.