This adapter allows you to control your SwitchBot "Bot" and to monitor SwitchBot "Meter", "Contact" and "Motion" via Bluetooth (BLE).
If you are looking for Hub Plus/Mini support, this adapter is what you will need.
The models listed are those that I have in use myself.
These models are known to work, but I don't have them in use myself.
To use this adapter, you will need to already have ioBroker installed.
This adapter may only run on Linux-based operating systems, as the underlying library node-switchbot currently only supports Linux-based operating systems such as Raspbian and Ubuntu.
Before installing the adapter, you need to install some Linux libraries related to Bluetooth. These are as follows if the operating system is Ubuntu/Debian/Raspbian:
$ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
You also have to run the following command:
$ sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
This grants the node
binary cap_net_raw
privileges, so it can start/stop BLE advertising.
Note: The above command requires setcap
to be installed.
It can be installed the following way (e.g. Raspbian and Ubuntu):
$ sudo apt-get install libcap2-bin
See the documentation of @abandonware/noble for other details.
It is recommended to use version 16.x or 18.x of Node.js.
The minimum required version is 16.x, but support for this version may will be dropped soon.
$ cd /opt/iobroker/
$ npm install iobroker.switchbot-ble
If you use the "Bot" in "Switch Mode" the value of the state "control.inverseOnOff" should be the same as "Inverse the on/off direction" in the app. This cannot be synchronized automatically.
If the adapter no longer works, e.g. after a restart or system update, please try the following:
$ cd /opt/iobroker/node_modules/iobroker.switchbot-ble/
$ sudo rm -r node_modules/
$ npm install
$ sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
MIT License
Copyright (c) 2023 Sascha Hölzel mrb1232@posteo.de
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.