MMM-DarkSkyForecast - Yet ANOTHER weather module

UPDATE 9-Dec-2018
I’ve updated this module to use the Nunjucks HTML templating system, which means as of verison 1.6, this module requires MagicMirror version 2.2.0 or later. If you are running on an older version of MagicMirror, then please use v1.5 of the module, which you can download here:

Instead of using git clone to get the module code, download the zip file from the link above and extract the contents of the ZIP file to your modules directory. This zip puts all of the files into a folder named MMM-DarkSkyForecast-1.5. I don’t know if it’s necessary to rename this directory to just MMM-DarkSkyForecast or if it will work as-is. Run npm install as normal in the directory to install all of the dependencies.

END UPDATE

I had been using my old weather module for quite some time, but now that Weather Underground no longer allows free API access, I’ve needed a replacement.

The great news is that there are SO many weather modules available now, but given that each of them behaved a little differently, it would have taken a considerable amount of time to go through and evaluate each one to see if it suited my needs.

I instead decided to use that time to write one that exactly matches my needs. I’ll admit it is quite possible that another weather module does everything mine does and perhaps more, but being the lazy ass that I am, I didn’t take the time to check

If you find it useful, then here it is.

It supports current conditions, hourly and daily forecasts and is highly configurable. It includes a handful of icon sets and even supports Dark Sky’s Skycons animated icon set.

You’ll also need the latitude and longitude of the region for which you want to display weather conditions. You can find that here:https://www.latlong.net/

Screenshot:

Included Icon sets

This does not share any code with my old MMM-MyWeather module. This is a completely new module from scratch that is a bit more organized code-wise and outputs HTML markup better suited for multiple layouts.

@j-e-f-f
What a beautiful module! Thank you always.
Anyway, is there any feature to broadcast weather via notification? (current weather & forecasts) If so, it will be great.

I’m making another calendar module, and want to use forecast info.
And, My another module WeatherBackground also is using current weather info for searching image. Could you add this feature? just periodical simple notifications with payload will be enough.

Does the module support the USER_PRESENCE notification to suspend / resume API calls?

It doesn’t suspend API calls based on user presence. This is intentional. I don’t spend more than about 30 seconds looking at my mirror, so when I do, I want the information that appears to be immediately up to date. By default the module polls every ten minutes for data, so you don’t run the risk of exceeding the 1000 request limit per day, nor are you really burning up a lot of CPU cycles to do so.

Dear @j-e-f-f,
thanks for the quick reply. Today, I tried to get my toes wet with JS coding and added an option to hide the column header icons from the forecast table or optionally show a header above the forecast table. It seems to work as expected and I have created a pull-request to give others access to the feature as well and maybe safe you some time.

I also found a way to hide the vertical lines from the table via the custom.css file and now the module looks even better, if a fullscreen background image is used.

@rudibarani I merged your pull request, but then I did a bit of refactoring. I renamed the the parameter forecastTableHeaderText to forecastHeaderText, as it can be used in both the table and tiled views.

I also fixed up how the header is formatted. I’m now using an HTML5 header element and it has two classes: module-header so that it is formatted the same as all of the other module headers, and forecast-header if you want to target it specifically with CSS.

Lastly, this update enables notifications for other modules. The notification is called DARK_SKY_FORECAST_WEATHER_UPDATE and the payload is Dark Sky’s weather JSON object. For details see https://darksky.net/dev/docs.