With the recent loss of access to www.weather.com for many users, in several regions I took a look at alternate sources for weather data.
And it was no surprise that there were very few choices and most required obtaining an APIKey to access the information.
I found a forum post by rick-t-fiedrain from a year ago talking about a new weather API from Open-Meteo.
The weather API has several very attractive features when considering creating or modifying Rainmeter weather skins:
- It is totally free
- It DOES NOT require an APIKey code to access (for personal use)
- It updates every 15 minutes
- It has forecasts for up to 16 days
- It can return a set number of days forecast
- It returns measurements in selectable units
- It offers several additional weather/agricultural measurements
- It offers historical weather data
- It has a very fast response time
- There is an available GeoCoding API for locations data
The structure of the files is identical to the WeatherComJSON @include files.
The MeasureName values used in OPENMETEOAPI meaures are identical to the majority of the common MeasureNames used in WeatherComJSON.
Because of those similarities, and my laziness, I will now simply plagiarize JSMorley's post of 'Weather.com - Parsing the V3 JSON' with details of the similarities and differences of these data sources...
...
OPEN-METEO API
~ An alternative source for weather data, using identical 'MeasureNames' as in WeatherComJSON
NOTE: This version used the Open-Meteo API (It is FREE, NO AIKey required, updates every 15 minutes) with similar @Include .inc files and identically named MeasureNames currently used with TWC (The Weather Channel) JSON parsing Skins. This allows fairly simple switching of the source with limited edits needed to convert skins to use the free Open-Meteo API.
This uses a series of @Include .inc files to eliminate having to figure out regular expression or even create any measures for your skin. It does all the hard work for you!
Then you can just concentrate on the Meters in your skin. All the measures you will need are already there! Just create the meters and use the MeasureName= options you can easily get by looking at About/Skins to see what the measure names are that are populated. I tried to make the measure names as descriptive as possible, and if you look in the include files, I have done as much commenting as I can.
If you want to "overload" an included measure, for instance to use Substitute or put an IfCondition or IfMatch on the measure, just create a copy of the measure as a Measure=String or Measure=Calc in the skin, and dynamically use the value of the original measure as a [SectionVariable].
I strongly recommend that you DON'T alter OpenMeteoAPIMeasures.inc.
That just reduces its usefulness as something you can just plug into another new skin and makes it very difficult indeed for you if I update it.
=====================================
Open-Meteo API (https://open-meteo.com)
=====================================
The API is updated every 15 minutes on the quarter-hour
The webparser measure has an 'UpdateRate=900' (every 15 minutes)
Most measures have 'instant' current values
Measures that are not 'instant' will be extrapolated from the hourly values
Currently there are no measures for: Alerts, Moon, or Pollen
~ These may be added in the future ~
=====================================
Note: Using Open-Meteo API in TWCJSON skins
=====================================
All Open-Meteo measurenames that return TWC JSON measure values are named identically in OpenMeteoAPI
There are a few measurenames that are not included, and some new ones added (See 'MeasureNameComparison.txt')
Using substitution, weather icons for TWC condition numbers {0~47} are used instead of the Open-Meteo condition number values {0~99)
Open-Meteo returns current day/night status so there is NO NEED FOR AFTERNOON SUBSTITIONS OR SEPARATE DAY/NIGHT MEASURES
~ CONVERTING IS AS EASY AS 1-2-3 ~
1. Copy all of the OpenMeteoAPI... files to your skin's '@Resources' folder
2. Change all @include values names in your skin by replacing the 'WeatherComJSON' portion with 'OpenMeteoAPI' e.g 'WeatherComJSONVariables.inc' to 'OpenMeteoAPIVariables.inc'
3. Then save and refresh the skin.
A few minor edits may be needed (distances and pressure), but for most simple skins that is all that is needed to use Open-Meteo API values in skins coded to use WeatherComJSON data
A LocationGeoCodes skin is included in these rmskin packages. It is nearly identical to the one designed by JSMorley, but uses Open-Meteo GeoCode API to return location details.
OpenMeteoAPIVariables.inc
This is where you set your Location latitude, longitude, units of measure. Read it for help.
Always @Include this file.
OpenMeteoAPIMeasures.inc
This parses all 15 days of the API code and creates the measures you will need.
OpenMeteoAPIMeasures3Day.inc
This parses 3 days of the API code and creates the measures you will need.
OpenMeteoAPIMeasures5Day.inc
This parses 5 days of the API code and creates the measures you will need.
OpenMeteoAPIMeasures7Day.inc
This parses 7 days of the API code and creates the measures you will need.
OpenMeteoAPIMeasures10Day.inc
This parses 10 days of the API code and creates the measures you will need.
Always @Include one and only one of these files.
OpenMeteoAPILanguage.inc
This will allow you to translate the "labels" I use in my skin to any other language you want.
This is specific to this skin, and you may not need it for yours.
Here are the OPENMETEOAPI @include files:
Once you @Include OpenMeteoAPIVariables.inc AND OpenMeteoAPIMeasures.inc in your skin, the following measures will be created. You can use About / Skins to see them AND the values they currently have, but here is a list of measures, and any differences for reference:
Additional information
======================
Note: Open-Meteo API Night is determined by [@CurrentIsDay] measure so
NO NIGHT MEASURES ARE NEEDED
=====================================
Note on Distance Measures
=====================================
Open-Meteo always shows distance in feet or meters
Conversion to miles and kilometer are done for you
Pressure is always in hPA hectopascals(mb) and conversion to inch is done for you
You should add a measure to your skin to determines which value to set as MeasureName= in your distance and pressure meters.
See [@MeasureMetric] in this weather skin. e.g.
Code: Select all
[MeasureMetric]
Measure=String
String=#TempUnit#
IfMatch=fahrenheit
IfMatchAction=[!SetOption MeterVisibility MeasureName "@CurrentVisibilityMiles"][!SetOption MeterBarometer MeasureName "@CurrentPressureInch"][!UpdateMeter MeterVisibility][!UpdateMeter MeterBarometer][!Redraw]
IfNotMatchAction=[!SetOption MeterVisibility MeasureName "@CurrentVisibilityKilometers"][!SetOption MeterBarometer MeasureName "@CurrentPressure"][!UpdateMeter MeterVisibility][!UpdateMeter MeterBarometer][!Redraw]
IfMatchMode=1
=====================================
Bonus ~ Win10 Widgets Open-Meteo skin
=====================================
{Thanks for the 700+ downloads of the previous version}