Setting up HomeBridge

July 25, 2016

After buying HUE lights for the most part my living room I wanted to expand to the kitchen. Forcing me to look for GU10 spots. Ofcourse I could have bought Philips own GU10 spots but the colors had no extra functionality in my kitchen so I decided to buy a third party compatible GU10 lamp. Having it all set-up I found out that de HUE bridge doesn't broadcast third party lamps into HomeKit.

No worries let's build HomeBridge to make those lamps available over HomeKit. I started out with a Raspberry Pi 2nd gen. with Raspbian installed.

So after setting it up in my network and installing SSH on it and got to the part where I could set up HomeBridge.

Setting up pre-requirements

First of we need to update the default system packages:

sudo apt-get update
sudo apt-get upgrade

After doing so we need to download and install Node.JS to run HomeBridge:

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l
sudo cp -R * /usr/local/
cd

HomeBridge also requires Avahi (practically Open Source Bonjour for Linux)

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

Installing HomeBridge

The next step is to install HomeBridge itself by entering the following command:

sudo npm install -g homebridge

Basic configuration

Next we can add the configuration so HomeBridge will actually work with Philips HUE and the 3rd party lamps. To do so we need to create an empty configuration file that will setup the basic settings.

mkdir -p ~/.homebridge
sudo nano ~/.homebridge/config.json

Copy/paste this:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "accessories": [
    ],

    "platforms": [
    ]
}

You can change the HomeBridge pin to a different random number. The default number will work, but most people will be using that one. I really don't know what the security impact might be so I decided to change mine to some other random numbers just to be safe.

At this moment we're done installing HomeBridge and you could run the following command to start HomeBridge manually:

HomeBridge

I will do some more in explaining about setting up automatic start and specific plugins in the coming posts.