Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 2.79 KB

README.md

File metadata and controls

58 lines (46 loc) · 2.79 KB

MMM-AQI

This a module for the MagicMirror.

MagigMirror module to get the Air Quality Index (AQI) using the World Air Quality Index project API.

Installation

git clone https://github.com/ryck/MMM-AQI.git
cd MMM-AQI
npm install

Config

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 city
Type: 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
			}
		},

Dependencies

  • request (installed via npm install)

Thanks To...