Skip to content

Manual Configuration

oznu edited this page May 13, 2022 · 5 revisions

This page is intended for users who decide not to run their setup using hb-service.

Manual configuration is not necessary when running using hb-service, see the guide for your platform:


Install the package using npm:

sudo npm install -g --unsafe-perm homebridge-config-ui-x

Add this to your homebridge config.json file

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "sudo": false
    }
]

Once you have installed and configured the plugin you can access the interface via http://localhost:8080.

Docker users should set the environment variable HOMEBRIDGE_CONFIG_UI=1 to enable the UI. No further manual installation or configuration is required. See wiki for details.

Optional Settings

All config options are listed here.

Accessory Control

The plugin allows you to view and control some types of Homebridge accessories from your web browser.

To enable accessory control you must be running Homebridge in insecure mode:

homebridge -I

Not all accessory types are supported. See this issue for a full list of supported accessory types.

Controlling Multiple Instances

Homebridge Config UI X's Accessory Control feature allows you to control the accessories from multiple instances of Homebridge. To make this work all instances you want to control must have the same PIN, be on the same network, and be running in insecure mode. Your other instances are automatically discovered, however you can blacklist instances you don't want to control using the plugin settings.

Log Viewer Configuration

Homebridge Config UI X allows you to view the homebridge process logs in the browser. These logs can be loaded from a file or from a command.

Adjusting the log viewer config does nothing when running with hb-service as the log view is automatically configured for you.

Logs From File

Example loading logs from a file, change /var/log/homebridge.log to the actual location of your log file:

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "log": {
        "method": "file",
        "path": "/var/log/homebridge.log"
      }
    }
]

Make sure the user which is running the Homebridge process has the correct permissions to read the log file. You may need to enable the sudo option to avoid permission errors if you are not running Homebridge as root.

Logs From Systemd

If you're using systemd to manage the Homebridge process then you can just set the method to systemd:

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "restart": "sudo -n systemctl restart homebridge",
      "log": {
        "method": "systemd",
        "service": "homebridge"
      }
    }
]

You may need to enable the sudo option to avoid permission errors if you are not running Homebridge as root.

Logs From Custom Command

The log option can alternatively specify a command to spawn that will stream the logs to the client. This command should stream the logs to stdout:

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "log": {
        "method": "custom",
        "command": "sudo -n tail -n 100 -f /var/log/homebridge.log"
      }
    }
]

Sudo Mode

Many operations performed by Homebridge Config UI X, such as installing plugins, upgrading Homebridge and viewing the logs can require root permissions. You can run the Homebridge service as root or you can enable the sudo option in the config.

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "sudo": true
    }
]

When sudo mode is enabled Homebridge Config UI X will use sudo when executing installing, removing or upgrading plugins, viewing the logs using the Logs From File or Logs From Systemd method, and when upgrading Homebridge. It will not be used for Logs From Custom Command or custom restart commands.

Password-less sudo required

For sudo mode to work password-less sudo is required. You can enable password-less sudo by adding this entry to the bottom of your /etc/sudoers file (use visudo to edit the file!):

homebridge    ALL=(ALL) NOPASSWD: ALL

Replace homebridge with the actual user you are running Homebridge as.

Enabling SSL

You can run this plugin over an encrypted HTTPS connection by configuring the ssl options.

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "ssl": {
        "key": "/path/to/privkey.pem",
        "cert": "/path/to/fullchain.pem"
      }
    }
]

Or if using a PKCS#12 certificate you can setup SSL like this:

"platforms": [
    {
      "platform": "config",
      "name": "Config",
      "port": 8080,
      "ssl": {
        "pfx": "/path/to/cert.pfx",
        "passphrase": "sample"
      }
    }
]
Clone this wiki locally