homebridge-melk-ble-light
v1.0.2
Published
Homebridge plugin exposing MELK BLE devices as HomeKit lights.
Maintainers
Readme
homebridge-melk-ble-light
Homebridge platform plugin that exposes configured BLE devices as HomeKit Lightbulb accessories.
Linux/Homebridge BlueZ permissions
This plugin uses node-ble (BlueZ over D-Bus). The Homebridge service user must be allowed to talk to org.bluez.
Replace homebridge below if your Homebridge service runs as a different user.
- Add the Homebridge user to the Bluetooth group:
sudo usermod -aG bluetooth homebridge- Add a D-Bus policy for
node-ble:
<!-- /etc/dbus-1/system.d/node-ble.conf -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="homebridge">
<allow send_destination="org.bluez"/>
</policy>
</busconfig>- Add a polkit rule to allow BlueZ operations for the
bluetoothgroup:
// /etc/polkit-1/rules.d/90-homebridge-bluez.rules
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.bluez.") === 0 && subject.isInGroup("bluetooth")) {
return polkit.Result.YES;
}
});- Restart services and re-login so group membership is applied:
sudo systemctl restart dbus bluetooth homebridgeConfiguration
Add this to your Homebridge config.json:
{
"platform": "MelkBleLight",
"name": "MELK BLE Lights",
"deviceNames": [
"MELK-OA21",
"MELK-BEDROOM"
]
}Options
deviceNames(required): Array of BLE name strings. One HomeKit light is created per name.scanTimeoutMs(optional): BLE scan timeout in milliseconds. Default:3000.connectTimeoutMs(optional): BLE connect timeout in milliseconds. Default:8000.writeUuidSuffix(optional): Write characteristic UUID suffix. Default:fff3.
Notes
- BLE transport is BlueZ D-Bus (
node-ble) and requires Linux. - Devices are matched case-insensitively against the advertised BLE local name.
- Internal idle disconnect and post-write delay values are fixed in code and are not user-configurable.
