Homebridge Logs

You may know that Homebridge is an outstanding piece of software that lets you tie many smart home devices that don’t have native HomeKit support into your HomeKit ecosystem, but I submit to you that one of Homebridge’s biggest benefits besides that is its logging.

Most smart home devices are just kind of there and do their thing, but you have no insight into historical activity, aside from HomeKit secure video cameras which keep recordings around for some period of time depending on your available iCloud space. Homebridge changes that.

Homebridge logs the activity of any devices connected to it. If a light goes on, it gets logged. If someone connects to the smart doorbell camera and takes a peek, that gets logged. It’s wonderful. You can set up your Homebridge Config UI X web view to show the more recent entries in your log file, which is handy for quick understanding of recent activity if you’re restarting the service or adding or updating plugins.

Homebridge Config UI X

There’s also a “log” view button on the Config UI X web view that shows just the logging activity.

Homebridge Config UI X Log Viewer

Even better, you can access the raw log file to parse it any way you please. In my Raspberry Pi Homebridge installation (and maybe everyone’s?), the log file is in the /var/lib/homebridge directory.

Contents of the /var/lib/homebridge directory

I don’t know if there’s a max size this log file gets truncated at, but mine goes back to March 2nd, which is probably when I first installed Homebridge on my Raspberry Pi, so I’d wager it’s sufficient for most people’s needs.

As with any log file, it’s a standard text log, so feel free to grep the contents or load it into some custom parsing tool or whatever you want to do with it. Just remember that it’s actively being written to, so make a copy of it and play with that.

The homebridge.log file

I work in semiconductor test for a living, and modern semiconductor test equipment logs everything that happens in excruciating detail, be it mechanical events, automated software events, or humans clicking user interface buttons. I love me some log files is what I’m saying. Homebridge is a really stellar piece of software that expands the HomeKit ecosystem and also happens to fulfill my need for proper event logging.