All Projects → alsuren → mijia-homie

alsuren / mijia-homie

Licence: Unknown and 2 other licenses found Licenses found Unknown LICENSE Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
A Homie MQTT bridge for the Xiaomi Mijia 2 hygrometer-thermometer. This repo also serves as the monorepo for a handful of helper crates related to Homie and Bluetooth.

Programming Languages

rust
11053 projects
shell
77523 projects
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to mijia-homie

pyrinas-ble-client
nRF52 SDK(v16) based OS for use with Particle Xenon and other nRF52840 boards.
Stars: ✭ 15 (-62.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
ESP32BleAdvertise
Simple library for BLE advertise using ESP32 in Arduino
Stars: ✭ 39 (-2.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
SmartSpin2k
Transform your spin bike into a Smart Trainer!
Stars: ✭ 88 (+120%)
Mutual labels:  bluetooth, bluetooth-low-energy
daydream-node
Quick Node.js module to connect to the Daydream controller and receive all the data
Stars: ✭ 17 (-57.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
ios
CoThings's iOS application. CoThings is a realtime counter for shared things.
Stars: ✭ 13 (-67.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
SwiftyTeeth
A simple, lightweight library intended to take away some of the cruft and tediousness of using CoreBluetooth
Stars: ✭ 21 (-47.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
redux-bluetooth
Redux middleware to dispatch actions via bluetooth to a peripheral store
Stars: ✭ 17 (-57.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
DroneJS
A Node.js based library for controlling a Parrot minidrone. This library also provides the feature to take pictures from the drone, download them all at a time and delete them whenever required.
Stars: ✭ 19 (-52.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
BLELib
This library contains many of the features you need to interact with BLE peripherals
Stars: ✭ 21 (-47.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
PiBeacon
Low-cost iBeacon using Raspberry Pi
Stars: ✭ 41 (+2.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
pycalima
Python interface for Pax Calima Fan via Bluetooth LE
Stars: ✭ 34 (-15%)
Mutual labels:  bluetooth, bluetooth-low-energy
H.E.L.P.
Home Environment Locating People 🍍
Stars: ✭ 19 (-52.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble2mqtt
Bluetooth to MQTT bridge, add your bluetooth-capable (including controllable) devices to your smart home
Stars: ✭ 46 (+15%)
Mutual labels:  bluetooth, xiaomi
react-native-easybluetooth-classic
⚛ A Library for easy implementation of Serial Bluetooth Classic on React Native (Android Only).
Stars: ✭ 44 (+10%)
Mutual labels:  bluetooth, bluetooth-low-energy
BLE
No description or website provided.
Stars: ✭ 25 (-37.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
theheraldproject.github.io
Herald - Proximity Detection Protocol and research documentation, including the Fair Efficacy Formula
Stars: ✭ 17 (-57.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
home assistant-ble
Companion application for home-assistant, sending bluetooth low energy detection
Stars: ✭ 21 (-47.5%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble-serial
"RFCOMM for BLE" a UART over Bluetooth low energy (4.0+) bridge for Linux, Mac and Windows
Stars: ✭ 134 (+235%)
Mutual labels:  bluetooth, bluetooth-low-energy
mi-lamp-re
💡 Reverse Engineering Notes for the Yeelight Bedside Lamp (BLE)
Stars: ✭ 35 (-12.5%)
Mutual labels:  bluetooth, xiaomi
Mi Flower mate plugin
A plugin for Domoticz, the open source home automation software, which allows it to easily connect to Xiaomi Mi Flower Mate devices
Stars: ✭ 13 (-67.5%)
Mutual labels:  bluetooth-low-energy, xiaomi

About this project

This is a project for capturing BLE data from a Xiaomi Mijia 2 hygrometer-thermometer and publishing it. The repository includes a number of related crates:

  • mijia-homie, a service to connect to a number of Mijia sensors over BLE and publish their readings to an MQTT broker following the Homie convention.
  • homie-influx, a service to discover devices on an MQTT broker following the Homie convention and record their property value changes to an InfluxDB database.
  • homie-device, a library for implementing Homie devices.
  • homie-controller, a library for implementing Homie controllers.
  • mijia, a library for reading Mijia sensors.

The project originated from a blog post, and some ideas came from a Python utility for talking to the same sensors, especially this issue thread.

If you want a bit more back-story, there is also a slide deck.

Serving Suggestion

Setup

To run this code on your Raspberry Pi, you will need:

  • Some Xiaomi Mijia version 2 Bluetooth temperature and humidity sensors.
  • A working Rust toolchain and Docker on your laptop.
  • An MQTT broker to connect to (test.mosquitto.org works okay for testing, but you will want to deploy your own if you're monitoring your house).
  • Something to read the measurements from MQTT. Homie Device Discovery is probably easiest for debugging.

After following these steps, you should end up with something that looks like this:

System overview

  • Start by finding out which sensors you have:

    [email protected] EXAMPLE=list-sensors ./run.sh
    
  • Add each of the sensors to /home/pi/sensor-names.toml on the Raspberry Pi. Each line should be of the form:

    "A4:C1:38:D7:21:17"="Landing"
    

    If you don't know the sensor names yet, just make some names up for now.

  • You will also want to copy mijia-homie/mijia-homie.example.toml to /home/pi/mijia-homie.example.toml and edit it to suit your needs.

  • You should then be able to run the publisher using run.sh with default arguments:

    This will start the publisher under systemd and show you the logs.

  • It takes a while to connect to all of the sensors and start getting readings. Once everything is running, you can use HoDD to see your readings.

  • If everything is visible in HoDD then you can add other integrations. Anything that understands Homie should be able to read your sensors. OpenHAB is what we're using, but take a look at the Homie Implementations page and see if anything inspires you.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].