CFenner / MMM-AirQuality

A module for the MagicMirror to display a location's air quality index.
MIT License
35 stars 15 forks source link
air-quality magic-mirror-modules magicmirror

Maintainability Rating Reliability Rating Security Rating Bugs All Contributors License

MMM-AirQuality

A module for the MagicMirror to display a location's air quality index using data from aqicn.org.

Preview

preview

with header and location

preview

without any header

preview

Usage

You need to install and configure the module for your MagicMirror.

Setup

Clone the module into your modules folder:

cd ~/MagicMirror/modules && git clone https://github.com/CFenner/MMM-AirQuality

Configuration

Add the module configuration to your config.js file.

{
  module: 'MMM-AirQuality',
  position: 'top_center',
  config: {
    token: 'ADD_YOUR_TOKEN_HERE',
    location: 'germany/hamburg/sternschanze/' // the location to check the index for
  }
},

Token

To use the WAQI API you need to request a token.

Location

Determine the station you want to display by selecting a station on the map.

Using Station Names

If the selected station is a named station, e.g. http://aqicn.org/city/netherland/utrecht/griftpark/ use the name from the URL in your location variable. For the given example this would be netherland/utrecht/griftpark/.

Third-Party Sensors

If your station is affiliated with a third-party air sensor network, such as the uRad Monitor air quality sensor network, you are required to specify the station identifier (e.g., A129586) in your location variable. For the station https://aqicn.org/station/@63628/ this would be A63628, so just replace the @ with an A. Please verify data retrieval by visiting https://api.waqi.info/feed/<provide station Id>/?token=<provide your token>.

Using GPS Coordinates

You may also get the data for specific longitude and latitude. Set the location to geo:lat;lng/ and replace lat and lng with your values.

Further Options

You may want to set the following options in the config section as well:

Option Description Default Required
location The location for that you you want to show the air quality. x
lang change the language en
updateInterval change the update period in minutes 30
showLocation toggle location printing true
appendLocationNameToHeader If set to true, the returned location name will be appended to the header of the module. true
showIndex toggle index printing true

Known Issues

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Justin Cherniak
Justin Cherniak

💻
Bogdan Mihai Nicolae
Bogdan Mihai Nicolae

📖

This project follows the all-contributors specification. Contributions of any kind welcome!