Here is how to build a Prometheus Dashboard showing the temperature and humidity in your home. This projcet leverages Phidgets (single-board computer + sensors) and another computer running Debian.
- Phidgets Humidity/Temperature Sensor - the sensor that will measure temperature and humidity
- PhidgetSBC4 - an armhf Debian Bullseye running on a tiny Allwinner A20 Dual-Core ARM Cortex-A7
flask
prometheus_client
Phidget22
The prom.py
file stitches the Promethous gauge and the Phidgets libraries. This exposes a /metrics
endpoint from where a Prometheus server can scrape metrics.
Prometheus is a free software application used for event monitoring and alerting. Install it on a server (more powerful than the Phidgets SBC), which is on the same network (tailscale) as your Phidgets SBC. This machine will be performing periodic HTTP GET calls to the Phidgets SBC box.
- Install Prometheus
- Configure it:
$ cat /etc/prometheus/prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets:
- 1.2.3.4:5000
- Connect to the Prometheus server: http://your-prometheus-server:9090/
- Query for Humidity and Temperature