Additional Module for MagicMirror² https://github.com/MichMich/MagicMirror
Please note - I no longer run a MagicMirror, so this module is no-longer supported. Feel free to fork and update as necessary.
API has changed - Please note that the API now charges.
This module displays current and max UV levels for a given latitude & longditude from https://www.openuv.io
Git clone from this repository into the modules sub-directory of the Magic Mirror installation, change directory into the newly cloned code and then run npm install.
git clone https://github.com/nwootton/MMM-UVData.git
cd MMM-UVData
npm install
To use this module, add it to the modules array in the config/config.js
file:
modules: [
{
module: 'MMM-UVData',
position: 'bottom_left',
header: 'UV Levels For Today', //Optional - delete this line to turn OFF the header completely
config: {
lat: '51.508', // Latitude
lng: '-0.1617', // Longditude
api_key: '', // OpenUV API access key
alt: '' // Optional - altitude in m. If not supplied will default to 0m or sea level
}
},
]
There are 3 MANDATORY fields - lat
, lng
and api_key
.
Please see the OpenUV API documentation here
Option | Required Settings Description |
---|---|
lat |
Numeric. The latitude of the location for the UV measurement This value is REQUIRED Example: 51.508 |
lng |
Numeric. The longditude of the location for the UV measurement This value is REQUIRED Example: -0.1617 |
api_key |
String. Your OpenUV API api_key Get yours here. This value is REQUIRED Example: z9307fd87b0000c107e098d5effedc97 |
Option | Optional Settings Description |
---|---|
alt |
Numeric. Altitude in metres of the location for the UV measurement. If NOT supplied the API will assume 0m (sea level). Example: '22.4' |
showOzone |
Boolean. Display Ozone levels measured in Dobson Units (du). Default: true |
To setup an account for the Api_key sign up for an account here: https://www.openuv.io/
This is my first module that includes translations. I've included English and German, but the German is purely a Google Translate of the English, so I apologise to any German speakers! Feel free to add additional languages and to change or ping me with corrections.
If there are issue getting data out of the module I'm ALWAYS going to ask the following:
- Do you have an account set up at OpenUV.io
- Do you have an api_key set up?
- Do you know the Lat & Long for the location?
- If you use the live api documentation here and put in the info you want to use does it respond without an error?
- Is the info in your config the same as that you’ve used successfully in the live api docs?
- Include the lat, long & alt in the report.