homebridge-mijia-thermometer-fix
TypeScript icon, indicating that this package has built-in type declarations

1.7.6 • Public • Published

Homebridge Mijia Thermometer Plugin

npm github license donate donate-alipay

This is a Homebridge plugin to provide for Xiaomi Mijia Thermometer(specifically LYWSD03MMC).

If you like this plugin, don't hesitate to "Star".

Installation

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:

Ubuntu/Debian/Raspbian

sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev

Fedora/CentOS/Other-RPM based

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

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.

Getting BindKey

post.

Automatically Retrieved Model, Serial Number and Firmware Revision

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!

Tested On

  • iOS 15
  • Apple Home
  • Homebridge 1.3.4 ( running on Centos 8 with Bluetooth Chip RTL8761B )

Other issues

Running without root/sudo (Linux-specific)

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.

Using Bluetooth 5.0 USB Dongle with RTL8761B chipset on Linux kernel 5.10

Tutorial is listed in this git.

Troubleshooting

If you have any issue, contact me(f.tu@me.com) or just submit an issues.

Package Sidebar

Install

npm i homebridge-mijia-thermometer-fix

Weekly Downloads

5

Version

1.7.6

License

Apache-2.0

Unpacked Size

81.3 kB

Total Files

25

Last publish

Collaborators

  • arch-storm