This is a Homebridge plugin to provide for Xiaomi Mijia Thermometer(specifically LYWSD03MMC).
If you like this plugin, don't hesitate to "Star".
sudo npm i -g homebridge-mijia-thermometer@latest
These libraries and their dependencies are required by the Noble library and provide access to the kernel Bluetooth subsystem:
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
sudo yum install bluez bluez-libs bluez-libs-devel
sudo yum install systemd-devel
sudo yum provides */libudev.h
For more detailed information and descriptions for other platforms please see the Noble documentation.
Configuration on Homebridge Config UI X is supported.
Alternatively, you could update your Homebridge config.json
file according to these parameters.
Key | Default | |
---|---|---|
accessory |
MijiaThermometer |
Required. The name of this plugin. |
name |
Thermometer |
Required. The name of this accessory. This will appear in your Home app. |
address |
a0:c1:0c:d4:e1:6b |
Required. The address of the device. |
bindKey |
bhrthjb9mg4980hu80xvosbgzf1toh8p |
Required. The key to decyrpt BLE data. |
humidityName |
"Humidity" |
Optional. Name of the humidity sensor as it will appear in your Home app. |
temperatureName |
"Temperature" |
Name of the temperature sensor as it will appear in your Home app. |
lowBattery |
10 |
At what battery percentage Homekit should start warning about low battery. |
temperatureOffset |
0 |
An offset to calibrate temperature values if measured incorrectly. |
humidityOffset |
0 |
An offset to calibrate humidity values if measured incorrectly. |
post.
Version 1.6 supports to retrieve model, serial number and firmware revision via BLE advertisement.
Since information service is initialized before the Bluetooth scanner, so the information retrieved is cached into a file (stored at '~/.homebridge/.MijiaThermometer/') that will be loaded at the SECOND boot. So in order to make sure this function works well, it is highly suggested to reboot Homebridge after your device is connected and four of these following messages have been displayed in console.
Device Info cached!
- iOS 15
- Apple Home
- Homebridge 1.3.4 ( running on Centos 8 with Bluetooth Chip RTL8761B )
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.
Tutorial is listed in this git.
If you have any issue, contact me(f.tu@me.com) or just submit an issues.