cslev / MMM-AirQuality

A module for the MagicMirror, to display the current air quality index of a certain location.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's new compared to original project

Added header support to be more in line with other modules, specifically the weather module. Header can be disabled, then it works as the original module. If header is enabled, then location info goes into the header, and additional header string can be set.

Option Description
header Any header string you want. Default: 'Air quality'
headerNeeded true or false. Default: true

With header

With header

Without header (original layout)

Without header

AirQuality-Module for the MagicMirror

MagicMirror Project on Github | Air Quality Index

bildschirmfoto 2016-03-31 um 23 08 38

Usage

You need to install the module for your MagicMirror.

Installation

Navigate into your MagicMirror's modules folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/CFenner/MMM-AirQuality

Configure the module in your config.js file.

Configuration

To run the module, you need to add the following data to your config.js file.

{
	module: 'MMM-AirQuality',
	position: 'top_center', // you may choose any location
	config: {
	  location: 'beijing' // the location to check the index for
	}
}

Location

Use the part behind http://aqicn.org/city/ for your location. For example http://aqicn.org/city/netherland/utrecht/griftpark/ would be:

location: 'netherland/utrecht/griftpark/'

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

Option Description
location The location for that you you want to show the air quality.

This is REQUIRED.
lang change the language

This is OPTIONAL.
Default value: en
updateInterval change the update period in minutes

This is OPTIONAL.
Default value: 30 (minutes)
showLocation toggle location printing

This is OPTIONAL.
Default value:true
showIndex toggle index printing

This is OPTIONAL.
Default value:true

Known Issues

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/).

About

A module for the MagicMirror, to display the current air quality index of a certain location.

License:MIT License


Languages

Language:JavaScript 100.0%