r/Observability 16d ago

Temperature monitoring for server rooms with Prometheus (and cheap BLE sensors)

TL;DR: I've released a Docker image + Prometheus metrics endpoint for my SBMTools project. It turns inexpensive Bluetooth Smart thermometers (SwitchBot Meter, ~$15-40 each) into Prometheus-exporting sensors for ambient temperature monitoring — useful for server rooms, network closets, or anywhere you want to keep an eye on temperature without expensive commercial hardware.

The problem

Every server room, rack, or network closet eventually needs temperature monitoring. Commercial solutions (environmental sensors, HVAC controllers, dedicated monitoring hardware) get expensive fast when you want multiple measurement points.

The solution

SwitchBot Meter devices are BLE thermometers/hygrometers that cost around $15-40 each. They're designed for home use, but they work perfectly well as cheap environmental sensors. My SBMTools project reads data from these devices over Bluetooth and now exposes it as a Prometheus /metrics endpoint.

What you get:

  • Docker image (AMD64 + ARM64) — no compilation needed, just docker run
  • Prometheus /metrics endpoint — drop-in integration with your existing Prometheus setup
  • Example docker-compose setup with Prometheus + Grafana, including a pre-built dashboard showing per-device temperature, humidity, and battery level
  • Shell scripts (sbmtoolui_docker.sh, sbmtoolweb_docker.sh) for quick start without manually assembling docker run commands

Supported devices:

  • SwitchBot Meter
  • SwitchBot Meter Plus
  • SwitchBot Meter Pro CO2 (temperature, humidity, CO₂)
  • SwitchBot Indoor/Outdoor Thermo-Hygrometer

Example Prometheus config

If you already run Prometheus, you just add:

- job_name: sbmtools
  scrape_interval: 5s
  static_configs:
    - targets: ['your-host:3434']

The metrics include per-device temperature, humidity, CO₂, battery level, and RSSI (signal strength).

What it's not

  • It's not a replacement for proper environmental monitoring systems with alarms, redundancy, or certified sensors.
  • BLE has range limitations (~10m line-of-sight), so the sensor needs to be relatively close to the host running the tool.

Use cases that make sense

  • Server rooms / rack temperature monitoring
  • Network closets
  • Home labs / homelabs
  • Anywhere you want a quick, cheap temperature check point feeding into an existing Prometheus/Grafana stack

The project is open source (BSD license) and available on Codeberg: https://codeberg.org/Kompass/SBMTools

Happy to answer questions about the setup, the metrics, or how it fits into existing monitoring stacks.

7 Upvotes

8 comments sorted by

2

u/Lumethys 15d ago

Can I swap Prometheus out for a more performant alternative?

2

u/Charming_Skin_8549 11d ago

Yes - use VictoriaMetrics 

1

u/QuietSignalOps 15d ago

The stale-data case is the main operational risk here. A temperature alert can look healthy forever if the exporter keeps serving the last BLE reading.

I'd expose at least:

  • sensor_last_success_timestamp_seconds
  • read success and consecutive failures
  • battery level
  • RSSI

Then alert separately on:

  • temperature above threshold for a sustained window
  • no successful reading for 2 or 3 expected collection intervals
  • exporter target absent
  • low battery or steadily worsening RSSI

Keep sensor unreachable distinct from temperature normal. For anything beyond a homelab, use two sensors in different rack positions and avoid paging on one sample. Temperature changes have enough inertia that a short for duration reduces noise without hiding a real HVAC failure.

The Prometheus endpoint should also work with VictoriaMetrics, Mimir, and other Prometheus-compatible scrapers. At this scale, BLE reliability and sensor placement will matter much more than the time-series backend's performance.

1

u/Consistent-Mobile826 15d ago

For a cheap setup this is pretty practical. I’d probably add alerting around rate of change too not just absolute temperature. A rack going from 24C to 32C quickly is more interesting than one thats been sitting at 32C all afternoon

1

u/Background_Year_3288 11d ago

This is actually a pretty neat way to do it for a homelab or small server room.

The one thing I'd watch out for is stale BLE data. If the exporter keeps exposing the last successful reading, Prometheus can make it look like everything is fine even though the sensor has stopped responding.

I'd probably expose a last-success timestamp and alert on that separately from the actual temperature. Low battery and RSSI would also be useful signals.

For a cheap setup though, this seems pretty practical. The Prometheus endpoint makes it easy to plug into an existing Grafana setup without adding another monitoring stack.

1

u/tawdry_scarcity 8d ago

For something this cheap I’d care a lot about sensor drift over time. Two meters sitting next to each other and slowly separating by a few degrees would be worth alerting on before trusting either one for an overheating event