Library for Homebridge Plugins
Copyright © 2018-2022 Erik Baauw. All rights reserved.
While developing a number of Homebridge plugins, I find myself duplicating a lot of code. The idea behind this library is to ease developing and maintaining Homebridge plugins by separating this generic code, dealing with HomeKit and Homebridge, from the specific code, dealing with the actual devices being exposed to HomeKit.
The documentation, how to develop a plugin using Homebridge Lib, is provided in the code and through tutorials in the
To generate the documentation, install
jsdoc and run
jsdoc -c jsdoc.json.
To view the documentation, open
index.html in the
See Homebridge WS for an example plugin based on Homebridge Lib.
The Homebridge Lib library comes with a number of command-line tools for troubleshooting Homebridge installations.
||Logger for HomeKit accessory announcements.|
||Print hardware and operating system information.|
Each command-line tool takes a
--help argument to provide a brief overview of its functionality and command-line arguments.
This library is not a Homebridge plugin and does not need to be installed manually.
Instead, Homebridge plugins using this library should list it as a dependency in their
npm installs Homebridge Lib automatically when installing the actual plugin.
To install the command-line tools, use:
$ sudo npm -g i homebridge-lib
This creates symlinks to these tools in
/usr/local/bin (depending on how you installed NodeJS).
Note that, when Homebridge Lib is installed like this, Homebridge might issue a warning at startup:
Plugin /usr/lib/node_modules/homebridge-lib package.json does not contain the keyword 'homebridge-plugin'
This warning can be ignored safely.
Homebridge Lib is a hobby project of mine, provided as-is, with no warranty whatsoever. I've been running it successfully at my home for years, but your mileage might vary.