Homebridge guide: How to make everything HomeKit-compatible

The smart way to bring HomeKit support to everything from Nest to Sonos

How to use Homebridge
The Ambient is reader-powered. If you click through using links on the site, we may earn an affiliate commission. Learn more

As good as Apple HomeKit is, delivering both voice control and some powerful automation, the system is rather limited when it comes to hardware support. For example, you won’t find any Nest support for the platform, or any Sonos compatibility. That’s where Homebridge comes in.

Able to run on practically any computer, Homebridge is, as the name suggests, a bridge between HomeKit and other devices. A lightweight NodeJS server that emulates the iOS HomeKit API, Homebridge is open-source software that provides the support that's lacking from the platform. It is not in anyway affiliated with Apple, and as with all open-source software, install it at your own risk.

Read this: The best HomeKit features coming in iOS 13

It can be a touch fiddly to install and run, but here we’ll take you through the initial installation. We'll show you how to configure the system and how to add devices and get you up and running.

Which computer should I run Homebridge on?

Homebridge works with Windows, macOS, Linux and the Raspberry Pi. The most important thing is that whatever device you install it on, it needs to be turned on all of the time to work. For that reason, it makes sense to install it on a Raspberry Pi, as the small computer needs little power to run.

It’s worth reading the Raspberry Pi installation instructions on the Homebridge Wiki to get the initial required components installed, before returning to the Homebridge GitHub page for Homebridge installation instructions.

If you don’t have a Raspberry Pi, and just want to try out the system on a different type of computer, first you should download and install the latest version of Node.js, which is available for Windows, Mac, and Linux.

Once installed, follow the steps on the Homebridge GitHub page to download and install Homebridge. You should use the following command line from a terminal window when installing:

npm install -g --unsafe-perm homebridge
sudo npm install -g --unsafe-perm homebridge

Once completed, you’re ready and Homebridge is installed on your computer. You can run it by using the command prompt and by typing "homebridge".

You’ll see a QR code on the screen, along with a message that tells you that there’s no config.json file and that you don’t have any plugins. For now, quit Homebridge by going to its Terminal window and press CTRL+C (Apple+C on a Mac).

How to use Homebridge to make everything HomeKit-compatible

Installing plugins and configure Homebridge

Next, you need to edit (or create) the configuration file. For Linux and Raspberry Pi devices, you can get up a command line and type nano ~/.homebridge/config.json. For Mac and Windows computers, we recommend installing Brackets.

With Brackets, you can create a new file from the File > New menu. Go to Save, and then you need to give the file the right name and put it in the right directory. For Windows, you need to type the following directory name into the save dialog box: c:\users\\.homebridge.

For Mac users, in the save dialog box press Apple+Shift+G, then type: ~/.homebridge. For both, enter the name of the file as config.json. With Brackets, your config.json file is always available when you open the application, so for future updates you can select the file, enter the text that you need, and click Save.

You can now start to add the information that you need. First, you need a basic configuration, such as this one:

{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "My Homebridge server.",
"ports": {
"start": 52100,
"end": 52150,
"comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
},
}

You can change the username and pin, but you must keep the formatting and length the same.

How to use Homebridge to make everything HomeKit-compatible

Adding Homebridge plugins

To work, Homebridge requires plugins. Each plugin is designed to connect to a specific product, such as a Nest Thermostat. As well as installing a plugin, you also have to edit the configuration file (config.json). It’s worth adding a single device first, then proceeding with each new device one at a time.

You can find plugins on the Homebridge website, using the search box on the home page. For example, we’ve searched for ‘Nest’. In the search results, find the one that best matches the device that you want to use. In our case, to get a Nest Thermostat working, we’ve chosen the homebridget-nest plugin, which supports both Nest Thermostats and the Nest Protect smoke alarm.

How to use Homebridge to make everything HomeKit-compatible

When you select a plugin, you’ll see the installation instructions, with the command that you need to install it. Ignore any instructions on how to install Homebridge (you’ve done this already) and, instead, choose the plugin instructions.

Typically, the command is something like npm install -g homebridge-, although you’ll probably need to add sudo (which allows admins to give system privileges to users) to the front of the command if you’re running Linux or macOS. For Nest, as we were running on macOS, we had to type into a command line:

<device>sudo npm install -g homebridge-nest
</device>

Each plugin’s page has an example of what to enter. For example, for Nest, you need:

"platforms": [
{
"platform": "Nest",
"email": "your Nest Account email address",
"password": "your Nest Account password"
}
],

How to use Homebridge to make everything HomeKit-compatible

Save your config file and then launch Homebridge. If you have two-factor authentication turned on, you’ll be prompted to enter a PIN, which will be texted to you. You’ll need to do this every time you launch Homebridge for two-factor authentication. You’ll then see a QR code and PIN on your computer’s screen, showing that Homebridge is working.

How to use Homebridge to make everything HomeKit-compatible

Adding Homebridge to your phone

With your configuration working, open up the Home app on your iOS device. Then select ‘+’ and select Add accessory. Tap Don’t have a Code or Can’t Scan, then select your Homebridge computer on the next page.

You’ll be told that this is an Uncertified Accessory, but select Add Anyway. Manually enter the HomeKit setup code (the main PIN in your configuration file). Now, your Homebridge devices will be found and added to Home, but don’t be surprised if there are more than you think.

How to use Homebridge to make everything HomeKit-compatible

For example, with Nest Thermostats, you get a switch that turns Eco mode on or off, the main thermostat control, and a switch that sets if you’re at home or not. All of the devices you add will appear while your Homebridge server is running.

How to use Homebridge to make everything HomeKit-compatible

Adding additional devices

When you’ve got Homebridge working, you can add in additional devices. As we've said, it’s worth taking them one at a time, so you can check that each works.

To add a new device, quit your Homebridge server, then download and install the plugin, following the advice above. Now, when you edit your configuration file, you need to do something a bit different, as you can only have one “platforms” section, with the details between the square brackets.

Each platform that you add should be between curly brackets, with a comma between each section. For example, to have Nest and Wemo, here’s how the configuration could look:

"platforms": [
{
"platform": "Nest",
"email": "your Nest Account email address",
"password": "your Nest Account password"
},
{
"platform": "BelkinWeMo",
"name": "WeMo Platform"
}
],

You can keep adding plugins and devices to your Homebridge server, dramatically increasing what HomeKit can do. Everything added to your server is fully controllable by Siri, too, whether on your Watch, iPhone or HomePod, and you can include devices in Automations.


TAGGED    apple    smart home

Related stories

robot vacuums Best robot vacuum cleaners 2020: Roomba, Neato, Roborock and more
smart home The best smart locks: Smart security from August, Yale, Schlage and more
thermostats Tado review: Smart Thermostat and Radiator Thermostat put to the test
smart home IFTTT essential guide: The best IFTTT Applets for your automated smart home
smart home Sky Q: Complete guide to Sky's Ultra HD TV platform
google The best Google Home compatible devices for your smart home