This current iteration is using a NodeMCU ESP8266 board with a HC-SR501 PIR motion sensor and Bosch BME280, humidity, barometric pressure and ambient temperature sensor. I'm using MicroPython to export the metrics for a Prometheus server to scrape. Metrics are then graphed using a Grafana dashboard.
For more details about the project please have a look at my blog post
- tested on MicroPython v1.12
- I had to use mpy-cross to precompile the bme280_i2c library
Add a credentials.py file with the following contents:
wifi = {'SSID': 'NetworkName', 'pass': 'WifiPassword'}
Sample metric output
# HELP wifi_signal_rssi wifi signal rssi
# TYPE wifi_signal_rssi gauge
wifi_signal_rssi -78
# HELP temperature_celsius temperature in celsius from sensor
# TYPE temperature_celsius gauge
temperature_celsius 23.11
# HELP humidity_relative relative humidity percentage from sensor
# TYPE humidity_relative gauge
humidity_relative 33.8945
# HELP pressure_pascal absolute barometric pressure in pascal from sensor
# TYPE pressure_pascal gauge
pressure_pascal 99470
# HELP pir_motion_events PIR motion events
# TYPE pir_motion_events counter
pir_motion_events 443