Weather chart module for the magic mirror 2 project
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit 96a427e Jan 18, 2018

README.md

Magic Mirror Module: mmm-weatherchart

This MagicMirror2 module allows you to show a weather diagram provided by http://www.yr.no

Screenshot

Installation

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/paphko/mmm-weatherchart.git

Configure the module in your config.js file.

Using the module

To use this module, you must first determine country, area, and city:

  1. go to http://www.yr.no
  2. enter your location into the search field at the top and select your city
  3. at the top-right, switch language to English
  4. write down country, area, and city from the current URL, e.g.: http://www.yr.no/place/Germany/North_Rhine-Westphalia/Duisburg/

Now add the module to the modules array in the config/config.js file:

modules: [
	{
		module: 'mmm-weatherchart',
		position: 'bottom_left', // this can be any of the regions
		config: {
			country: 'Germany', // as determined above
			area: 'North_Rhine-Westphalia', // as determined above
			city: 'Duisburg', // as determined above
			updateInterval: 60 * 60 * 1000, // update every hour
			hideBorder: true, // whether or not a border with city name should be shown
			negativeImage: true, // whether or not the default white image should be inverted
			// mmDirectory: "/home/pi/MagicMirror/" // required for caching; adjust if it differs
		}
	},
]

Configuration options

The following properties can be configured:

Option Description
country Your country as determined above
area Your area as determined above
city Your city name as determined above
updateInterval Update interval of the diagram.
Default value: 60 * 60 * 1000 (once every hour)
hideBorder Wheather or not a border with city name should be shown.
Default value: true
negativeImage Wheather or not the white image should be inverted.
Default value: true
mmDirectory To avoid the image to be cached by the browser (issue #5), it is downloaded into the magic mirror / modules / mmm-weatherchart / cache folder. I couldn't find a way to ask MM for this path, so I just hard-coded it here with the possibility to adjust it in case your installation looks different.
Default value: /home/pi/MagicMirror/