/MMM-Magic-Seaweed

This is a MagicMirror 2 module to show surf conditions using the Magic Seaweed API.

Primary LanguageJavaScriptMIT LicenseMIT

MMM-Magic-Seaweed

Magic Seaweed

This a module for the MagicMirror to show surf conditions using the Magic Seaweed API.

Magic Seaweed

Data for this module is kindly provided by Magic Seaweed.

Installation

  1. Navigate into your MagicMirror's modules folder and execute git clone https://github.com/nigel-daniels/MMM-Magic-Seaweed. A new folder MMM-Magic-Seaweed will appear, navigate into it.
  2. Execute npm install to install the node dependencies.

Config

API key

Prior to creating the config you will need an API key to access the data, you can apply for an ID from the Magic Seaweed website.

Spot ID

to locate the spot_id of the surf you want to monitor. This can be found by visiting the Magic Seaweed website and locating the surf you want to track, once you have the locations page you can find the spots ID in the URL. For example if you want to get surf data for Steamer Lane in Santa Cruz, USA the URL is:

https://magicseaweed.com/Steamer-Lane-Surf-Report/163/

The URL contains the ID 163 which is the number you need in the config.

Config

The entry in config.js can include the following options:

Option Description
api_key Required This is the API key assigned to you by Magic Seaweed (see above).

Type: string
spot_name This is the name you want shown on your mirror that tells you the spot you are monitoring.

Type: string
spot_id Required This the id of the location you are monitoring (see above).

Type: string
units This is units of measure you want to use in the desplay, this can be:

eu = (m, kph, c)
uk = (ft, mph, c)
us = (ft, mph, f)

Type: string
Default value: us
interval How often the status is updated. Be sure to follow the API usage guidelines when setting this.

Type: integer
Default value: 300000 // 5 minutes

Here is an example of an entry in config.js

{
    module:    'MMM-Magic-Seaweed',
    position:  'top_left',
    header:    'Surf Report',
    config:	 {
                api_key:   'xxxxxxxxxxxxxxxxxxxx',
				spot_name:	'Pleasure Point',
	            spot_id:	'644',
				units:		'us',
	            interval:	300000
                }
},

Dependencies

  • urllib (installed via npm install)
  • moment (installed via npm install)

Notes

Feel free to submit pull requests or post issues and I'll do my best to respond.

Thanks To...