This is a module for the awesome MagicMirror². It displays local weather data for cities in Berlin and Brandenburg (Germany) based on RBB weather data.
Go to modules folder
cd modules/
Clone this module from Github
git clone https://github.com/nkl-kst/MMM-RBB-Weather
Switch to newly created module folder
cd MMM-RBB-Weather/
Install dependencies
npm install --only=prod
After adding this module to your config (see below) restart your MagicMirror.
Go to modules folder
cd modules/MMM-RBB-Weather
Pull changes from Github
git pull
Install new dependencies
npm install --only=prod
Since this repository ignores the automatically generated package-lock.json
, pulling changes should always work. If not, try to reset your module with git reset --hard
before pulling new changes.
To use this module, add the following configuration block to the modules array in the config/config.js
file:
var config = {
modules: [
{
module: 'MMM-RBB-Weather',
position: "top_right", // All available positions
config: {
// See below for configurable options, this is optional
}
}
]
}
All options are optional so the module works out of the box.
Option | Description |
---|---|
id |
City ID for data, see table below Type: String Default: 10381 (Berlin-Steglitz) |
days |
Days shown in forecast table. Set this to 0 to display only current weather. Data for seven days are available (including today), so 7 is the maximum here. Type: Number Default: 4 |
animationSpeed |
Duration of content refresh animation in seconds. Type: Number Default: 1 |
updateInterval |
Time between loading new weather data in seconds. Type: Number Default: 600 (10 minutes) |
showCurrentText |
Flag to display current weather text. Type: Boolean Default: true |
showCurrentWindspeed |
Flag to display current windspeed information. Type: Boolean Default: true |
showRainProbability |
Flag to display rain probability in forecast table. Type: Boolean Default: true |
showUpdateTime |
Flag to display last data update time. Type: Boolean Default: false |
showWindspeed |
Flag to display windspeed in forecast table. Type: Boolean Default: false |
animateCurrentIcon |
Flag to animate icon for current data. Type: Boolean Default: true |
animateForecastIcon |
Flag to animate icons in forecast table. Type: Boolean Default: false |
dayFormat |
Day format in forecast table, see Moment.js formats for details. Type: String Default: ddd |
splitCurrentTextGreater |
Split current weather text if it is larger than this value. Set it to 0 to disable splitting.Type: Number Default: 30 |
tableClass |
Classes added to forecast table. Could be used for additional styling, sizing etc. Type: String Default: small |
whiteIcons |
Flag to convert weather icons to simple white icons. Type: Boolean Default: true |
triggers |
Array of triggers to show/hide other modules based on weather data. Type: Array of trigger objectsDefault: [] |
You can define triggers to show or hide other modules based on weather data. A trigger object is defined by the following keys:
Key | Description |
---|---|
day |
Day to check field for fulfilled trigger condition. Day 0 holds current values, day 1 represents today, day 2 is tomorrow and so on until day 7 .Type: Number |
field |
Field to check value for fulfilled trigger condition. Possible fields are:
Type: String |
value |
Show module if field data is higher than this value. Type: Number |
module |
Name of the module you want to show/hide. Modules are determined by their class name, so you could define a class in module configs to trigger more than one module. Type: String |
hide |
Use this option to hide a module instead of showing it if trigger conditions are fulfilled. Type: Boolean Default: false |
This example trigger hides the clock module if todays rain possiblity is higher than 50 percent, otherwise the clock module is shown:
triggers: [
{ day: 1, field: 'prr', value: 50, module: 'clock', hide: true }
]
The animated icons consume a high amount of memory, resulting in an Electron crash and therefore a black MagicMirror screen. If you experience this issue, please use static icons instead (as described in Configuration options). Refer to issue #16 for more information.
There were some changes in the weather data in October 2020, primarly city IDs have changed. Please refer to the table below and get your city ID.
If you have any problems or questions, feel free to open an issue. There are many possible improvements for this module so please let me know if you miss something.
To run all unit tests just fire this command in the module folder
# Install also dev dependencies
npm install
# Run tests
npm test
You can also check if RBB endpoints are available and still providing correct data
npm run test-int
Use one of these city IDs in your config.
City | ID |
---|---|
Berlin | |
Adlershof | 6510388 |
Marzahn | 3010387 |
Steglitz | 10381 |
Tempelhof | 10384 |
Brandenburg | |
Altdöbern | 6510496 |
Angermünde | 10291 |
Bad Liebenwerda | 6510482 |
Baruth/Mark | 10376 |
Bernau | 3210383 |
Bestensee | 6510375 |
Brandenburg an der Havel | 6510371 |
Coschen | 3010496 |
Cottbus | 10496a |
Dahme/Mark | 6510477 |
Doberlug/Kirchhain | 10490 |
Eberswalde | 6510290 |
Eisenhüttenstadt | 3010398 |
Forst (Lausitz) | 3210497 |
Frankfurt (Oder) | 6510399 |
Fürstenberg/Havel | 10277 |
Fürstenwalde/Spree | 6510395 |
Gransee | 3010278a |
Guben | 6510497 |
Guteborn | 6510491 |
Herzberg (Elster) | 10476 |
Jüterbog | 3010476 |
Ketzin | 3210380 |
Klettewitz | 3010493a |
Kyritz | 10267 |
Lenzen (Elbe) | 3010255 |
Liebenwalde | 3110278 |
Lieberose | 10496b |
Lindneberg | 10393 |
Lübben (Spreewald) | 3010376 |
Luckenwalde | 6510376b |
Ludwigsfelde | 6510377 |
Manschnow | 10396a |
Nauen | 6510373 |
Neuruppin | 10271 |
Oranienburg | 6510374 |
Ortrand | 3210488 |
Perleberg | 6510263 |
Potsdam | 10379 |
Prenzlau | 10289 |
Pritzwalk | 3010266 |
Rathenow | 3210370 |
Schönefeld | 10385 |
Seelow | 10396b |
Senftenberg | 3010493b |
Stechlin | 3010277 |
Strausberg | 3210393 |
Templin | 6510287 |
Treuenbrietzen | 6510376a |
Welzow | 6510492 |
Wiesenburg | 10368 |
Wittstock/Dosse | 3010273 |
Zehdenick | 3010278b |
Ziesar | 3010366 |
See LICENSE