Coder Social home page Coder Social logo

mmm-yrthen's Introduction

MagicMirror² Module: YrThen

This is an unofficial Yr Weather Forecast module for MagicMirror², which displays data from Yr.

It is heavily based on MMM-YrNow, from Yr itself. Yr is a weather service from the Norwegian Broadcasting Corporation and the Norwegian Meteorological Institute.

This is work in progress, but as it stands right now it's working and covering my needs.

How to install

Remote into your Magic Mirror box using a terminal software and go to the modules folder:

cd ~/MagicMirror/modules

Clone the repository:

git clone https://github.com/fmandal/MMM-YrThen

Install dependencies:

    cd MMM-YrThen
    npm install request --save

Add the module to the modules array in the config/config.js file by adding the following section. You can change this configuration later when you see this works:

{
	module: 'MMM-YrThen',
	position: 'top_right',
	config: {
		location: '1-2820936',
	}
},

Find your location using the search form at this Yr.no page and look for the ID in the URL.

Configuration options

Option Comment Default
location The unique Id found in the Url of any location on Yr.no. Default location is Skrubblivegen in Steinkjer, Norway. (String) "1-2296935"
updateInterval How often to get new data. Defaults to 1 hour, as the weather forecast doesn't really change too often. (Integer) 3600000
initialLoadDelay Dunno why, but thought it was a good idea to give it some rest before we start. Defaults to 1 sec. (Integer) 1000
numDays Number of days to show if showAll is true, number of forecasts to show if showAll is false. (Integer) 7
showAll Show all four periods of each day or not. (Boolean) true
details If showAll is false, show detailed weather forecast? If false, it only shows the forecast around midday (12.00). If true, it shows detailed forecast numDetails times. (Boolean) true
showPrecipitation If showAll is true, show precipitation as well? (Boolean) true
detailedPrec Show detailed precipitation? (Boolean) true
showMaxMin If showAll is true, show maximum and minimum temperature? (Boolean) false
maxMinSeparator If showMaxMin is true, which separator should be used? (String) "-"
numDetails How many detailed forecasts to show. Default is next two periods. Only applies if showAll is false and details is true. (Integer) 2
roundTemp Round temperature to zero decimals. (Boolean) true
roundPrec Round precipitation to zero decimals. (Boolean) false
title Content of the header of the module – the title. If shown, that is. (String) "Værmelding for Skrubblivegen"
header Show header or not. Contents of header is title. (Boolean) false
size The size of the text. One of the CSS classes defined in main.css of MagicMirror2: "xsmall", "small", "medium", "large", "xlarge". (String) "small"
windShow Show wind forecast or not? (Boolean) true
windGust Show wind gust information or not. (Boolean) false
windUnit If set, it shows as the unit of the wind. Default could be "m/s", but I like it at nothing at all. (string) ""
windSize Size of wind forecast. One of the CSS classes defined in main.css of MagicMirror2: "xsmall", "small", "medium", "large", "xlarge" – or the custom "yrthen-xxsmall" for extra, extra small. (String) "yrthen-xxsmall"
windText Show wind speed in text. (Boolean) true
windTextNumber Show wind speed in number after showing it in text. (Boolean) true
windTextNewLine If windText and windTextNumber both are true, show windTextNumber on a new line? (Boolean) true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.