Skip to content

Running Multiple Instances of HomeBridge

jvmahon edited this page May 19, 2021 · 5 revisions

Running Mulitple Instances of HomeBridge

This is a stub entry explaining how to run multiple instances of homebridge at once. Additional edits for clarity would be appreciated.

Update: As of Homebridge 1.3, this is completely out-of-date. Homebridge now has a way of running multiple instances of a plugin. Its much better than this method. Use Config-ui-x to set that up.

In some cases, a user may want to simultaneously run more than on instance of homebridge and the HomeSeer plugin. Reasons for this can include:

  • You will need to run multiple instances if you have more than ~145 accessories to be bridged
  • You may obtain better performance using multiple instances if you need to support different homebridge "platforms" and some of them can be blocking or respond slowly. In particular, I have found that other plugin that communicate with a 'cloud' service seem to block and slow homebridge while they are operating. For that reason, I prefer to place other plugins in a separate instance of homebridge so they don't block the HomeSeer plugin.

How To Run Multiple Instances of homebridge and its Plugins

  1. Divide your config.json file into two or more files each named config.json

  2. Each of the resulting config.json files should contain less than 100 accessories entries.

  3. Be sure that you change the homebridge "username" and port number in each config.json file so they do not match. For example, use port 51828 in the first config.json and port 51829 in the second. Similarly, you could use usernames like "CD:22:3D:E3:CE:30" in the first config.json and "CD:22:3D:E3:CE:31" in the second.

  4. Create two directories in which to place the parts of your config.json. As an example on Linux, I use the two directories /var/homebridge/instance1 and /var/homebridge/instance2. On Windows, I similarly use: C:\Users[my user name]\homebridge\instance1 and C:\Users[my user name]\homebridge\instance2

  5. On Linux, make sure the two directories have full rwx permissions.

  6. Start the homebridge instances separately, using the -U option to specify the directory in which you placed the config.json files. For example, in Linux, execute:

     homebridge -U /var/homebridge/instance1

     homebridge -U /var/homebridge/instance2

Similarly, in windows:

     homebridge -U "C:\Users\[my user name]\homebridge\instance1"

     homebridge -U "C:\Users\[my user name]\homebridge\instance2"

Note that the quotes around the directory names will be needed if the directory names contain spaces.

This will then create two bridges, each of which can have up to 100 accessories. You'll have to add each bridge as a separate pairings to the Home app, but once that's done, you're all set.

Home

Installation

I've deleted most of my "old" installation instructions that used to be here. Homebridge has updated their instructions and they are now more comprehensive than what I had. Just follow their instructions: https://www.npmjs.com/package/homebridge

And be sure to use config-ui-x. Its really great for setting up the plugin.

Configuring Devices

These instructions are now a bit out of date. You can follow them to set up the plugin, but there is now a settings interface in config-ui-x which makes it much easier.

FAQs

Why won't my device names change after I edit them in config.json

Miscellaneous

Clone this wiki locally