Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

A module for the MagicMirror to display a location's air quality index.
https://github.com/CFenner/MMM-AirQuality

air-quality magic-mirror-modules magicmirror

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=CFenner_MMM-AirQuality&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=CFenner_MMM-AirQuality)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=CFenner_MMM-AirQuality&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=CFenner_MMM-AirQuality)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=CFenner_MMM-AirQuality&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=CFenner_MMM-AirQuality)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=CFenner_MMM-AirQuality&metric=bugs)](https://sonarcloud.io/summary/new_code?id=CFenner_MMM-AirQuality)
[![All Contributors](https://img.shields.io/github/all-contributors/CFenner/MMM-AirQuality/main)](#contributors-)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://choosealicense.com/licenses/mit/)

# MMM-AirQuality

A module for the [MagicMirror](https://github.com/MagicMirrorOrg/MagicMirror) to display a location's [*air quality index*](https://en.wikipedia.org/wiki/Air_quality_index) using data from [aqicn.org](http://aqicn.org/here/).

## Preview

![preview](.github/preview-unhealthy.png)

with header and location

![preview](.github/preview-good.png)

without any header

![preview](.github/preview-very-unhealthy.png)

## Usage

You need to install and configure the module for your MagicMirror.

### Setup

Clone the module into your modules folder:

```shell
cd ~/MagicMirror/modules && git clone https://github.com/CFenner/MMM-AirQuality
```

### Configuration

Add the module configuration to your `config.js` file.

```js
{
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](https://aqicn.org/data-platform/token/).

### Location

Determine the station you want to display by selecting a station on the [map](https://aqicn.org/here/).

#### Using Station Names

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

#### Third-Party Sensors

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//?token=`.

#### Using GPS Coordinates

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.

### Further Options

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

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

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Justin Cherniak
Justin Cherniak

💻
Bogdan Mihai Nicolae
Bogdan Mihai Nicolae

📖

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!