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

Wunderground API is dead #42

Closed Privacywonk closed 4 years ago

Privacywonk commented 5 years ago

MMM_Surf relied on Wunderground for current weather data:

Per announcement (boooooo) https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api the service has come to an end.

MMM-Surf has been migrated to Dark Sky's API service for current weather.

To-Do:

Privacywonk commented 5 years ago

Additional API Access to consider...Accuweather has the highest accuracy out of the bunch but has a very limited number of API calls.

AccuWeather API: https://www.developer.accuweather.com/packages AerisWeather API: https://www.aerisweather.com/signup/pricing/ Dark Sky API: https://darksky.net/dev/docs Open Weather Map API: https://www.openweathermap.org/price

Privacywonk commented 5 years ago

Moon Phases:

 moon_icon: function(moon_phase) {  
    if (moon_phase >= 0 && moon_phase < 0.036) {  
            return "wi-moon-new";  
    } else if (moon_phase >= 0.036 && moon_phase < 0.071) {  
            return "wi-moon-waxing-crescent-1";  
    } else if (moon_phase >= 0.71 && moon_phase < 0.107) {  
            return "wi-moon-waxing-crescent-2";  
    } else if (moon_phase >= 0.107 && moon_phase < 0.143) {  
            return "wi-moon-waxing-crescent-3";  
    } else if (moon_phase >= 0.143 && moon_phase < 0.179) {  
            return "wi-moon-waxing-crescent-4";  
    } else if (moon_phase >= 0.179 && moon_phase < 0.214) {  
            return "wi-moon-waxing-crescent-5";  
    } else if (moon_phase >= 0.214 && moon_phase < 0.250) {  
            return "wi-moon-waxing-crescent-6";  
    } else if (moon_phase >= 0.250 && moon_phase < 0.286) {  
            return "wi-moon-first-quarter";  
    } else if (moon_phase >= 0.286 && moon_phase < 0.321) {  
            return "wi-moon-waxing-gibbous-1";  
    } else if (moon_phase >= 0.321 && moon_phase < 0.357) {  
            return "wi-moon-waxing-gibbous-2";  
    } else if (moon_phase >= 0.357 && moon_phase < 0.393) {  
            return "wi-moon-waxing-gibbous-3";  
    } else if (moon_phase >= 0.393 && moon_phase < 0.429) {  
            return "wi-moon-waxing-gibbous-4";  
    } else if (moon_phase >= 0.429 && moon_phase < 0.464) {  
            return "wi-moon-waxing-gibbous-5";  
    } else if (moon_phase >= 0.464 && moon_phase < 0.500) {  
            return "wi-moon-waxing-gibbous-6";  
    } else if (moon_phase >= 0.500 && moon_phase < 0.536) {  
            return "wi-moon-full";  
    } else if (moon_phase >= 0.536 && moon_phase < 0.571) {  
            return "wi-moon-waning-gibbous-1";  
    } else if (moon_phase >= 0.571 && moon_phase < 0.607) {  
            return "wi-moon-waning-gibbous-2";  
    } else if (moon_phase >= 0.607 && moon_phase < 0.643) {  
            return "wi-moon-waning-gibbous-3";  
    } else if (moon_phase >= 0.643 && moon_phase < 0.679) {  
            return "wi-moon-waning-gibbous-4";  
    } else if (moon_phase >= 0.679 && moon_phase < 0.714) {  
            return "wi-moon-waning-gibbous-5";  
    } else if (moon_phase >= 0.714 && moon_phase < 0.750) {  
            return "wi-moon-waning-gibbous-6";  
    } else if (moon_phase >= 0.750 && moon_phase < 0.786) {  
            return "wi-moon-third-quarter";  
    } else if (moon_phase >= 0.786 && moon_phase < 0.821) {  
            return "wi-moon-waning-crescent-1";  
    } else if (moon_phase >= 0.821 && moon_phase < 0.857) {  
            return "wi-moon-waning-crescent-2";  
    } else if (moon_phase >= 0.857 && moon_phase < 0.893) {  
            return "wi-moon-waning-crescent-3";  
    } else if (moon_phase >= 0.893 && moon_phase < 0.929) {  
            return "wi-moon-waning-crescent-4";  
    } else if (moon_phase >= 0.929 && moon_phase < 0.964) {  
            return "wi-moon-waning-crescent-5";  
    } else if (moon_phase >= 0.964 && moon_phase < 1.000) {  
            return "wi-moon-waning-crescent-6";  
    } else {  
            return "out-of-bounds";  
    }
 },
PierreLeoFerreira commented 4 years ago

Good day. I find your Module really interesting as I live in a small surf town in South Africa. I would really like to use your module. Are you still planning on changing to available weather services?

Privacywonk commented 4 years ago

Yes! I haven't pushed code changes (testing locally) but I have switched over to DarkSky for weather, which should bring in South Africa.

However, Tide and Water data is still pegged to NOAA (US centric). Does your govt have any published buoy data?

PierreLeoFerreira commented 4 years ago

I've been looking but unfortunately not been able to find or get easy free access to Buoy Data.

I am but still a noob.

michaelr747 commented 4 years ago

Hey there, Am really keen to get your module up and running, got API from Magic Seaweed (awesome people) am struggling a bit with the to do, any assistance would be greatly appreciated. Many thanks Michael

To-Do: Update instructions to reflect needs for DarkySky Clean up config.js, MMM-Surf.js, and node_helper.js to remove all legacy wunderground code.

Privacywonk commented 4 years ago

@michaelr747 - Happy holidays! Thanks to having some down time, I've been able to update the code base to use DarkSky. Please take a fresh pull from the master branch.

Privacywonk commented 4 years ago

@michaelr747 I see from your location on Github you're in .AU. Currently tides and water temps are tied to a very US-centric data source: National Oceanic and Atmospheric Administration. I have yet to find easily consumable data (ideally free) from non US countries...if you're aware of anything in .AU we can use, please let me know.