Coder Social home page Coder Social logo

airgradient-prom-flask's Introduction

Airgradient Prometheus Flask App

Airgradient is an open air quality monitoring solution with DIY offerings utilising an ESP8266 microcontroller.

The example DIY code defaults to sending metrics to Airgradient.

airgradient.py

This is a very simple (probably bad!) Flask app to act as a receiver for Airgradient metrics for those who change APIROOT in the root to point to this app (as long as it's accessible).

Prometheus can then be configured to collect metrics using the exporter at /metrics.

The app should work with multiple devices.

Metrics and Labels

The metrics received are

  • atmp: Temperature
  • rhum: Humidity
  • wifi: Wifi signal strength
  • pm02: Particulate Matter (PM2.5)
  • rco2: CO2

Each metric has an associated label of device_id to help identify metrics for a specific device.

Testing

Run via flask in a local dev environment with eg. DEBUG=true python -m flask --app airgradient --debug run --host 0.0.0.0.

If you use WSL2 then look at port forwarding to WSL with netsh.

Docker

In project root directory you can build the image with docker -t <tag> build . then run with eg. docker run -it.

airgradient-prom-flask's People

Contributors

mcjoppy avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.