It is currently September 30th, 2024, 1:29 am

How store latest weather conditions ?

General topics related to Rainmeter.
quasar
Posts: 17
Joined: December 25th, 2010, 5:14 pm

How store latest weather conditions ?

Post by quasar »

Hi all,
I'm using VCloudsWeather2 but I think is the same for others weather skins.

I would to store last weather conditions... so if I restart the PC, and I'm not connected to Internet, the weather skin shows last icon condition instead nothing.
Is this possible introducing specific code inside skin INI file ?
Is there another trick to do this ?

Thanks.
Alex Becherer

Re: How store latest weather conditions ?

Post by Alex Becherer »

you could add a FinishAction on the main WebParser measure and have it using the WriteKeyValue !bang to overwrite some variaibles.

have two groups of meters. one that displays the variables. second one displays the measueres. second group is hidden by default.

add hiding meter group one / showing meter group two to the FinishAction above.
quasar
Posts: 17
Joined: December 25th, 2010, 5:14 pm

Re: How store latest weather conditions ?

Post by quasar »

Alex Becherer wrote:you could add a FinishAction on the main WebParser measure and have it using the WriteKeyValue !bang to overwrite some variaibles.
have two groups of meters. one that displays the variables. second one displays the measueres. second group is hidden by default.
add hiding meter group one / showing meter group two to the FinishAction above.
Hi Alex !
Unfortunatly I'm not a strong Rainmeter coder... can you teach me ?
Below I post a piece of weather code:

Code: Select all

[MeasureCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=
RegExp="(?siU).*<locale>(.*)</locale>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*<loc id="(.*)">.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<zone>(.*)</zone>.*<cc>.*<lsup>(.*)</lsup>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*<dewp>(.*)</dewp>.*<moon>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<ppcp>(.*)</ppcp>.*"


[Today]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=
RegExp="(?siU)<dayf>.*<lsup>(.*)</lsup>.*<day d="0" t="(.*)" dt="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<part p="d">.*<icon>(.*)</icon>.*<t>(.*)</t>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<bt>(.*)</bt>.*<ppcp>(.*)</ppcp>.*<hmid>(.*)</hmid>.*<part p="n">.*<icon>(.*)</icon>.*<t>(.*)</t>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<bt>(.*)</bt>.*<ppcp>(.*)</ppcp>.*<hmid>(.*)</hmid>.*"
Disabled=#Today#


[MeasureForcastToday+1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5400
Url=
RegExp="(?siU)<day d="1" t="(.*)" dt="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<part p="d">.*<icon>(.*)</icon>.*<t>(.*)</t>.*"


[MeasureForcastToday+2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5400
Url=
RegExp="(?siU)<day d="2" t="(.*)" dt="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<part p="d">.*<icon>(.*)</icon>.*<t>(.*)</t>.*"

;=================MEASURES=================

;---Current---

[MeasureIconCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=20
...


;---Today---


[MeasureWeatherDesc1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=9
Substitute=" And ":" and "
Disabled=#Today#

[MeasureWeatherDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=2
Disabled=#Today#

[MeasureWeatherTemp1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=4
Substitute="N/A":"666"
Disabled=#Today#

[MeasureWeatherIcon1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Path=#Icon#
Url=[Today]
StringIndex=8
Disabled=#Today#

[CheckNATemp]
Measure=Calc
Formula=[MeasureWeatherTemp1]
IfBelowValue=665
IfBelowAction=!execute [!RainmeterHideMeter MeterNightTemp1][!RainmeterHideMeter MeterNightDay1][!RainmeterHideMeter MeterNightDesc1][!RainmeterHideMeter MeterNightIcon1][!RainmeterShowMeter MeterTemp1][!RainmeterShowMeter MeterDay1][!RainmeterShowMeter MeterDesc1][!RainmeterShowMeter MeterIcon1]
IfEqualValue=666
IfEqualAction=!execute [!RainmeterHideMeter MeterTemp1][!RainmeterHideMeter MeterDay1][!RainmeterHideMeter MeterDesc1][!RainmeterHideMeter MeterIcon1][!RainmeterShowMeter MeterNightTemp1][!RainmeterShowMeter MeterNightDay1][!RainmeterShowMeter MeterNightDesc1][!RainmeterShowMeter MeterNightIcon1]
DynamicVariables=1
Disabled=#Today#

;---Tonight---


[MeasureWeatherDesc1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=9
Substitute=" And ":" and "
Disabled=#Today#

[MeasureWeatherDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=2
Disabled=#Today#

[MeasureWeatherTemp1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=4
Substitute="N/A":"666"
Disabled=#Today#

[MeasureWeatherIcon1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Path=#Icon#
Url=[Today]
StringIndex=8
Disabled=#Today#

[CheckNATemp]
Measure=Calc
Formula=[MeasureWeatherTemp1]
IfBelowValue=665
IfBelowAction=!execute [!RainmeterHideMeter MeterNightTemp1][!RainmeterHideMeter MeterNightDay1][!RainmeterHideMeter MeterNightDesc1][!RainmeterHideMeter MeterNightIcon1][!RainmeterShowMeter MeterTemp1][!RainmeterShowMeter MeterDay1][!RainmeterShowMeter MeterDesc1][!RainmeterShowMeter MeterIcon1]
IfEqualValue=666
IfEqualAction=!execute [!RainmeterHideMeter MeterTemp1][!RainmeterHideMeter MeterDay1][!RainmeterHideMeter MeterDesc1][!RainmeterHideMeter MeterIcon1][!RainmeterShowMeter MeterNightTemp1][!RainmeterShowMeter MeterNightDay1][!RainmeterShowMeter MeterNightDesc1][!RainmeterShowMeter MeterNightIcon1]
DynamicVariables=1
Disabled=#Today#
---


[MeasureWeatherNightDesc]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=18
Substitute=" And ":" and "
Disabled=#Today#

[MeasureWeatherNightTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=5
Disabled=#Today#

[MeasureWeatherNightIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Today]
StringIndex=17
Disabled=#Today#


;=================METERS=================

;---Current---


[MeterCurrentIcon]
Path=#Icons#
MeasureName=MeasureIconCurrent
Meter=Image
PreserveAspectRatio=1
AntiAlias=1
X=#CurrentIcons-X#
Y=#CurrentIcons-Y#
W=#CurrentIconsSize#
SolidColor=0,0,0,1

[MeterLocationCurrent]
MeasureName=MeasureLocationCurrent
Meter=String
X=#City&Update-X#
Y=#City&Update-Y#
H=14
W=172
FontColor=#FontColor1#
FontFace=#FontFace#
FontSize=#LocationFont#
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
FontEffectColor=#FontEffectColor#
SolidColor=0,0,0,1
AntiAlias=1
ClipString=1
Hidden=#City&Update#
ToolTipText=Open Weather.com
ToolTipType=1
LeftMouseDownAction=!execute ["#WEATHER.COM#"]

[MeterUpdateCurrent]
MeasureName=MeasureUpdateCurrent
Meter=String
X=1r
Y=12r
H=11
W=185
FontColor=#FontColor2#
FontFace=#FontFace#
FontSize=#WeatherUpdateFont#
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
FontEffectColor=#FontEffectColor#
AntiAlias=1
ClipString=1
Text="Updated at %1"
Hidden=#City&Update#

[MeterTempCurrent]
MeasureName=MeasureTempCurrent
MeasureName2=MeasureTempUnitCurrent
Meter=String
X=#CurrentTemp-X#
Y=#CurrentTemp-Y#
FontColor=#FontColor5#
FontFace=#FontFace#
FontSize=#CurrentTempFont#
StringAlign=LEFT
StringStyle=BOLD
StringEffect=BORDER
FontEffectColor=#FontEffectColor#
AntiAlias=1
Text="%1˚%2"

[MeterConditionsCurrent]
MeasureName=MeasureConditionsCurrent
Meter=String
X=#CurrentConditions-X#
Y=#CurrentConditions-Y#
W=#CurrentConditions-W#
H=20
FontColor=#FontColor5#
FontFace=#FontFace#
FontSize=#CurrentConditionsFont#
StringStyle=BOLD
StringAlign=LEFT
StringEffect=BORDER
FontEffectColor=#FontEffectColor#
AntiAlias=1
ClipString=1
In other skins I see commands like this:

Code: Select all

MouseOverAction=!Execute [!RainmeterShowMeter SECTION][!RainmeterRedraw]
but I dont know which option I need and where add WriteKeyValue !bang and FinishAction...

thanks.
Alex Becherer

Re: How store latest weather conditions ?

Post by Alex Becherer »

i'm a rather bad teacher with my Pidgin English. the official documentation provides far better information than i could ever do.

start here:
http://rainmeter.net/cms/Rainmeter101-EditingSkins

more specific info on what i was talking about:
http://rainmeter.net/cms/Plugins-WebParser_beta
http://rainmeter.net/cms/Bangs_beta


please note: the method i mentioned above is just one way out of a few to solve your problem. there are more, and probably better ways.

for example: using the the WriteKeyValue !bang directly in the Text settings of the meters

or using DownloadFile to download the whole rss feed and parsing the local file instead of the internet
quasar
Posts: 17
Joined: December 25th, 2010, 5:14 pm

Re: How store latest weather conditions ?

Post by quasar »

Alex Becherer wrote:i'm a rather bad teacher with my Pidgin English. the official documentation provides far better information than i could ever do.

start here:
http://rainmeter.net/cms/Rainmeter101-EditingSkins

more specific info on what i was talking about:
http://rainmeter.net/cms/Plugins-WebParser_beta
http://rainmeter.net/cms/Bangs_beta


please note: the method i mentioned above is just one way out of a few to solve your problem. there are more, and probably better ways.

for example: using the the WriteKeyValue !bang directly in the Text settings of the meters

or using DownloadFile to download the whole rss feed and parsing the local file instead of the internet
Thanks... but probably I need to know where weather images and mesures are stored... so I can "freeze" it.
User avatar
thatsIch
Posts: 446
Joined: August 7th, 2012, 9:18 pm

Re: How store latest weather conditions ?

Post by thatsIch »

weather images are generally stored within the skin folder.
they are consicutive numbers to display difference weather circumstances.

Measures are objects which can retriece certain information.
Here these information are about weather using the WebParser-Plugin.
A Webparser is able to download/parse the page its accessing
and therefor retrieving information like temperature/which weather icon etc from pages as

weather.com

You access these information by using the MeasureName Field in Meters as
MeasureName = WebParserMeasureName. The Meter will automatically display these Information when used a certain StringIndex in your WebParser.

Usefull links to google would be
- WebParser Rainmeter
- Regexpression
- Measure Rainmeter

And Please read the links Alex posted, cause you obviously didnt or havent read throughly, especially the

http://rainmeter.net/cms/Rainmeter101-EditingSkins

If you dont understand a certain part, feel free to ask. If you don't know what "Measure" means etc, read up the aspect in the manual. Else you will just confused by words we use casually :3

- Ich