mijia-homie

Mijia sensor to Homie bridge

crates.io page

mijia-homie is a service for connecting to Xiaomi Mijia 2 Bluetooth temperature/humidity sensors and publishing their readings to an MQTT broker following the Homie convention.

See the main project readme for more details and background.

Installation

It is recommended to install the latest release from our Debian repository:

$ curl -L https://homiers.jfrog.io/artifactory/api/security/keypair/public/repositories/homie-rs | sudo apt-key add -
$ echo "deb https://homiers.jfrog.io/artifactory/homie-rs stable main" | sudo tee /etc/apt/sources.list.d/homie-rs.list
$ sudo apt update && sudo apt install mijia-homie

Alternatively, you may install with cargo install, but that will require some more setup:

$ cargo install mijia-homie

Usage

If you have installed the Debian package, the service will be set up with systemd for you already. Otherwise, copy the mijia-homie binary to /usr/bin, copy debian-scripts/mijia-homie.service to /lib/systemd/system, create a mijia-homie user to run as, and create /etc/mijia-homie for configuration files.

There should be two config files under /etc/mijia-homie:

After editing these config files you will need to restart the service:

$ sudo systemctl restart mijia-homie.service

You may find it helpful to watch the logs to see whether it is managing to connect to your sensors:

$ sudo journalctl -u mijia-homie.service --output=cat --follow

Once it is running, try connecting to your MQTT broker with a Homie controller such as HoDD or openHAB to see your sensors.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.