It is currently October 13th, 2024, 4:17 pm

Open-Meteo Weather API

Weather skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5540
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Open-Meteo Weather API

Post by eclectic-tech »

Thanks for 1,000+ downloads of earlier versions
Open-Meteo Weather_1.2024.08.23.rmskin

openmeteo1.png


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
With that information, I set about creating skins and discovered it was comparable to the current WeatherComJSON methods of accessing weather data. The next step was to design similarly named @include files with as many identical MeasureNames as in the WeatherComJSON @include files, so creating, editing, or converting skin would be easier with minimal editing to use this API 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:
@includeFiles.zip

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:
======================
Units of measure
======================
[@UnitsParticular10] : μg/m³
[@UnitsParticular2_5] : μg/m³
[@UnitsTemperature] : F or C
[@UnitsPercent] : %
[@UnitsPrecipitation] : inch or mm
[@UnitsPressure] : hPa
[@UnitsSpeed] : mp/h | km/h | ms | kn
[@UnitsDegrees] : °
[@UnitsDistance] : ft or m
[@UnitsSnowDepth] : ft
[@UnitsSoilMoisture] : m³/m³

=====================================
Current location
=====================================
[@LocationLatitude]
[@LocationLongitude]
[@LocationAdminDistrictCode] : Manually set or From Open-Meteo Geocoding skin
[@LocationCountryCode] : Manually set or From Open-Meteo Geocoding skin
[@LocationName] : Manually set or From Open-Meteo Geocoding skin
[@LocationUTCTimeOffset] : -14400
[@LocationTimezoneAbbreviation] : EST
[@LocationElevation]

======================
Current weather information
======================
[@CurrentPressure] : Always in hPa units (mb)
[@CurrentPressureInch] : Converts pressure to inches
[@CurrentDewPoint]
[@CurrentFeelsLike]
[@CurrentWindGust]
[@CurrentHumidity]
[@CurrentIsDay] : 1=day 0=night
[@CurrentWeathercode] : 0~99
[@CurrentIcon]
[@CurrentObservationTimeStamp]
[@CurrentObservationDate]
[@CurrentObservationTime]
[@CurrentConditions]
[@CurrentCloudCoverPhrase]
[@CurrentPrecipitationLast24Hours]
[@CurrentRain]
[@CurrentShowers]
[@CurrentSnowFall]
[@CurrentSnowDepth]
[@CurrentTemperature]
[@CurrentUVIndex]
[@CurrentVisibilityDistance] : ft | m
[@CurrentVisibilityDistanceMiles]
[@CurrentVisibilityDistanceKilometers]
[@CurrentWindSpeed]
[@CurrentWindDirectionDegrees]
[@CurrentWindDirectionCompass]
[@CurrentSunriseTimeStamp]
[@CurrentSunriseTime]
[@CurrentSunsetTimeStamp]
[@CurrentSunsetTime]
[@CurrentParticular10]
[@CurrentParticular2_5]
[@CurrentEvaporation]
[@CurrentSoilTemperature]
[@CurrentSoilMoisture]

======================
Today - Forecast for the entire day
======================
[@ForecastTodayDateString] : Full date string for Today - i.e. "2020-01-21T07:00:00-0400"
[@ForecastTodayDayLong] : Full day of the week i.e. Saturday
[@ForecastTodayDayShort] : i.e. Sat
[@ForecastTodayMonthLong] : i.e. "January"
[@ForecastTodayMonthShort] : i.e. "Jan"
[@ForecastTodayDayOfMonth] : 1-31
\[@ForecastTodayHighTemperature]
[@ForecastTodayLowTemperature]
[@ForecastTodaySunriseTimeStamp]
[@ForecastTodaySunriseTime]
[@ForecastTodaySunsetTimeStamp]
[@ForecastTodaySunsetTime]
[@ForecastTodayQPFRain]
[@ForecastTodayRainSum]
[@ForecastTodayShowersSum]
[@ForecastTodayQPFSnow]
[@ForecastTodayPrecipitationHours]
[@ForecastTodayDayPart] : #Today#
[@ForecastTodayDayIsDay]
[@ForecastTodayDayWeathercode]
[@ForecastTodayDayIcon]
[@ForecastTodayDayConditions]
[@ForecastTodayDayTemperature]
[@ForecastTodayNightTemperature]
[@ForecastTodayDayHeatIndex]
[@ForecastTodayDayWindChill]
[@ForecastTodayDayHumidity]
[@ForecastTodayDayWindSpeed]
[@ForecastTodayDayWindGusts]
[@ForecastTodayDayWindDirectionDegrees]
[@ForecastTodayDayWindDirectionCompass]
[@ForecastTodayDayPrecipitationPercent]
[@ForecastTodayDayUVIndex]

======================
Day2 - Forecast for the entire day
======================
[@ForecastDay2DateString]
[@ForecastDay2DayLong]
[@ForecastDay2DayShort]
[@ForecastDay2MonthLong]
[@ForecastDay2MonthShort]
[@ForecastDay2DayOfMonth]
[@ForecastDay2HighTemperature]
[@ForecastDay2LowTemperature]
[@ForecastDay2SunriseTimeStamp]
[@ForecastDay2SunriseTime]
[@ForecastDay2SunsetTimeStamp]
[@ForecastDay2SunsetTime]
[@ForecastDay2QPFRain]
[@ForecastDay2RainSum]
[@ForecastDay2ShowersSum]
[@ForecastDay2QPFSnow]
[@ForecastDay2PrecipitationHours]
[@ForecastDay2DayIsDay]
[@ForecastDay2DayWeathercode]
[@ForecastDay2DayIcon] : [&@ForecastDay2DayWeathercode]1
[@ForecastDay2DayConditions] : Variable '[#[&@ForecastDay2DayWeathercode]]'
[@ForecastDay2DayTemperature]
[@ForecastDay2NightTemperature]
[@ForecastDay2DayHeatIndex]
[@ForecastDay2DayWindChill]
[@ForecastDay2DayHumidity]
[@ForecastDay2DayWindSpeed]
[@ForecastDay2DayWindGusts]
[@ForecastDay2DayWindDirectionDegrees]
[@ForecastDay2DayWindDirectionCompass]
[@ForecastDay2DayPrecipitationPercent]
[@ForecastDay2DayUVIndex]


This pattern will repeat for Day3 - Day15

===========================================
MeasureNames Comparison Guide (JSON to API)
===========================================

--------------------------------------------------------------------------------------
WeatherCom MeasureName / New MeasureName <-----> OPENMETEOAPI Includes: YES / NO / NEW
--------------------------------------------------------------------------------------

===========================================
Units of measure
===========================================
[@UnitsType] <-----> NO
- Use 'celsius' or 'fahrenheit' in variables
- Use 'mm' or 'inch' in variables
- Use 'mp/h' | 'km/h' | 'ms' | 'kn' in variables

[@UnitsTemperature] <-----> YES
[@UnitsSpeed] <-----> YES
[@UnitsDistance] <-----> YES
[@UnitsAccumulation] <-----> NO
[@UnitsSnowDepth] <-----> NEW
[@UnitsPrecipitation] <-----> YES
[@UnitsPressure] <-----> YES
[@UnitsPressureInch] <-----> NEW
[@UnitsParticular10] <-----> NEW
[@UnitsParticular2_5] <-----> NEW
[@UnitsSoilMoisture] <-----> NEW

===========================================
Location information
===========================================
[@LocationLatitude] <-----> YES
[@LocationLongitude] <-----> YES
[@LocationAdminDistrict] <-----> NO
[@LocationAdminDistrictCode] <-----> YES
[@LocationCountry] <-----> NO
[@LocationCountryCode] <-----> YES
[@LocationName] <-----> YES
[@LocationLanguageCode] <-----> NO
[@LocationTimeZoneAbbreviation] <-----> YES
[@LocationElevation] <-----> NEW

===========================================
Current weather information
===========================================
[@CurrentPressure] <-----> YES
[@CurrentPressureChangeTrend] <-----> NO
[@CurrentPressureCode] <-----> NO
[@CurrentPressureChangeAmount] <-----> NO
[@CurrentPressureInch] <-----> NEW
[@CurrentDewPoint] <-----> YES
[@CurrentFeelsLike] <-----> YES
[@CurrentWindGust] <-----> YES
[@CurrentHumidity] <-----> YES
[@CurrentIsDay] : 1=day 0=night <-----> NEW
[@CurrentWeathercode] : 0~99 <-----> NEW
[@CurrentIcon] <-----> YES
[@CurrentObservationTimeStamp] <-----> YES
[@CurrentObservationDate] <-----> YES
[@CurrentObservationTime] <-----> YES
[@CurrentConditions] <-----> YES
[@CurrentConditionsMedium] <-----> NO
[@CurrentConditionsShort] <-----> NO
[@CurrentCloudCoverPhrase] <-----> YES
[@CurrentPrecipitationLast24Hours] <-----> YES
[@CurrentRain] <-----> NEW
[@CurrentShowers] <-----> NEW
[@CurrentSnowFall] <-----> NEW
[@CurrentSnowDepth] <-----> YES
[@CurrentTemperature] <-----> YES
[@CurrentTemperatureMaxSince7AM] <-----> NO
[@CurrentUVIndex] <-----> YES
[@CurrentUVDescription] <-----> NO
[@CurrentVisibilityDistance] <-----> YES
[@CurrentVisibilityDistanceMiles] <-----> NEW
[@CurrentVisibilityDistanceKilometers] <-----> NEW
[@CurrentWindSpeed] <-----> YES
[@CurrentWindDirectionCompass] <-----> YES
[@CurrentWindDirectionDegrees] <-----> YES
[@CurrentSunriseTimeStamp] <-----> YES
[@CurrentSunriseTime] <-----> YES
[@CurrentSunSetTimeStamp] <-----> YES
[@CurrentSunsetTime] <-----> YES
[@CurrentParticular10] <-----> NEW
[@CurrentParticular2_5] <-----> NEW
[@CurrentEvaporation] <-----> NEW
[@CurrentSoilTemperature] <-----> NEW
[@CurrentSoilMoisture] <-----> NEW

===========================================
Today - Forecast for the entire day
===========================================
[@ForecastTodayDateString] <-----> YES
[@ForecastTodayDayLong] <-----> YES
[@ForecastTodayDayShort] <-----> YES
[@ForecastTodayMonthLong] <-----> YES
[@ForecastTodayMonthShort] <-----> YES
[@ForecastTodayDayOfMonth] <-----> YES
[@ForecastTodayNarative] <-----> NO
[@ForecastTodayHighTemperature] <-----> YES
[@ForecastTodayLowTemperature] <-----> YES
[@ForecastTodaySunriseTimeStamp] <-----> YES
[@ForecastTodaySunriseTime] <-----> YES
[@ForecastTodaySunsetTimeStamp] <-----> YES
[@ForecastTodaySunsetTime] <-----> YES
[@ForecastTodayQPFRain] <-----> YES
[@ForecastTodayRainSum] <-----> NEW
[@ForecastTodayShowersSum] <-----> NEW
[@ForecastTodayQPFSnow] <-----> YES
[@ForecastTodayPrecipitationHours] <-----> NEW

===========================================
Today - Forecast for "Day"
===========================================
[@ForecastTodayDayPart] <-----> YES
[@ForecastTodayDayLetter] <-----> NO
[@ForecastTodayDayIsDay] <-----> NEW
[@ForecastTodayDayWeathercode] <-----> NEW
[@ForecastTodayDayIcon] <-----> YES
[@ForecastTodayDayConditions] <-----> YES
: Uses Variable '[#[&@ForecastTodayDayWeathercode]]' <-----> NEW
[@ForecastTodayDayConditionsShort] <-----> NO
[@ForecastTodayDayTemperature] <-----> YES
[@ForecastTodayNightTemperature] * <-----> YES
[@ForecastTodayDayHeatIndex] <-----> YES
[@ForecastTodayDayWindChill] <-----> YES
[@ForecastTodayDayNarrative] <-----> NO
[@ForecastTodayDayHumidity] <-----> YES
[@ForecastTodayDayWindSpeed] <-----> YES
[@ForecastTodayDayWindGusts] <-----> YES
[@ForecastTodayDayWindDirectionDegrees] <-----> YES
[@ForecastTodayDayWindDirectionCompass] <-----> YES
[@ForecastTodayDayWindPhrase] <-----> NO
[@ForecastTodayDayPrecipitationPercent] <-----> YES
[@ForecastTodayDayPrecipitationType] <-----> NO
[@ForecastTodayDayPrecipitationAmount] <-----> NO
[@ForecastTodayDayThunderCategory] <-----> NO
[@ForecastTodayDayThunderIndex] <-----> NO
[@ForecastTodayDaySnowAmount] <-----> NO
[@ForecastTodayDaySnowRange] <-----> NO
[@ForecastTodayDayCloudPercent] <-----> NO
[@ForecastTodayDayUVIndex] <-----> YES
[@ForecastTodayDayUVIndexDescription] <-----> NO

===========================================
Day2 - Forecast for the entire day
===========================================
[@ForecastDay2DateString] <-----> YES
[@ForecastDay2DayLong] <-----> YES
[@ForecastDay2DayShort] <-----> YES
[@ForecastDay2MonthLong] <-----> YES
[@ForecastDay2MonthShort] <-----> YES
[@ForecastDay2DayOfMonth] <-----> YES
[@ForecastDay2Narative] <-----> NO
[@ForecastDay2HighTemperature] <-----> YES
[@ForecastDay2LowTemperature] <-----> YES
[@ForecastDay2SunriseTimeStamp] <-----> YES
[@ForecastDay2SunriseTime] <-----> YES
[@ForecastDay2SunsetTimeStamp] <-----> YES
[@ForecastDay2SunsetTime] <-----> YES
[@ForecastDay2QPFRain] <-----> YES
[@ForecastDay2RainSum] <-----> NEW
[@ForecastDay2ShowersSum] <-----> NEW
[@ForecastDay2QPFSnow] <-----> YES
[@ForecastDay2PrecipitationHours] <-----> NEW

===========================================
Day2 - Forecast for "Day"
===========================================
[@ForecastDay2DayIsDay] <-----> NEW
[@ForecastDay2DayWeathercode] <-----> NEW
[@ForecastDay2DayPart] <-----> YES
[@ForecastDay2DayLetter] <-----> NO
[@ForecastDay2DayIcon] <-----> YES
[@ForecastDay2DayConditions] <-----> YES
: Uses Variable '[#[&@ForecastDay2DayWeathercode]]' <-----> NEW
[@ForecastDay2DayConditionsShort] <-----> NO
[@ForecastDay2DayTemperature] <-----> YES
[@ForecastDay2NightTemperature] <-----> YES
[@ForecastDay2DayHeatIndex] <-----> YES
[@ForecastDay2DayWindChill] <-----> YES
[@ForecastDay2DayNarrative] <-----> NO
[@ForecastDay2DayHumidity] <-----> YES
[@ForecastDay2DayWindSpeed] <-----> YES
[@ForecastDay2DayWindGusts] <-----> NEW
[@ForecastDay2DayWindDirectionDegrees] <-----> YES
[@ForecastDay2DayWindDirectionCompass] <-----> YES
[@ForecastDay2DayWindPhrase] <-----> NO
[@ForecastDay2DayPrecipitationPercent] <-----> YES
[@ForecastDay2DayPrecipitationType] <-----> NO
[@ForecastDay2DayPrecipitationAmount] <-----> NO
[@ForecastDay2DayThunderCategory] <-----> NO
[@ForecastDay2DayThunderIndex] <-----> NO
[@ForecastDay2DaySnowAmount] <-----> NO
[@ForecastDay2DaySnowRange] <-----> NO
[@ForecastDay2DayCloudPercent] <-----> NO
[@ForecastDay2DayUVIndex] <-----> YES
[@ForecastDay2DayUVIndexDescription] <-----> NO

This pattern will repeat for Day3 - Day15
======================
New MeasureNames: Units, Current, and Forecasts
======================
[@UnitsParticular10] : μg/m³
[@UnitsParticular2_5] : μg/m³
[@UnitsSoilMoisture] : m³/m³

[@LocationElevation]

[@CurrentPressureInch] : Converts pressure to inches
[@CurrentIsDay] : 1=day 0=night
[@CurrentWeathercode] : 0~99
[@CurrentRain]
[@CurrentShowers]
[@CurrentSnowFall]
[@CurrentSnowDepth]
[@CurrentVisibilityDistanceMiles]
[@CurrentVisibilityDistanceKilometers]
[@CurrentParticular10]
[@CurrentParticular2_5]
[@CurrentEvaporation]
[@CurrentSoilTemperature]
[@CurrentSoilMoisture]

[@ForecastTodayRainSum]
[@ForecastTodayShowersSum]
[@ForecastTodayQPFSnow]
[@ForecastTodayPrecipitationHours]
[@ForecastTodayDayIsDay]
[@ForecastTodayDayWeathercode]
======================
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}
Open-Meteo Win10 Widgets Weather_1.2024.08.23.rmskin


win10weatheropenmeteo.png
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 8443
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Open-Meteo Weather API

Post by Yincognito »

eclectic-tech wrote: November 8th, 2023, 8:58 pm It DOES NOT require an APIKey code to access (for personal use)
Actually, neither does weather.com, if one grabs the JSON contents from the main page (AFAIK I'm the only one taking advantage of this particularity via toggling between modes, though escaped quotes need to be handled first)... ;-)

Other than that, nice job! You must really love jsmorley's .inc files, you now covered at least two weather.com alternatives (that I know of), plus that awesome tutorial on using them .inc files... :thumbup: :rosegift:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2746
Joined: March 23rd, 2015, 5:26 pm

Re: Open-Meteo Weather API

Post by SilverAzide »

eclectic-tech wrote: November 8th, 2023, 8:58 pm
Thanks ET! Great job! I'll give your @includes a test as soon as I have a chance.
Yincognito wrote: November 8th, 2023, 11:41 pm Other than that, nice job! You must really love jsmorley's .inc files, you now covered at least two weather.com alternatives (that I know of), plus that awesome tutorial on using them .inc files... :thumbup: :rosegift:
At least two of us love jsmorley's @includes; SO much easier to deal with than anything that came before. (Thanks jsmorley!)
Gadgets Wiki GitHub More Gadgets...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5540
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Open-Meteo Weather API

Post by eclectic-tech »

Yincognito wrote: November 8th, 2023, 11:41 pm Actually, neither does weather.com, if one grabs the JSON contents from the main page (AFAIK I'm the only one taking advantage of this particularity via toggling between modes, though escaped quotes need to be handled first)... ;-)

Other than that, nice job! You must really love jsmorley's .inc files, you now covered at least two weather.com alternatives (that I know of), plus that awesome tutorial on using them .inc files... :thumbup: :rosegift:
Thanks for that! Yes, you, JSMorley and several other members were instrumental in getting access to free weather data! :rosegift:
And I know your approach is slightly different from the APIKey method :D

It's not that I necessarily "love" the inc files, but they do make creating weather skins simpler by eliminating the need to create multiple measures and letting the author concentrate on the design facets. :thumbup:

Following that idea, it seemed natural to do the same with this API source making it easier to convert an older skin to use this data source.
Weather.com already is blocked in several regions and this source may help those who skins aren't working, get them working again with a few simple code changes.

And who knows how long before weather.com decides it wants everyone to pay for their service :confused:
It happened to almost every other free weather data source in the past. :x

Seeing beautiful weather skins NOT working is detrimental to Rainmeter's usability and public appeal. That is part of what drives me to keep looking for ways to keep things working. :great:

Thanks again!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5540
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Open-Meteo Weather API

Post by eclectic-tech »

SilverAzide wrote: November 8th, 2023, 11:58 pm Thanks ET! Great job! I'll give your @includes a test as soon as I have a chance.


At least two of us love jsmorley's @includes; SO much easier to deal with than anything that came before. (Thanks jsmorley!)
Only 2 of us?! :lol: Thanks!

There are a few differences in the returned data that require handling; distance is in feet or meters, pressure is always in hPa (mb), and the condition codes needed to be converted so any icons sets for TWC will work with Open-Meteo.

One advantage of having different condition codes is the ability to apply your own condition descriptions and/or translate those into any language: a tedious job but allows more customization.
User avatar
Yincognito
Rainmeter Sage
Posts: 8443
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Open-Meteo Weather API

Post by Yincognito »

SilverAzide wrote: November 8th, 2023, 11:58 pm At least two of us love jsmorley's @includes; SO much easier to deal with than anything that came before. (Thanks jsmorley!)
Absolutely, and for sure you're not the only ones loving them! To a point, I guess most of Rainmeter's (stable) data retrieving parts can be made into similar .inc files that can be just plugged into any skin and ease those aspects considerably, but yeah, the weather topic was / is a major area of Rainmeter usage, and the circumstances then made jsmorley's decision a truly inspired - and flexible - one. :great:

P.S. Just to be clear, I didn't mean the above in the wrong way (even though I personally don't use them for reasons specific to my skins and determination to never ever have to fully rewrite a weather skin on every little change the site would make) - I was just referring to the (nice) fact that eclectic-tech seems to "carry on that torch" and expand it with great success to other related areas or sources. I find that... adorable. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 8443
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Open-Meteo Weather API

Post by Yincognito »

eclectic-tech wrote: November 9th, 2023, 12:14 am Thanks for that! Yes, you, JSMorley and several other members were instrumental in getting access to free weather data! :rosegift:
And I know your approach is slightly different from the APIKey method :D
Well, it was a big brainstorming to find a way to do that for all of us back then, everybody contributed one way or another, whether it was about some test, docs, syntax or code parts - and I liked that (that's what teamwork should mean, not some empty concept where individuality is considered inefficient). My approach is not that different, I can still use the APIKey (or not, as a fallback method), it's just tailored for dynamic one period (out of 30, i.e. 15 days and their parts) interrogation and display, and minimal (or no) code change when field names or their order get changed by the site, that's all.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
ZXCVBOT

Re: Open-Meteo Weather API

Post by ZXCVBOT »

I am giving up! This is now my favourite weather skin! Thanks eclectic-tech! I made a slight change here:
background.ini
Check it out once!

Credits: Not me.. I don't know - If someone does, I'll edit it here.
That is a modified background @include file (FrostedGlass plugin was added) from the original suite: TJ Markham's Win10 Widgets
You do not have the required permissions to view the files attached to this post.
ZXCVBOT

Re: Open-Meteo Weather API

Post by ZXCVBOT »

I get that ClipString=2 would set it to auto, but it somehow isn't working for me (can't say if it works with everyone) but since the width is already defined, so why not use ClipString=1? It in this scenario performs a much better job. Edit: This is to be done in the Location-Name area: MeterLocation Edit 2: It looks good in all, except Large.

Also, tiny tweak - comment out: ToolTipType=1 : it is inconsistent in nature in the skin or you can just add TooltipType=1 wherever missing. Personally, I think the newer tooltip would look great.
For testing: Check the last-updated area and wind-gusts tooltip or different-days forecasts.
Last edited by ZXCVBOT on November 9th, 2023, 3:25 pm, edited 1 time in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5540
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Open-Meteo Weather API

Post by eclectic-tech »

"Beauty is in the eye of the beholder..." :welcome:
Feel free to make any modifications you want... I do not plan on changing anything from the original style by TJ Markham