Categorygithub.com/piger/sensor-probe
modulepackage
0.1.3
Repository: https://github.com/piger/sensor-probe.git
Documentation: pkg.go.dev

# README

sensor-probe

Sensor Probe is a small utility that reads advertisement data sent by the Xiaomi Thermometer LYWSD03MMC via Bluetooth LE and expose them as Prometheus metrics.

This program currently only supports sensors flashed with the ATC_MiThermometer custom firmware and the "custom" data format; if you're using the other custom firmware you can probably just use Bluewalker to get your sensor data.

All the heavy lifting is done by Bluewalker since I couldn't find an easy way to read BLE events from Go and the BlueZ stack on Linux.

You should be able to find those Xiaomi sensors on AliExpress.

Configuration format

The configuration file is a simple TOML file:

[[sensors]]
    name = "bedroom"
    mac = "a4:c1:38:01:01:01"
    firmware = "custom"

[[sensors]]
    name = "studio"
    mac = "a4:c1:38:02:02:02"
    firmware = "custom"

Usage

First you need to bring down your Bluetooth device by running hciconfig:

sudo hciconfig hci0 down

Then you can start sensor-probe.

Credits

# Variables

Version is the version of this program, set at build time with -ldflags.