Skip to content

Push metrics from a BME280 sensor to Prometheus' Pushgateway

License

Notifications You must be signed in to change notification settings

cosandr/prometheus-d1mini-bme280

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Push metrics from BME280 sensor to Prometheus' Pushgateway

Intended to be used on battery power, device goes into deep sleep between pushes.

Metrics

Metric Description Unit
iot_up Status and metadata
iot_humidity Air humidity. %
iot_temperature Air temperature. °C
iot_pressure Air pressure. Pa
iot_heat_index Apparent air temperature, based on temperature and humidity. °C
iot_dew_point Dew point, based on temperature and humidity. °C

Requirements

Hardware

  • ESP8266-based board (or some other appropriate Arduino-based board).
    • Tested with "WEMOS D1 Mini".
  • BME280 sensor.

Software

Variables

  • URLPushgateway server, no trailing slash
  • COMPUTE_HEAT_INDEX set to 0 to disable heat index compute, will return NaN
  • COMPUTE_DEW_POINT same but for dew point
  • PUSH_INTERVAL sets push interval (sleep duration) in seconds
  • USE_DEEP_SLEEP use deep sleep instead of turning wifi off

Building

Hardware

If using deep sleep, you will need to wire D16 to RST so the chip can wake itself up.

Software

Using PlatformIO (VSCode).

Create .env file and source it

export WIFI_SSID=""
export WIFI_PASSWORD=""

On Windows create .env.ps1

$env:WIFI_SSID=""
$env:WIFI_PASSWORD=""

Either build using the CLI, or export the variables and start VSCode.

Build

source .env
# On windows use
. .env.ps1
pio run -e bme01

Upload (also builds)

pio run -e bme01 -t upload

Monitor

pio device monitor -e bme01

Credits

HON95 for his Prometheus exporter homecircuits.eu blog

License

GNU General Public License version 3 (GPLv3).

About

Push metrics from a BME280 sensor to Prometheus' Pushgateway

Topics

Resources

License

Stars

Watchers

Forks