It is currently May 18th, 2024, 4:17 am

Open-Meteo Weather API

Weather skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7266
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Open-Meteo Weather API

Post by Yincognito »

yuo wrote: May 2nd, 2024, 11:05 am I am new on Rainmeter in general and I WANT TO MAKE THIS WIDGET WORK. i am still honestly getting a gist of these codes and whatsoever. Can someone help me customize this skin to make it work :-( :-( :-(
The "wxdata" way to retrieve weather data that you have in that skin is obsolete for a long time now, and won't work anymore. Here's a tutorial by eclectic-tech on how to create a weather skin from scratch, which you can easily adapt for an existing skin like yours:
https://forum.rainmeter.net/viewtopic.php?t=36016
Basically, it's just about copying those .inc files to your skin, having the corresponding @include options in the code to use them, and then referencing whatever @SomeMeasure measure you need to get weather data. Such a measure would be one of the measures listed here:
https://forum.rainmeter.net/viewtopic.php?t=34628
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
yuo
Posts: 3
Joined: May 2nd, 2024, 11:02 am

Re: Open-Meteo Weather API

Post by yuo »

I am aiming to use Open-Meteo API, but I still tried to follow the methods u said but It's still not working, plus I spent hours created a weather widgets that displays Letters IM LITERALLY CRYING :? :? help a boy out please good sir :rosegift: :rosegift:
User avatar
Yincognito
Rainmeter Sage
Posts: 7266
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Open-Meteo Weather API

Post by Yincognito »

yuo wrote: May 3rd, 2024, 6:07 am I am aiming to use Open-Meteo API, but I still tried to follow the methods u said but It's still not working, plus I spent hours created a weather widgets that displays Letters IM LITERALLY CRYING :? :? help a boy out please good sir :rosegift: :rosegift:
Sorry about that, was a little tired yesterday when replying and I referred to the WeatherCom API instead of the Open-Meteo one. That being said, you have all the instructions you need to either create or convert a skin to use the Open-Meteo API on the first page of this thread, and they are not that different from the WeatherCom API ones.

So, just extract the contents of the @includeFiles.zip linked on that page to your @Resources folder in your skin, and then use something like this in Mini_weather.ini file:

Code: Select all

[Variables]
@includeVariables=#@#OpenMeteoAPIVariables.inc
@includeTranslation=#@#OpenMeteoAPIEnglish.inc

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

---Measures---

@includeForecast=#@#OpenMeteoAPIMeasures5Day.inc

---Meters---

[LargeShape]
Meter=Shape
Shape=Rectangle 0,0,308,100 | Fill LinearGradient Gradient | StrokeWidth 0
Gradient=90 | 50,50,50,200 ; 0.0 | 100,100,100,150 ; 1.0
Padding=2,2,2,2
AntiAlias=1

[MeterCondition]
Meter=String
MeasureName=@CurrentConditions
ClipString=1
W=200
X=15
Y=25
FontFace=Planer
FontSize=20
FontColor=255,255,255
AntiAlias=1

[MeterLocation]
Meter=String
MeasureName=@LocationName
X=2r
Y=60
FontFace=Planer
FontSize=12
FontColor=255,255,255
AntiAlias=1

[Divider]
Meter=Image
SolidColor=255,255,255,150
X=228
Y=15
H=75
W=2
AntiAlias=1

[Icon]
Meter=Image
MeasureName=@CurrentIcon
ImagePath=#@#Icons
X=16R
Y=15
W=50
AntiAlias=1

[MeterTemp]
Meter=String
StringAlign=Center
MeasureName=@CurrentTemperature
X=([Icon:X] + [Icon:W] / 2)
Y=R
FontFace=Planer
FontSize=16
FontColor=255,255,255
FontWeight=500
Postfix="[\x00B0]"
AntiAlias=1
For some reason, when trying to use @includeForecast=#@#OpenMeteoAPIMeasures.inc, the skin exhibits an abnormally high CPU usage, so I had to use the 5Day variant there. Yes, I know about the slight appearance of "[#]" while weather data is retrieved, but I didn't bother to workaround that, even eclectic-tech uses another string to cover that, in his sample skin from the first page of this thread. As for changing the location and such, you do it by editing the corresponding stuff in the ...\[SkinFolder]\@Resources\OpenMeteoAPIVariables.inc file. In the sample skin posted by eclectic-tech, this setting up process is a bit more user friendly, but the skin you mentioned didn't have that and was made for an entirely different weather source, i.e. the weather.com one.

I guess for more details about the inner workings of his skin structure, eclectic-tech's input would be needed. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
yuo
Posts: 3
Joined: May 2nd, 2024, 11:02 am

Re: Open-Meteo Weather API

Post by yuo »

Thank you so much! I've been wanting to add this widget for a long-time now, may god bless u good sir! :givelove:
User avatar
Yincognito
Rainmeter Sage
Posts: 7266
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Open-Meteo Weather API

Post by Yincognito »

yuo wrote: May 6th, 2024, 8:14 am Thank you so much! I've been wanting to add this widget for a long-time now, may god bless u good sir! :givelove:
You're welcome, I'm glad you're satisfied with the result. Enjoy! :great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth