A simple Prometheus exporter for exporting values from the Raspberry Pi SenseHat.
- Raspberry Pi (3/3+/4)
- Rasperry Pi SenseHat
git clone https://github.com/epleterte/sensehat-exporter.git
cd sensehat-exporter
pip3 install -r requirements.txt
sudo cp sensehat-exporter.py /usr/local/bin/sensehat-exporter
# start sensehat-exporter!
sensehat-exporter
cp sensehat-exporter.service.example /etc/systemd/system/sensehat-exporter.service
systemctl daemon-reload
systemctl start sensehat-exporter
systemctl enable sensehat-exporter
usage: simpleexporter.py [-h] [--port [PORT]] [--bind [BIND]]
optional arguments:
-h, --help show this help message and exit
--port [PORT] The TCP port to listen on (default: 9101)
--bind [BIND] The interface/IP to bind to (default: 0.0.0.0)
--orientation Enable 'orientation' data (roll, yaw, pitch)
Currently there are no other configuration than options IP/port and no configuration file.
In /etc/prometheus/prometheus.yml, Add a static scrape target under scrape_configs
:
scrape_configs:
- job_name: 'sensehat'
static_configs:
- targets: ['<ip>:9101']
- Upload example Grafana dashboard
- Export more sensor data - currently only temperature, humidity and pressure is exported.
- Possibly make additional sensors configurable.
Here's a screenshot of the data being put to use in a Grafana dashboard:
This software is licensed under the ISC license.