Capture sensor data from Xiaomi thermometers (via BLE) and expose it as prometheus metrics

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

Owner
Daniel Kertesz
DevOps Engineer and hobbyist programmer.
Daniel Kertesz
Similar Resources

A simple network analyzer that capture http network traffic

A simple network analyzer that capture http network traffic

httpcap A simple network analyzer that captures http network traffic. support Windows/MacOS/Linux/OpenWrt(x64) https only capture clienthello colorful

Oct 25, 2022

Home Assistant screenshot capture web server suitable for e-ink displays

hass-shooter hass-shooter is a Home Assistant screenshot capture web server suitable for e-ink displays. Dependencies Chromium ImageMagick Installatio

Jan 28, 2022

GRPC - A client-server mockup, using gRPC to expose functionality.

gRPC This is a mockup application that I built to help me visualise and understand the basic concepts of gRPC. In this exchange, the client can use a

Jan 4, 2022

Port-proxy - Temporary expose port for remote connections

Port proxy util Temporary expose port for remote connections. E.g. database/wind

Jan 27, 2022

Capdns is a network capture utility designed specifically for DNS traffic. This utility is based on tcpdump.

Capdns is a network capture utility designed specifically for DNS traffic. This utility is based on tcpdump.

Capdns is a network capture utility designed specifically for DNS traffic. This utility is based on tcpdump. Some of its features include: Unde

Feb 26, 2022

Telemetry interfaces for logs and metrics allowing complete decoupling of instrumentation implementations.

Telemetry This package provides a set of Telemetry interfaces allowing you to completely decouple your libraries and packages from Logging and Metrics

Aug 9, 2022

Http-server - A HTTP server and can be accessed via TLS and non-TLS mode

Application server.go runs a HTTP/HTTPS server on the port 9090. It gives you 4

Feb 3, 2022

Observe host metrics collector Written in Go

Observe Host Metrics Collector Experimental collector and forwarder of host metr

Jan 4, 2022

A tool based on eBPF, prometheus and grafana to monitor network connectivity.

A tool based on eBPF, prometheus and grafana to monitor network connectivity.

Connectivity Monitor Tracks the connectivity of a kubernetes cluster to its api server and exposes meaningful connectivity metrics. Uses ebpf to obser

Dec 8, 2022
Prometheus exporter for ping metrics such as RTT, packet loss, and jitter to any number of hosts.

ping_exporter Command ping_exporter provides a Prometheus exporter for ping metrics such as RTT, packet loss, and jitter to any number of hosts. Usage

Sep 24, 2022
Monitors the expiry time of tls certificates and exports prometheus metrics

Certificate Monitor Monitors the expiry time of tls certificates and exports prometheus metrics. Target domains can be automatically discovered via in

Feb 7, 2022
🦈 Prometheus exporter for pcap metrics

pcap-exporter ?? Prometheus exporter for pcap metrics Usage

Jun 5, 2022
Traefik - Traefik with zitifed prometheus metrics
Traefik - Traefik with zitifed prometheus metrics

Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer th

Jan 17, 2022
Capture packet request/response pairs for a port and/or IP to aid in Network protocol based Nuclei Templates creation.

network-fingerprint Capture packet request/response pairs for a port and/or IP to aid in Network protocol based Nuclei Templates creation. Resources I

Nov 15, 2022
Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, and replay on the go.
Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, and replay on the go.

Features • Installation • Usage • Running Proxify • Installing SSL Certificate • Applications of Proxify • Join Discord Swiss Army Knife Proxy for rap

Jan 8, 2023
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

frp README | 中文文档 What is frp? frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it s

Jan 5, 2023
A TCP proxy used to expose services onto a tailscale network without root. Ideal for container environments.

tailscale-sidecar This is barely tested software, I don't guarantee it works but please make an issue if you use it and find a bug. Pull requests are

Dec 30, 2022
4chain is a simple、fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet.

4Chain What is 4chain? 4chain is a simple、fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. Using the ssh

Nov 1, 2022
dumpr! is a tool to capture text based tcp traffic from the receivers point of view.
dumpr! is a tool to capture text based tcp traffic from the receivers point of view.

dumpr! dumpr! is a tool to capture text based tcp traffic. The project came about for the need to capture a web request from the back end. It was also

Dec 4, 2021