Skip to content

Magic Mirror Module displaying the current marine weather and using Storm Glass API

License

Notifications You must be signed in to change notification settings

grenagit/MMM-MarineWeather

Repository files navigation

Module: MMM-MarineWeather

This module displays the current marine weather, including the water temperature, the air temperature, the current wind conditions (speed and direction), current wave conditions (height, direction and period) and more specific informations (pressure, cloud cover, visibility, sea level).

Apart from water temperature and air temperature, all other information may be enabled or disabled.

MMM-MarineWeather Screenshot #1 MMM-MarineWeather Screenshot #2 MMM-MarineWeather Screenshot #3 MMM-MarineWeather Screenshot #4

MagicMirror Project on Github | StormGlass

Installation:

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/grenagit/MMM-MarineWeather

Configure the module in your config.js file.

Update:

In your terminal, go to your MMM-MarineWeather's Module folder:

cd ~/MagicMirror/modules/MMM-MarineWeather

Incorporate changes from this repository:

git pull

Configuration:

Basic configuration

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: "MMM-MarineWeather",
		position: "top_right",
		config: {
			latitude: 0, // Latitude 
			longitude: 0, // Longitude
			appid: "abcde12345abcde12345abcde12345ab" // StormGlass API key (docs.stormglass.io)
		}
	}
]

You can use the special 414492aa-c717-11e9-a3da-0242ac130004-4144953e-c717-11e9-a3da-0242ac130004 API Key for your tests but it has much lower rate limits !

Options

The following properties can be configured:

Option Description
latitude The latitude of the desired point

This value is REQUIRED
longitude The longitude of the desired point

This value is REQUIRED
appid The StormGlass API key, which can be obtained by signing up on StormGlass portal. It's free for 50 requests per day!

This value is REQUIRED
units What units to use. Specified by config.js

Possible values: config.units = Specified by config.js, metric = Celsius, imperial = Fahrenheit
Default value: config.units
updateInterval How often does the content needs to be fetched? (Milliseconds)

Possible values: 1000 - 86400000
Default value: 60 * 60 * 1000 (1 hour)
animationSpeed Speed of the update animation. (Milliseconds)

Possible values:0 - 5000
Default value: 1000 (1 second)
showWindDirectionAsArrow Show the wind direction as an arrow instead of abbreviation

Possible values: true or false
Default value: false
showGustAsWind Show the wind gust instead of the wind speed.

Possible values: true or false
Default value: false
useBeaufort Use the Beaufort scale for wind speed and wave speed or using the default units.

Possible values: true or false
Default value: false
useKMPH Use KMPH as units for wind speed.

Possible values:true or false
Default value: false
roundTemp Round temperature value to nearest integer.

Possible values: true (round to integer) or false (display exact value with decimal point)
Default value: false
initialLoadDelay The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds)

Possible values: 1000 - 5000
Default value: 0
retryDelay The delay before retrying after a request failure. (Milliseconds)

Possible values: 1000 - 60000
Default value: 2500 (2,5 seconds)
apiBase The StormGlass API base URL.

Default value: 'https://api.stormglass.io/'
apodEndpoint The StormGlass API v2 end point.

Default value: 'v2/weather/point'
params The array of parameters for the StormGlass API response.

Required parameters: 'airTemperature' and 'waterTemperature'
Optionals parameters: 'pressure', 'cloudCover', 'visibility', 'seaLevel', 'windSpeed', 'gust', 'windDirection', 'waveHeight', 'waveDirection' or 'wavePeriod'
Default value: ['airTemperature', 'waterTemperature', 'pressure', 'cloudCover', 'windSpeed', 'windDirection', 'waveHeight', 'waveDirection']
dataSource The StormGlass API information source.

Possible values: 'sg' or 'noaa' (except sea level)
Default value: 'sg' (StormGlass).

Todo:

  • Add a coloured legend depending on the water temperature
  • Add customization of displayed information except water temperature and air temperature.
  • Add specific informations (pressure, cloud cover, visibility, sea level) with API v2.
  • Convert data to the selected unit system with config.units
  • Add the Air temperature

Testing:

To test the new features, you can use the testing branch:

  • Change from master version to testing version: git checkout testing
  • Return to master version from testing version: git checkout master
  • Check the version used: git branch -v

License:

This module is licensed under the MIT License

About

Magic Mirror Module displaying the current marine weather and using Storm Glass API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published