Bluetooth Plugins
Most Homebridge plugins that make use of Bluetooth use the @abandonware/noble package.
The rest of this guide is meant for users of plugins which use this package.
Here is a subset of some of the verified plugins which use @abandonware/noble
:
Plugin |
---|
homebridge-govee |
homebridge-switchbot |
If you are using a plugin which uses a different package for BLE connectivity, refer to the plugin-specific instructions/guides.
If the Bluetooth does not initially work then you may need to run these commands in the Homebridge terminal:
$ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev pi-bluetooth
$ sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
The second command may need to be run in a direct SSH terminal to the Pi rather than the terminal in the Homebridge UI. Don't be too concerned if it doesn't work.
$ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
$ sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
The second command may need to be run in a direct SSH terminal to the Pi rather than the terminal in the Homebridge UI. Don't be too concerned if it doesn't work.
Some plugins have reported success with BLE on macOS, others have reported no support.
The Bluetooth control may not work on the latest versions of macOS (even if noble
is correctly installed). It seems that no discovered devices are reported to the plugin, see noble issue #225.
See the noble documentation for instructions specific to your system.
For most systems, the Dbus socket is in /run/dbus
. The socket must be available in the container for a Homebridge plugin to be able to connect to Dbus and access the Bluetooth adapter. When starting with docker run, this can be accomplished by adding -v /run/dbus:/run/dbus:ro
to the command. If the Dbus socket is in /var/run/dbus
on the host system, use -v /var/run/dbus:/run/dbus:ro
instead.
If you are using Docker Compose, add something like the following (adjust as necessary) to your volumes section:
volumes:
- /run/dbus:/run/dbus:ro
Ref | Plugin | Issue | Description |
---|---|---|---|
1 | homebridge-switchbot | #425 | Docker/Noble Issue |
2 | homebridge-switchbot | #511 | Bluetooth HCI socket failing to download |
3 | homebridge-switchbot | #691 | 404 Error when installing and related system command failure |
4 | homebridge-switchbot | #713 | fails due to missing file |
- SSH into the server
cd /var/lib/homebridge/node_modules/@switchbot
- use
ls -a
to see all folders - due to the failed update you will most likely have 2 folders there, one has a dot at the beginning which makes it invisible (that's why you need to use ls -a). Rename both folders with
mv foldername foldername-backup
- open the Homebridge shell with
sudo hb-shell
- install the bluetooth-hci-socket manually via
npm i @abandonware/bluetooth-hci-socket
. This will remove some SwitchBot Plugin files and folders, but don't worry. - After finishing the installation, exit the hb-shell via
exit
- The folder with the dot at the beginning needs to be renamed to homebridge-switchbot with
mv .foldername-backup homebridge-switchbot
- Reboot time ->
sudo reboot
- Use the Homebridge UI to update the Switchbot plugin and afterwards use ssh to restart the server again.
- Done
- @pmcdowall A workaround I found is by Installing Bluetooth tools in DSM as referred to here.
- SSH into my Synology NAS and then;
sudo hb-shell cd /volume1/homebridge/ npm i @abandonware/bluetooth-hci-socket npm i @abandonware/noble
Exit the shell, return to Homebridge UI and update Switchbot.
-
In case anyone else is running into this issue and the fixes above didn't work for them, reinstalling Entware and the native BLE build dependencies did the trick for me.
-
It seems that sometime between my initial installation of the plugin and the most recent updates, something broke in my Entware environment that made the bluetooth-hci + noble builds fail.
- Raspberry Pi
- Debian, Ubuntu
- CentOS, Fedora, Red Hat
- Arch, Manjaro
- macOS
- Windows 10 / 11 (Hyper-V)
- Docker
- Synology DSM 7
- Other Platforms
- Basic Troubleshooting
- Backup and Restore
- Child Bridges
- Config File
- Connect To HomeKit
- FFmpeg for Homebridge
- HomeKit Glossary of Terms
- iOS Homemanager App
- mDNS Options
- Remote Access
- Useful Links
- Basic Troubleshooting
- Config Options
- Enabling Accessory Control
- Enabling UI with Docker
- Homebridge Service Command
- Manual Configuration
- Reverse Proxy: Apache
- Reverse Proxy: Nginx and SSL
- Standalone Mode
- Swap From Standalone To Service Mode
- Developer Docs
- API Reference
- Plugin Templates
- Other Links (Internal)
- Other Links (External)