Run npm install -g homebridge-ble-thermobeacon
Enable the plugin in the homebridge config.json
:
{
// ...
"platforms": [
{
"platform": "PrometheusExporter",
// Debugging enabled
//
// Default: false
"debug": "<boolean>",
// Publish all button press states as locks
//
// Pressed button is presented as unlocked, otherwise locked. Can help identify
// the beacon
//
// Default: false
"buttonAsLock": "<boolean>",
// List of devices
//
// Default: []
[
{
// Address
//
// Bluetooth address of the thermometer. MAC address on Linux, UUID on Mac
"address": "<string>",
// Name
//
// Specify a name for the thermometer in Homebridge
"name": "<string>",
// Publish button press state as lock
//
// Per device settings to publish button pressed state as a lock
"buttonAsLock": "<boolean>"
}
//, { ... }
]
}
]
}
On Linux, the CAP_NET_RAW
capability is required for BLE to work as a non-root user.
If you are running homebridge with systemd (and you really should), you need to add CAP_NET_RAW
as an ambient
capability. Either edit the homebridge.service
file directly or (preferably) place an override in
/etc/systemd/system/homebridge.service.d
.
Create the folder:
mkdir /etc/systemd/system/homebridge.service.d
Place this drop-in configuration in the folder, e.g. /etc/systemd/system/homebridge.service.d/bluetooth.conf
:
[Service]
AmbientCapabilities=CAP_NET_RAW
Run systemctl daemon-reload
to refresh systemd’s unit database
and then run systemd-delta --type=extended
to check if the drop-in worked as expected.
You should see something like this in the output:
…
[EXTENDED] /lib/systemd/system/homebridge.service → /etc/systemd/system/homebridge.service.d/bluetooth.conf
…
Restart homebridge afterwards by running systemctl restart homebridge
.
This project could not have happened without previous work. Many thanks!
- Ivko Kalchev’s implementation of ThermoBeacon
- rnlgreen Python scripts