lywsd03mmc-scanner — Scanner with MQTT and Prometheus exporter for the LYWSD03MMC BLE thermometer
Heavily modifyed version of https://github.com/leahneukirchen/lywsd03mmc-exporter
lywsd03mmc-scanner is a small tool to scan and keep track of
Bluetooth beacons the LYWSD03MMC BLE thermometer sends periodically.
It can then be scraped by Prometheus as well as providing a MQTT client.
Prometheus Exposed metrics
thermometer_temperature_celsius{mac="...",sensor="LYWSD03MMC"} 25.9
thermometer_humidity_ratio{mac="...",sensor="LYWSD03MMC"} 53
thermometer_battery_ratio{mac="...",sensor="LYWSD03MMC"} 91
thermometer_rssi_dbm{mac="...",sensor="LYWSD03MMC"} -35
Additionally, the ATC_MiThermometer custom firmware exposes:
thermometer_battery_volts{mac="...",sensor="LYWSD03MMC"} 3.005
thermometer_frame_current{mac="...",sensor="LYWSD03MMC"} 165
MQTT Published State (JSON)
Name string
Address string
Counter uint8
BatteryPercentage float64
BatteryVoltage float64
TempCelcius float64
Humidity float64
Time time.Time
RSSI int
Modes of operation
Due to talking to lower levels of the Bluetooth stack,
lywsd03mmc-exporter needs to be run as root
or with CAP_NET_ADMIN.
You will also need to add the account to the bluetooth group.
Stock firmware
Not Supported
Custom firmware
@atc1441 wrote a custom firmware
for the LYWSD03MMC. It sends data unencrypted in beacons.
Negative temperatures are supported.
You can flash it easily with above TelinkFlasher.
This mode sends measurements every 10 seconds.
Copying
lywsd03mmc-scanner is licensed under the MIT license.
Thanks
This software would not be possible without the help of code and
documentation in: