Skip to content

Prometheus exporter for an Ambient Weather station as reported from their API

License

Notifications You must be signed in to change notification settings

dmerrick/ambient-weather-exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ambient-weather-exporter

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.

Libraries

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).

What it looks like

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?)

How to use

  • 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

Docker Pulls

Then configure Prom to scrape it every 60 seconds.

Alternative approaches

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.

About

Prometheus exporter for an Ambient Weather station as reported from their API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 83.8%
  • Dockerfile 16.2%