It is currently April 26th, 2024, 4:14 am

weather skin question(s)

Get help with creating, editing & fixing problems with skins
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

weather skin question(s)

Post by JamX »

I've modified my skin with the weather.com solutions provided by forum members:

I have 4 questions:
1] How do I substitute de DayXName from Fri to Friday?
below code does not work???

Code: Select all

[@ForecastDay1Name]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=1
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"
2] The windspeed is now returned in xx km/h
I want it to be only xx and then divided by 1.852 to get knots

3] The wind direction and speed is not included in the forecast measurement

Code: Select all

[@ForecastDay2Name]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=7

[@ForecastDay2Icon]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=8

[@ForecastDay2Date]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=9

[@ForecastDay2Conditions]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=10

[@ForecastDay2High]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=11

[@ForecastDay2HighSymbol]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=12

[@ForecastDay2Low]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=13

[@ForecastDay2LowSymbol]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=14

[@ForecastDay2Precipitation]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=15

[@ForecastDay2PrecipitationSymbol]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=16
How do I get the direction and speed also for the forecasting?

4] The wind direction is returned in SSW or SE
Can these me substituted by degrees (S=180 ; E = 90, ….) so I can use the degrees in a rotator meter

Code: Select all

[MeterWindPointer]
Meter=Rotator
MeasureName=MeasureCurrentWindBearing
ImagePath=#@#WeatherIcons\
ImageName=Roos.png
Imagetint=#RoosTint#
AntiAlias=1
StartAngle=(0*PI)
RotationAngle=(2*PI)
X=55r
Y=5r
OffsetX=(#RoosWidth# / 2)
OffsetY=(#RoosHeight# / 2)
W=(SQRT(#RoosWidth# ** 2 + #RoosHeight# ** 2))
H=(SQRT(#RoosWidth# ** 2 + #RoosHeight# ** 2))
Thanks for the help
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: weather skin question(s)

Post by mak_kawa »

Hi JamX

Not an answer for Q1

Following code with your Substitute= expression does work well and displays "Wednesday".

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=128,128,128,192

[@ForecastDay1Name]
Measure=String
String=Wed
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"

[meterDay1Name]
Meter=String
MeasureName=@ForecastDay1Name
X=5
Y=5
W=75
H=15
Text=%1
So I think, the problem is somewhere other than [@ForecastDay1Name] measure. How is actual output before substitution from this measure?
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: weather skin question(s)

Post by mak_kawa »

For Q2

It depends on the output from the windspeed measure. Probably...there are two ways.

1. Modify RegExp= expression in the Webparser parent measure to capture only speed value.
2. Apply substitution to the output of windspeed measure to get only speed value.

How is an actual value/string from the present windspeed measure?
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: weather skin question(s)

Post by JamX »

mak_kawa wrote: February 20th, 2020, 11:15 am Hi JamX

Not an answer for Q1

Following code with your Substitute= expression does work well and displays "Wednesday".

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=128,128,128,192

[@ForecastDay1Name]
Measure=String
String=Wed
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"

[meterDay1Name]
Meter=String
MeasureName=@ForecastDay1Name
X=5
Y=5
W=75
H=15
Text=%1
So I think, the problem is somewhere other than [@ForecastDay1Name] measure. How is actual output before substitution from this measure?
Actual output = Fri
Should be substituted to Friday
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: weather skin question(s)

Post by JamX »

mak_kawa wrote: February 20th, 2020, 11:25 am For Q2

It depends on the output from the windspeed measure. Probably...there are two ways.

1. Modify RegExp= expression in the Webparser parent measure to capture only speed value.
2. Apply substitution to the output of windspeed measure to get only speed value.

How is an actual value/string from the present windspeed measure?
Actual value = 27 km/h
Desired value is 27
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: weather skin question(s)

Post by mak_kawa »

For Q4

Something like this?

Code: Select all

Update=1000
BackgroundMode=2
SolidColor=128,128,128,192

[WindDirection]
Measure=String
String=S

[WindDirectionValue]
Measure=String
String=[WindDirection]
Substitute="NNE":"22.5","ENE":"67.5","ESE":"112.5","SSE":"157.5","SSW":"202.5","WSW":"247.5","WNW":"292.5","NNW":"337.5","NE":"45","SE":"135","SW":"225","NW":"315","N":"0","E":"90","S":"180","W":"270"
DynamicVariables=1

[WindDirectionPercent]
Measure=Calc
Formula=(100*[WindDirectionValue])/360
DynamicVariables=1

[meterWind]
Meter=String
MeasureName=WindDirection
MeasureName2=WindDirectionValue
MeasureName3=WindDirectionPercent
X=5
Y=5
W=150
H=15
Text=%1: %2 deg. (%3 %)
Sorry if I have mistaken.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: weather skin question(s)

Post by mak_kawa »

Actual value = 27 km/h
Desired value is 27
So, how about Substitute=" km/h":""?
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: weather skin question(s)

Post by mak_kawa »

Actual output = Fri
Should be substituted to Friday
I have no idea why your substitution doesn't work...
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: weather skin question(s)

Post by balala »

JamX wrote: February 20th, 2020, 10:33 am 1] How do I substitute de DayXName from Fri to Friday?
below code does not work???

Code: Select all

[@ForecastDay1Name]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=1
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"
As mak_kawa said, a proper Substitute should definitely work. I'm surprised if the above Substitute doesn't work, because it should. For instance the following does work:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
URLtendday=https://weather.com/en-US/weather/tenday/l/ROXX0035
Forecast=(?siU)(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>).*(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*

[MeasureTenDayAll]
Measure=WebParser
Group=Weather
Url=#URLtendday#
RegExp=(?siU)^(.*)$
UpdateRate=600

[MeasureForecastParent]
Measure=WebParser
Group=Weather
Url=[MeasureTenDayAll]
StringIndex=0
RegExp=#Forecast#
LogSubstringErrors=0

[MeasureWeekday1]
Measure=WebParser
Group=Weather
Url=[MeasureForecastParent]
StringIndex=7
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"

[MeterWeekday]
Meter=STRING
MeasureName=MeasureWeekday1
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
[MeterWeekday] returns right now Friday instead of Fri. Done through the Substitute option of the [MeasureWeekday1] measure.
JamX wrote: February 20th, 2020, 10:33 am 2] The windspeed is now returned in xx km/h
I want it to be only xx and then divided by 1.852 to get knots
Let's say the windspeed is returned as xx km/h by the [MeasureWindSpeed] WebParser measure. To get only its numeric value, you have to use a Substitute option, but I'd use a regular expression substitution, adding the following two options to the [MeasureWindSpeed] measure:

Code: Select all

[MeasureWindSpeed]
...
RegExpSubstitute=1
Substitute="(\d*).*":"\1"
Then to divide the value, you need a Calc measure:

Code: Select all

[MeasureWindSpeedKnots]
Measure=Calc
Formula=( MeasureWindSpeed / 1.852 )
If this doesn't work, add brackets around the MeasureWindSpeed measure name into the Formula option of the above measure AND add a DynamicVariables=1 option as well:

Code: Select all

[MeasureWindSpeedKnots]
Measure=Calc
Formula=( [MeasureWindSpeed] / 1.852 )
DynamicVariables=1
For first, please check the above replies. Do they work? If don't, please post the whole code of your skin as you have it, or even better pack the whole config and upload the package. When I check, will try to figure out the last two questions as well.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: weather skin question(s)

Post by JamX »

mak_kawa wrote: February 20th, 2020, 12:29 pm I have no idea why your substitution doesn't work...
This one I've got working !