/MMM-AirQuality

A module for the MagicMirror to display a location's air quality index.

Primary LanguageJavaScriptMIT LicenseMIT

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. Select a station on the map and copy the location part from the URL. For example http://aqicn.org/city/netherland/utrecht/griftpark/ would be netherland/utrecht/griftpark/.

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.

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) to set location. Please verify data retrieval by visiting https://api.waqi.info/feed/<provide station Id>/?token=<provide your token>.

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

💻

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