Code Monkey home page Code Monkey logo

mmm-rainfc's Introduction

MMM-Rainfc

Magic Mirror - Dutch Rain Forecast

Based on a Dutch public api for rain forecast (BuienRadar). call

Installation

Navigate into your MagicMirror's modules folder and execute 'git clone https://github.com/73cirdan/MMM-rainfc'

Using the module

This module can show the rainforecast in your neighbourhood using longitude and latitude.

Version

Version Description
Version 2.0 Second version inspired by the svg work of spoturdeal with the SVG graph. I did a rewrite
-module no longer depedending on external scripts
-deprecated of lot of config options, added a configurable css option, to enable all your custimization needs
-improved error handling
-refactoring code
-support for multiligual use
-experimental support for autohide; this hides the module completely when no rain is expected
- multiple display modes
Version 1.0 first version was baded on jquery and sparkline

Config options

The following properties can be configured:

Option Description
lat The latitude of your position.
Type: Float
Default: 52.0
lon The longitude of your position.
Type: Float
Default: 5.0
displaymode There are three display modes, see the screen shot, in order from top to bottom smooth, block or line.
Type: string
Default: smooth
css (optional) The file to use when changing the look (alignment, font, color) of the module
Type: string
Default: MMM-rainfc.css
refreshInterval (optional) Time to wait for refresh
Type: number
Default: 900000
Remark: Time to download new data in milisecond (15601000)
autohide (expiremental) Completely hide the module (including header) when no rain is expected
Type: boolean
Default: false

Deprecated No longer needed, see css file for tunning or make your own custom css to prevent overwrite during pull.

Option Description
width controls the size of the module
height controls the size of the module
lineWidth the thicknes of the line
lineColor the color of the line
fillColor the color of the area under the line
maxPower the maximum number on the y axis
rainText The text you want to display in front of the last time received in the last call
noRainText The text you want to display if no rain is expected untill the last time in the last call.
nrOfTimeLabels optional value, adds a number of time labels under the graph.

Example config.js content for this module

	{
		module: "MMM-rainfc",
		position: "top_right",
            	header: "Rain forecast",
		config: {
			lat: "52.1",
			lon: "4.90", 
			displaymode: "smooth",
		}
	},

Dutch Explanation of the Api and Source

Data is provided by buienradar (https://www.buienradar.nl/overbuienradar/gratis-weerdata ), permission for non commercial use. Excerpt from the site:

(1.0) Neerslagdata op basis van coördinaten

Op basis van de door u gewenste coördinaten (latitude en longitude) kunt u de neerslag tot twee uur vooruit ophalen in tekstvorm. De data wordt iedere 5 minuten geüpdatet. Op deze pagina kunt u de neerslag in tekst vinden. De waarde 0 geeft geen neerslag aan (droog), de waarde 255 geeft zware neerslag aan. Gebruik de volgende formule voor het omrekenen naar de neerslagintensiteit in de eenheid millimeter per uur (mm/u):

Neerslagintensiteit = 10^((waarde-109)/32)

Ter controle: een waarde van 77 is gelijk aan een neerslagintensiteit van 0,1 mm/u.

The MIT License (MIT)

Copyright 2017 Cirdan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

mmm-rainfc's People

Contributors

73cirdan avatar lavolp3 avatar qistoph avatar

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.