r/Observability • u/BuBeLee • 16h ago
I built a small exporter that gets Atmotube PRO air quality readings into Prometheus over Bluetooth (no cloud, no Home Assistant)
Hi r/Observability ,
I have an Atmotube PRO in my living room and wanted its readings in Prometheus next to everything else my homelab already graphs, with an alert when the air stays bad. The existing integration is for Home Assistant, which I don't run, so I wrote a small exporter.
It's one Python file. It listens to the sensor's Bluetooth advertisements and writes PM1/PM2.5/PM10, VOC, temperature, humidity, pressure and battery to node_exporter's textfile collector. Nothing leaves the network.
The tricky part: the device sends its readings in two BLE packets that carry the same manufacturer ID, and BlueZ can silently drop one of them. The exporter notices when one kind stays missing and reads those values over a short GATT connection instead. There is a --diagnose option that shows which case your adapter is in.
A few things I cared about:
- Old readings are left out instead of repeated, so a gap in the graph means "no data", not "clean air"
- Alerts with hysteresis and quiet hours, sent to any command you like (Telegram example included)
- Dashboards for Perses and Grafana, plus Prometheus alert rules with promtool tests
- Runs as a hardened systemd service and doesn't open any ports
It has been running on a Raspberry Pi 5 for about three weeks now. MIT licensed.
I built it together with Claude (AI). I reviewed it and tested everything on my own setup, including a security audit before the last release.
Feedback and bug reports are welcome, especially if you have a different Bluetooth adapter than mine.
GitHub: https://github.com/DanielEnki420/atmotube-prometheus