eklem / justini

Just in time info when entering or exiting your home. Raspberry Pi Zero W + Waveshare e-paper display.
MIT License
1 stars 0 forks source link

feature: show weather #3

Closed eklem closed 3 years ago

eklem commented 4 years ago

Met.no has changed their format from JSON to XML, so need to convert it. This library may work: xmlToJSON?

So, use fetch() to get the XML, covert it to JSON and store as a Vue data object and display what I need.

eklem commented 4 years ago

Need longtitude and latitude for Vålerenga.

eklem commented 4 years ago

Explanation on what is light rain, rain and heavy rain: https://hjelp.yr.no/hc/no/articles/115003696813-Hva-er-grensene-for-lett-og-kraftig-nedb%C3%B8r-

eklem commented 4 years ago

XML explanation: https://hjelp.yr.no/hc/no/articles/360009342833

eklem commented 4 years ago

So, previous URL for 6 hour blocks forecast and thus one for rain next 90 minutes: https://api.met.no/weatherapi/nowcast/0.9/documentation

eklem commented 4 years ago

The yr.no API for 6 hours seems easier to use. More direct connection to weather icons. https://www.yr.no/sted/Norge/Oslo/Oslo/Oslo/forecast.xml

eklem commented 4 years ago

I may get some explanation to when to show a sleet symbol from Yr.no on Twitter.

eklem commented 4 years ago

So, to sum it up so far:

eklem commented 4 years ago

Try D3.js for drawing possibility of rain or snow next 90 minutes. Or maybe Vega? Seems no real real programming needed.

eklem commented 4 years ago

Seems there is now a JSON api (version 2.0): https://api.met.no/weatherapi/locationforecast/2.0/?lat=60.10&lon=9.58