A module for the MagicMirror² to display air quality and Pollen information using data from the ambee API. This module provides real-time air quality index (AQI), other pollutants and pollen related data.
Just clone the module into your modules directory:
cd ~/MagicMirror/modules
git clone https://github.com/PierreGode/MMM-airquality
Just enter the module's directory and pull the update:
cd ~/MagicMirror/modules/MMM-NHL
git pull
To use this module, you need to configure it in your config.js file of MagicMirror.
You can obtain an API key from ambee API
Here is an example of the configuration:
{
module: "MMM-airquality",
position: "bottom_right", // Choose any position you´d like
config: {
apiKey: "YOUR_AMBEE_API_KEY", // Replace with your Ambee API Key
latitude: "59.3293", // Latitude of your location (Stockholm in this example)
longitude: "18.0686", // Longitude of your location
showPM10: true, // Show PM10 data
showPM25: true, // Show PM2.5 data
updateInterval: 3600000, // Update every hour ( ambee has 100 calls a day. and app uses 3 endpoints so lowest updateInterval is : ~2,618,181 milliseconds (about 43.6 minutes). )
animationSpeed: 1000, // 1 second for DOM animations
showPollenForecast: true, // Control pollen forecast display
showGrassPollen: true, // Option to show or hide Grass pollen
showTreePollen: true, // Option to show or hide Tree pollen
showWeedPollen: true, // Option to show or hide Weed pollen
debug: false // Set to true to enable logging for debugging
},
},
Option | Description |
---|---|
apiKey |
Required: Your AirVisual API key. Get it from here. |
latitude |
Required: Your location's latitude. Example: "59.3293" for Stockholm. |
longitude |
Required: Your location's longitude. Example: "18.0686" for Stockholm. |
showPM10 |
Show or Hide ( true : false ) PM10 data. |
showPM25 |
Show or Hide ( true : false ) PM10 data. |
[ERROR] [MMM-airquality] Error fetching pollen data: 422:
This will mean that you have reached your 100 daily API call limmit. try setting updateInterval: to a higher number.