Sign inSign up

kovacsguido/ble2mqtt

By kovacsguido

•Updated over 6 years ago

Image
1

1.9K

kovacsguido/ble2mqtt repository overview

⁠About

This is a simple scheduled python script in the a Docker image and runs every 5 minutes. The script polls the Xiaomi BLE Temperature and Humidity sensors and publishes the measurements to the specified MQTT.

⁠Installation

⁠Prerequisites

Need install the Docker (and optionally the Docker compose).

⁠Clone the project:
    git clone https://[email protected]/kovacsguido/docker-xiaomi-ble-to-mqtt.git
⁠Build and start the container:

Execute the follow command:

    docker-compose up -d
⁠Configure the MQTT broker

The container creates two configuration files at first run. These two files is the devices.ini and the mqtt.ini. Please fill in the mqtt.ini file based on the sample content!

⁠Scan for available Xiaomi BLE devices:

Enter the container and search the available devices.

    dokcer-compose exec ble2mqtt /bin/bash
    hcitool lescan

Look for line which looks like this:

    4C:65:A8:D4:A3:1D MJ_HT_V1

Make a note of the sensors' MAC address.

⁠Set the sensor data

Open the devices.ini and enter the data of devices based on the sample content.

Tag summary

Content type

Image

Digest

Size

180.7 MB

Last updated

over 6 years ago

docker pull kovacsguido/ble2mqtt