a homebridge(https://github.com/nfarina/homebridge) plugin that get Xiaomi GAP Sensor temperature & humidity.
BLE device can only be supported by Raspberry Pi 3. If you want to make sensor work with other hardware running homebridge, please try to install a bluetooth dongle and make sure it's working properly. Following is the procedure for Pi 3 users:
-
sudo apt-get install libbluetooth-dev
-
sudo npm install -g --unsafe-perm noble
-
sudo apt-get install libcap2-bin
-
Run following command:
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)- Install homebridge-xiaomi-gap-sensor and config homebridge plugin.
sudo npm install -g homebridge-xiaomi-gap-sensor
You need to add this configuration to homebridge.
"accessories": [{
"accessory" : "XiaomiGAPSensor",
"name" : "Mi Temperature and Humidity Monitor",
"address" : "<mac-address>",
"version" : "1.0.1",
"scanning": true
}]
To find the mac address use the following command.
# node /usr/lib/node_modules/homebridge-xiaomi-gap-sensor/scan.js
This sensor is fully supported in normal operation. The plugin is able to read Temperature, Humidity and battery levels from frames.
1.fix name.
1.fix bug.
1.publish to www.npmjs.com.
1.get Xiaomi GAP Sensor temperature, humidity & battery.