Prometheus exporter for an Ambient Weather station as reported from their API
This is a fork of trickv/ambient-weather-exporter. @trickv deserves credit. This fork removes Celsius support and but should support more models of weather stations.
Almost all of this code is just binding together two things:
- ambient_api - a Python library which interfaces with the Ambient Weather API
- prometheus/client_python - lets me register a series of metrics and runs a simple web server exposing the data read from Ambient as Prometheus metrics.
I use Docker to run this "in production" so there's a Dockerfile too, and [](builds on Docker Hub).
You came for a graph, so here's one where you can clearly see that my weather station is not mounted properly (the wind is always coming from ~270 degrees?)
- Get an API key from Ambient Weather.
- Use my Application Key (67a05cffa31946ad9f15ffbc0cbecdcf2e933d488eaa49ef84c8d40f566a0bcb) from Ambient below
- Run it with Docker
docker run -d --restart=unless-stopped -e AMBIENT_API_KEY=yourkey -e AMBIENT_APPLICATION_KEY=67a05cffa31946ad9f15ffbc0cbecdcf2e933d488eaa49ef84c8d40f566a0bcb -p 8000:8000 trickv/ambient-weather-exporter:latest
Then configure Prom to scrape it every 60 seconds.
Ideally, I'd rather get this data directly from the base station which sits in my house so that I'm not beholden to Ambient Weather's infrastructure. But I haven't found a way to do that.