A lot of people want to use Siri to control Nest, HomeSeer, or other automation systems. Apple created a product suite called HomeKit that allows just this type of interaction to happen. However, as of yet not very many app developers or manufacturers have added this functionality to their applications or hardware.

Once enabled you can simply say “Hey Siri! Open the garage door.” or “Hey Siri! Set the Living Room temperature to 75 degrees.” and Siri will talk to the device directly to make the changes.

So what if you have a product like Nest, or home automation system like HomeSeer that doesn’t support HomeKit and may or may not even have it on their roadmap? Well there is good news! An open source platform called HomeBridge is available for Linux that bridges the separate platforms and opens a world of possibility for almost any device or system in your home (or business).

Introducing HomeBridge

Use Siri to Control Nest MyQ HomeSeer and more - 0004HomeBridge is a middle man (or middle-ware) that sits on your home network and translates messages from HomeKit to your devices or home automation controller. It has plugins for all types of controllers, that will allow you to use Siri to control Nest, LiftMaster/Chamberlain/MyQ, and many others. And when there’s no plugin for systems like HomeSeer, all one needs do use the HTTP HomeBridge Plug-in and let it communicate to HomeSeer via JSON! For the techies in the crowd think of it like BizTalk for home automation! HomeBridge will of course translate the response back from the controller or device and let Siri know if it was successful in the operation.

System Requirements for HomeBridge

HomeBridge is an NPM package, which means it will run on most any Linux or *NIX variant including Ubuntu, Debian, Raspbian (Raspberry Pi), or OSX (MacOS). I’ve not explored Windows but I supposed it is possible with the right install.

In my case, I run HomeSeer on a dedicated Windows 10 computer. In order to simplify things, and rather than add another computer to the mix, I decided to install Ubuntu Linux in a virtual machine on my HomeSeer computer using Windows 10 Hyper-V. I spun up a Gen 2 virtual machine and gave it 512MB of RAM dedicated (I have 8 on the HomeSeer server). This is a super clean setup because it keep everything HomeSeer and home automation related running on my HomeSeer machine.

In this tutorial, I’m not going to go into setting up a virtual machine, or installing Linux. There are thousands of resources on the web to help you with that. Once you have Linux installed and connected to the same network as your phone and HomeSeer or other devices you’re ready to move on to installing and configuring HomeBridge.

Watch My Video on Setting up HomeBridge

Preparing Linux for HomeBridge

The first thing after installing Linux is to make sure its prepared and ready for the install of HomeBridge.  There are a few prerequisites and recommendations.

Configure a static IP Address

This is a recommendation, but will save you some heartache down the road. This will keep your HomeBridge box from changing addresses and you from having to hunt it down later to troubleshoot things.  It will also keep DNS cache from devices with the old IP from working intermittently until they update. It’s all around just a good idea, but again is optional.

Install Prerequisite Packages

Node.Js is required to run HomeBridge. To install Node.js execute the following command:

$ sudo apt-get isntall nodejs

and

$ sudo apt-get install nodejs-legacy

Next, you’ll need to install libavahi-compat-libdnssd-dev on your system. This is done by executing the following command:

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

Finally, you need to install NPM, as HomeBridge as a Node.js project:

$ sudo apt-get install npm

Once that process completes, all dependencies should be in place.

Installing HomeBridge

Now that you have all of the prerequisites installed, its time to install HomeBridge. HomeBridge is packaged via NPM, which is the default package manager for JavaScript and Node.js. To install HomeBridge execute the following command at the command prompt:

$ sudo npm install -g homebridge

If you get the error message “gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.5.0"", run it again and add the --unsafe-perm flag to the command:

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

You should now be able to run homebridge and get the following response:

$ homebridge
No plugins found. See the README for information on installing plugins.

This response indicates HomeBridge is installed working correctly, but does not have any plugins installed, or a configuration file. If you get anything other than this response, go back and check your prerequisites.

Installing HomeBridge Plugins

HomeBridge without plugins is basically a shell. It does nothing. In the authors own words, “It is useless.”. To get some actual bridges to other platforms working, we need to install the plugin for that platform. For platforms like HomeSeer that can communicate using JSON and HTTP, we just need to install the HTTP plugin. To use Siri to control Nest, or other platforms like MyQ (Liftmaster, or Chamberlain) there are purpose built plugins you’ll need to isntall

Installing the HomeBridge Nest Plugin

To use Siri to control Nest through HomeBridge, you’ll want to install the Nest plugin. Install the Nest Plugin by executing the following command at the prompt:

$ sudo npm install -g homebridge-nest

Installing the HomeBridge HTTP Plugin (required for HomeSeer)

As mentioned before HomeSeer doesn’t have a plugin, and until HomeSeer creates their own HomeKit plugin, the easiest way to integrate HomeSeer with HomeKit/HomeBridge is to use JSON over HTTP to communicate with the HomeSeer server. To install the HTTP module run the following command at the prompt:

$ sudo npm install -g homebridge-http

Installing the HomeBridge MyQ Plugin (for LiftMaster or Chamberlain)

LiftMaster and Chamberlain (same company) use a proprietary technology to control their garage door openers called MyQ. There is a MyQ plugin in the NPM repository. However, no one has figured out how to actually make it work. But there is good news. There is a separate LiftMaster and Chamberlain plugin that is specific to the brand (because they have different websites) that does work without any issues. It just means you have to install the right one for your garage door opener. If you’ve not already gotten you garage door working with MyQ, you need to do that first, as these plugins will connect to your account and use their APIs.

To install the MyQ plugin for Chamberlain execute the following command at the prompt:

$ sudo npm install -g homebridge-chamberlain

To install the MyQ plugin for LiftMaster execute the following command at the prompt:

$ sudo npm install -g homebridge-liftmaster

Creating a HomeBridge Configuration File (config.json)

Now that you’ve got your plugins installed, its time to build a config.json file for HomeBridge. This config file tells HomeBridge how to control your devices, or how to connect to your services (in the case of MyQ, or Nest). This config file is fairly simple to build.  Here’s as a sample version:

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

"description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.",

"platforms": [
    {
        "platform": "Nest",
        "name": "Nest",
        "clientId": "yourid",
        "clientSecret": "yoursecret",
        "token": "yourtoken",
        "username": "you@yourmail.com",
        "password": "yourpassword",
        "code": "yourcode"
    }
],

"accessories": [
    {
        "accessory": "Http",
        "username": "yourHomeSeerusername",
        "password": "yourHomeSeerpassword",
        "name": "Office Lamp",
        "on_url": "http://192.168.1.249/JSON?request=controldevicebyvalue&ref=4&value=99",
        "off_url": "http://192.168.1.249/JSON?request=controldevicebyvalue&ref=84&value=0",
        "http_method": "GET"
    }
  ]
}

The Bridge Section of config.json

The bridge section of config.json defines the parameters of your install of HomeBridge and allows you to change its name to something entirely different if wanted.  You could name it GeekBridge for example. This is the name your iPhone (or other iOS device) will see when you pair the bridge. You can safely ignore the username and port; leave them unchanged. The PIN code is the code you will need to enter during the bonding process. Make it something unique and write it down for safe keeping. It must follow the 3-2-3 pattern, so keep the dashes.

The Platforms Section of config.json

The platforms section is where you will configure your devices and cloud services. This includes Nest and MyQ.

To use Siri to control Nest, follow these instructions at the NPM website. I’m not going to go over them here, as they change as Nest and HomeBridge are updated and I can’t keep updating this site. You’ll need to create a simple account at developer.nest.com and get your ClientID, and ClientSecret from that site.

To configure LiftMaster follow these instructions at the NPM website. You’ll need your LiftMaster credentials.

For other platforms just search the NPM website for hombridge-plugins. There are many there for all kinds of platforms, including the Harmony Hub, and Sonos!

The Accessories Section of config.json

The accessories section of the config.json file is where will configure devices directly that don’t already have plugins made for them. In our case, we’re going to configure HomeSeer to talk to HomeBridge via HTTP using JSON. You can also control any device or send data anywhere on the internet that can receive and HTTP GET or POST command and return a response. One person I know has Siri post to Facebook for him via the accessories section. Basically, its just an HTTP shim, so the sky is the limit with a little HTML and JSON knowledge.

How to Enable JSON in HomeSeer

Enable JSON in HomeSeer

Before you configure any HomeSeer commands, take a minute to make sure you have JSON enabled in HomeSeer. To enable JSON in HomeSeer go to Tools–>Setup–>Remote Control Settings and check the box labeled “Enable control using JSON”. This will allow you to send commands to HomeSeer in the format http://your.homeseer.address/JSON?request= format.

How to get a device refererence ID in homeseerThe only thing you need to know to configure a device in HomeSeer is the devices ID number.  In HomeSeer click on a device’s name. On the device screen click on the Advanced tab.  The very first line of information should be labeled “Reference ID”. This is the number we will need to put in the accessories section of our config.json.

Let’s say you have an Office Lamp with Reference ID 77 in HomeSeer. The accessories section command for that device should look like this:

    {
        "accessory": "Http",
        "username": "yourHomeSeerUsername",
        "password": "yourHomeSeerPassword",
        "name": "Office Lamp",
        "on_url": "http://your.HS.ip.address/JSON?request=controldevicebyvalue&ref=4&value=99",
        "off_url": "http://your.HS.ip.address/JSON?request=controldevicebyvalue&ref=84&value=0",
        "http_method": "GET"
    },

That’s all there is to it!  You can copy this config snippet and paste it multiple times.  All you need to change each time is the Reference ID (ref=XX) and the name of the device.  You’ve just configured Siri to control your HomeSeer!

Start HomeBridge

From the command line just type “homebridge” and homebridge will start, and show you the bonding PIN on the screen. HomeBridge is now ready to go.

$ homebridge

Add HomeBridge to your iOS Device (iPhone, iPad)

The final step is now to add HomeBridge to your iOS device. Unfortunately this will mean spending $1.99 to buy an app that you’ll never use ever again after you use it to pair HomeBridge to your device. There are several apps in the app store that will perform this function, but the one I used and know for sure works is MyTouchHome app. Install this device on your iPhone or iPad.  Create a new home, just call it Home, and then click the “+Accessory” button at the bottom right hand side of the screen.  If HomeBridge is running it will show up in the list.  Tap it, enter the PIN code.  You’re complete.  You don’t ever need to use this app again if you don’t want to.

Have Some Patience

Now you need to wait about 5 minutes. Siri is a cloud based service and it takes a little time to get the data to Siri and spread across all of Apple’s servers.

Use Siri to Control Nest, MyQ, Sonos, HomeSeer, and more!

After about 5 minutes you should be able to say things to Siri such as:

“Hey Siri… Turn off the Wine Cellar Light”.

“Hey Siri… Set the Family Room Temperature to 75 degrees.”

“Hey Siri.. Open the Garage.”

Siri should respond almost instantly that she has performed the task and the device should change states. That’s it! You’re done!  You can now use Siri to control Nest, MyQ, Sonos, HomeSeer, and many other products!

(Note: This delay will also occur if you delete, change, or add new devices later.)

Apple TV as a Home Automation Bridge

Apple TV and HomeBridgeIf you’re lucky enough to have one or more 4th Generation Apple TVs on your network, then HomeBridge is going to be even more useful!

The 4th Gen Apple TV acts a bridge to the cloud when your away from home, allowing Siri to control your devices from anywhere in the world! There is zero configuration required for this. Just plug the Apple TV into your home network and log into your iCloud account.  Everything else is fully automatic!

So whether you’re on the beach in Hawaii or at the neighbors house next door, you can use Siri to control Nest, MyQ, or HomeSeer!  Siri will make it happen with your 4th Gen Apple TV as a HomeKit bridge!