Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jclarke0000/MMM-DarkSkyForecast
Magic Mirror module to display weather information using the Dark Sky API
https://github.com/jclarke0000/MMM-DarkSkyForecast
Last synced: 22 days ago
JSON representation
Magic Mirror module to display weather information using the Dark Sky API
- Host: GitHub
- URL: https://github.com/jclarke0000/MMM-DarkSkyForecast
- Owner: jclarke0000
- Created: 2018-11-26T23:02:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-28T15:27:07.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T10:03:25.277Z (4 months ago)
- Language: JavaScript
- Size: 1.36 MB
- Stars: 84
- Watchers: 15
- Forks: 63
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mmm - **MMM-DarkSkyForecast**
README
# MMM-DarkSkyForecast
This a module for MagicMirror
https://magicmirror.builders/
https://github.com/MichMich/MagicMirror![Screenshot](/../screenshots/MMM-DarkSkyForecast.png?raw=true "Screenshot")
A weather module that displays current, hourly and daily forecast information
using data from the Dark Sky API. This is a replacement module for MMM-MyWeather, now that Weather Underground no longer allows free API access. This a complete rewrite from scratch but maintains
much of the same functionality.**NOTE:** This module uses the Nunjucks templating system introduced in version 2.2.0 of MagicMirror. If you're seeing nothing on your display where you expect this module to appear, make sure your MagicMirror version is at least 2.2.0.
## Installation
1. Navigate into your MagicMirror `modules` folder and execute
`git clone https://github.com/jclarke0000/MMM-DarkSkyForecast.git`.
2. Enter the new `MMM-DarkSkyForecast` directory and execute `npm install`.## Configuration
At a minimum you need to supply the following required configuration parameters:
* `apikey`
* `latitude`
* `longitude`You can request an API key to access Dark Sky data here:
`https://darksky.net/dev`.Free tier is fine -- this module will not make any where near 1000 request on one day.
Find out your latitude and longitude here:
`https://www.latlong.net/`.### Other optional parameters
Option
Description
updateInterval
How frequently, in minutes, to poll for data. Be careful not to set this too frequent so that you don't exceed Dark Sky's 1000 free requests per day cap.
TypeNumber
Defaults to10
requestDelay
In milliseconds, how long to delay the request. If you have multiple instances of the module running, set one of them to a delay of a second or two to keep the API calls from being too close together.
TypeNumber
Defaults to250
updateFadeSpeed
How quickly in milliseconds to fade the module out and in upon data refresh. Set this to0
for no fade.
TypeNumber
Defaults to500
(i.e.: 1/2 second).
language
The language to be used for display.
TypeString
Defaults to the language set for Magic Mirror, but can be overridden with any of the language codes listed here: https://darksky.net/dev/docs#request-parameters.
colored
Whether to present module in colour or black-and-white. Note, if set tofalse
, the monochramtic version of your chosen icon set will be forced.
TypeBoolean
Defaults totrue
units
One of the following:si
,ca
,uk2
, orus
.
TypeString
Defaults toca
See https://darksky.net/dev/docs#request-parameters for details on units.
showCurrentConditions
Whether to show current temperaure and current conditions icon.
TypeBoolean
Defaults totrue
showExtraCurrentConditions
Whether to show additional current conditions such as high/low temperatures, precipitation and wind speed.
TypeBoolean
Defaults totrue
showSummary
Whether to show the forecast summary.
TypeBoolean
Defaults totrue
forecastHeaderText
Show a header above the forecast display.
TypeString
Defaults to""
showForecastTableColumnHeaderIcons
Whether to show icons column headers on the forecast table.
TypeBoolean
Defaults totrue
showHourlyForecast
Whether to show hourly forecast information. when set totrue
it works with thehourlyForecastInterval
andmaxHourliesToShow
parameters.
TypeBoolean
Defaults totrue
hourlyForecastInterval
How many hours apart each listed hourly forecast is.
TypeNumber
Defaults to3
maxHourliesToShow
How many hourly forecasts to list.
TypeNumber
Defaults to3
showDailyForecast
Whether to show daily forecast information. when set totrue
it works with themaxDailiesToShow
parameter.
TypeBoolean
Defaults totrue
maxDailiesToShow
How many daily forecasts to list.
TypeNumber
Defaults to3
showPrecipitation
Whether to show precipitation information. This affects current conditions, hourly and daily forecasts
TypeBoolean
Defaults totrue
showWind
Whether to show wind information. This affects current conditions, hourly and daily forecasts
TypeBoolean
Defaults totrue
concise
When set totrue
, this presents less information. (e.g.: shorter summary, no precipitation accumulation, no wind gusts, etc.)
TypeBoolean
Defaults totrue
iconset
Which icon set to use. See below for previews of the icon sets.
TypeString
Defaults to1c
useAnimatedIcons
Whether to use the Dark Sky's own animated icon set. When set to true, this will override your choice foriconset
. However, flat icons will still be used in some instances. For example if you set theanimateMainIconOnly
parameter to true, daily and hourly forecasts will not be animated and instead will use your choice foriconset
. Inline icons (i.e. used to prefix precipitation and wind information) will always be flat. A goodiconset
match for the animated set is1c
.
TypeBoolean
Defaults totrue
animateMainIconOnly
When set totrue
, only the main current conditions icon is animated. The rest use your choice foriconset
(1c
is a good match for the animated icon). If you are running on a low-powered device like a Raspberry Pi, performance may suffer if you set this tofalse
. In my testing on a Pi 3b, enabling this ramped up CPU temperature by 15° - 20°, and fade transitions were not smooth.
TypeBoolean
Defaults totrue
showInlineIcons
Whether to prefix wind and precipitation information with an icon. Only affects thetiled
layout.
TypeBoolean
Defaults totrue
forecastLayout
Can be set totiled
ortable
. How to display hourly and forecast information. See below for screenshot examples of each.
TypeString
Defaults totiled
label_maximum
The label you wish to display for prefixing wind gusts.
TypeString
Defaults to"max"
.
label_high
The label you wish to display for prefixing high temperature.
TypeString
Defaults to"H"
.
label_low
The label you wish to display for prefixing low temperature.
TypeString
Defaults to"L"
.
label_timeFormat
How you want the time formatted for hourly forecast display. Accepts any valid moment.js format (https://momentjs.com/docs/#/displaying/format/). For example, specify short 24h format with"k[h]"
(e.g.:14h
)
TypeString
Defaults to"h a"
(e.g.:9 am
)
label_days
How you would like the days of the week displayed for daily forecasts. Assumes index0
is Sunday.
TypeArray of Strings
Defaults to["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"]
label_ordinals
How you would like wind direction to be displayed. Assumes index0
is North and proceeds clockwise.
TypeArray of Strings
Defaults to["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]
## Sample Configuration
```
{
module: "MMM-DarkSkyForecast",
header: "Weather",
position: "top_right",
classes: "default everyone",
disabled: false,
config: {
apikey: "SUPER SECRET!!!",
latitude: "51.506130",
longitude: "-0.090270",
iconset: "4c",
concise: false,
forecastLayout: "table"
}
},
```## Icon Sets
![Icon Sets](icons/iconsets.png?raw=true "Icon Sets")
## Layouts
![Layouts](/../screenshots/forecast-layouts.png?raw=true "Layouts")
## Styling
This module is set to be 300px wide by default. If you wish to override it, you can add the following to your `custom.css` file:
```
.MMM-DarkSkyForecast .module-content {
width: 500px; /* adjust this to taste */
}
```Most important elements of this module have one or more class names applied. Examine the `MMM-DarkSkyForecast.css` or inspect elements directly with your browser of choice to determine what class you would like to override.
## For Module Developers
This module broadcasts a notification when it recieves a weather update. The notification is `DARK_SKY_FORECAST_WEATHER_UPDATE` and the payload contains Dark Sky's JSON weather forecast object. For details on the weather object, see https://darksky.net/dev/docs.
## Attributions
**Skycons - Animated icon set by Dark Sky**
http://darkskyapp.github.io/skycons/
(using the fork created by Maxime Warner
that allows individual details of the icons
to be coloured
https://github.com/maxdow/skycons)**Climacons by Adam Whitcroft**
http://adamwhitcroft.com/climacons/**Free Weather Icons by Svilen Petrov**
https://www.behance.net/gallery/12410195/Free-Weather-Icons**Weather Icons by Thom**
(Designed for DuckDuckGo)
https://dribbble.com/shots/1832162-Weather-IconsSets 4 and 5 were found on Graphberry, but I couldn't find
the original artists.
https://www.graphberry.com/item/weather-icons
https://www.graphberry.com/item/weathera-weather-forecast-iconsSome of the icons were modified to better work with the module's
structure and aesthetic.**Weather data provided by Dark Sky**
https://darksky.net/