A module for the MagicMirror to display a location's air quality index using data from aqicn.org.
with header and location
without any header
You need to install and configure the module for your MagicMirror.
Clone the module into your modules folder:
cd ~/MagicMirror/modules && git clone https://github.com/CFenner/MMM-AirQuality
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
}
},
To use the WAQI API you need to request a token.
Determine the station you want to display by selecting a station on the map.
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/
.
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>
.
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.
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 |
- Due to the AQI rendering script it is not possible to have multiple instances of this module running.
- There is a bug in the skript that prevent some locations from being displayed (e.g. 'Mannheim').
- Not all languages may be supported (see: http://aqicn.org/faq/2015-07-28/air-quality-widget-new-improved-feed/).
Thanks goes to these wonderful people (emoji key):
Justin Cherniak 💻 |
Bogdan Mihai Nicolae 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!