This a module for the MagicMirror.
MagigMirror module to get the Air Quality Index (AQI) using the World Air Quality Index project API.
git clone https://github.com/ryck/MMM-AQI.git
cd MMM-AQI
npm install
The entry in config.js
can include the following options:
Option | Description |
---|---|
token |
Required Your private API token (see aqicn.org/data-platform/token/) Type: string |
city |
Required Name of the city (eg beijing), or id (eg @7397). You can also use the keyword here to use geolocation to get your cityType: string Possible values: here for geolocation, nameOfCity or @id Default value: here |
iaqi |
Display individual AQI for all pollutants (PM2.5, PM10, NO2, CO, SO2, Ozone) Type: boolean Possible values: true or false Default value: true |
updateInterval |
How often the data is updated. (Milliseconds) Type: integer Default value: 30 * 60 * 1000 (Half hour) |
initialLoadDelay |
The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) Type: integer Possible values: 1000 - 5000 Default value: 0 |
animationSpeed |
Speed of the update animation. (Milliseconds) Type: integer Possible values: 0 - 5000 Default value: 1000 (1 second) |
debug |
Show debug information. Type: boolean Possible values: true or false Default value: false |
Here is an example of an entry in config.js
{
module: 'MMM-AQI',
position: 'bottom_left',
header: 'Air Quality Index (AQI)',
config: {
token: "demo",
city: "here",
iaqi: true,
updateInterval: 30 * 60 * 1000, // Every half hour.
initialLoadDelay: 0,
animationSpeed: 1000,
debug: false
}
},
- request (installed via
npm install
)
- The World Air Quality Index project for providing the API.
- Nick Wootton for the MMM-UKLiveBusStopInfo module, which I used as reference.
- Nigel Daniels for the MMM-Tube-Status module, which I used as reference.
- Michael Teeuw for the MagicMirror2 framework that made this module possible.
- Transport for London for the guides and information they publish on their API.