Privacywonk / MMM-Surf

MagicMirror module that pulls in tide, water temp, and Magicseaweed data to show an at-a-glance surf report for your favorite spot.
Other
5 stars 2 forks source link

Make MMM-Surf more international #40

Open Doddie99 opened 5 years ago

Doddie99 commented 5 years ago

Is it possible to rework this to make it more international, so remove the tide times from NOAA and have an option to just use MagicSeaweed feed? Would love to use this in UK but tide times from NOAA are required so not applicable?

Privacywonk commented 5 years ago

I love the idea but sadly MagicSeaweed does not support tide data as part of their API: https://magicseaweed.com/developer/forecast-api

If you can find me a UKI source of tide data (NOAA equiv?) I'd be happy to look into integrating the data feed as an option.

Doddie99 commented 5 years ago

Brilliant, there is another module MMM-Tides that uses https://www.worldtides.info/ This would make it truly international! Surfers everywhere will be using this module. I would try to help but only have basic Fortran and Python I'm afraid.

Privacywonk commented 5 years ago

I'll take a look at world tides, though paying for data that most governments supply for free rubs me the wrong way. Stay tuned, can't promise when I will turn this around but soon (this is hobby only).

For my documentation UK sources can be found here: https://admiraltyapi.portal.azure-api.net/ (more: https://www.admiralty.co.uk/digital-services/data-solutions/uk-tidal-api).

Doddie99 commented 5 years ago

Hi there, isn't it a free API as I signed up for it?

Doddie99 commented 5 years ago

Sorry just saw the worldtides.info the api expires after 30 days, here are the details for the admiralty api: UK Tidal API API change history Station Get the Tidal Station for the provided Station ID. Returned format is a standard GeoJSON Feature. The tidal station number is used as the GeoJSON feature Id. The feature has a Point geometry. The following custom properties are returned:

Id - The Tidal Station Number to be used in other API operations. Name - The Tidal Station Name. Country - The Country that provided the data for the Tidal Station. Continuous Heights Available - A boolean to indicate if continuous heights are available for the Tidal Station. Footnote - Footnote text. Request Request URL https://admiraltyapi.azure-api.net/uktidalapi/api/V1/Stations/{stationId} Request parameters stationId string The Tidal Station ID.

Request headers Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile. Request body Responses 200 OK OK

Representations application/json text/json Sample Schema { "type": "Point", "id": "string", "geometry": { "Type": "Point" }, "properties": {}, "bbox": [ 0.0 ], "crs": { "Type": "unspecified" } } 400 Bad Request Bad Request

Representations application/json text/json 401 Unauthorized Unauthorised user or incorrect subscription key

Representations application/json text/json 403 Forbidden Quota Exceeded

Representations application/json text/json 404 Not Found Not Found

Representations application/json text/json 429 Too many requests Too Many Requests

Representations application/json text/json 500 Internal Server Error Internal Server Error

Representations application/json text/json Code samples Curl C# Java JavaScript ObjC PHP Python Ruby @ECHO OFF

curl -v -X GET "https://admiraltyapi.azure-api.net/uktidalapi/api/V1/Stations/{stationId}" -H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}"

Privacywonk commented 4 years ago

Sea Surface Temperature Data - Global https://coastwatch.pfeg.noaa.gov/erddap/index.html -- as of today I have JSON pulls composed properly to allow for global SST data based on lat/lon.

Global Tides Exploring https://api.hood.land/api/tides as potential data source for global tides. Working to integrate over the holiday...stay tuned for updates.

Privacywonk commented 4 years ago

Tracking progress... I have https://coastwatch.pfeg.noaa.gov/erddap/index.html integrated and pulling data into the tool.

TODO:

Add logic to data fetcher & render engine to switch between two based on config selection. If US -> Use Tides and Current for higher level precision data If International -> Use coastwatch for daily temperature measurement