It is currently October 14th, 2024, 9:01 pm

Weather Skins Not Working

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22856
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

If it's easier for your calculations, you can also use the actual "timestamps" for Sunrise / Sunset from the measures.


2.jpg
You do not have the required permissions to view the files attached to this post.
bravo-lemur
Posts: 24
Joined: August 20th, 2020, 8:49 pm

Re: Weather Skins Not Working

Post by bravo-lemur »

jsmorley wrote: August 20th, 2020, 11:28 pm

Code: Select all

[MeasureSunRiseHourString]
Measure=String
String=[@CurrentSunriseTime]
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureSunRiseMinuteString]
Measure=String
String=[@CurrentSunriseTime]
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureSunRiseHourNumber]
Measure=Calc
Formula=[MeasureSunRiseHourString]
DynamicVariables=1

[MeasureSunRiseMinuteNumber]
Measure=Calc
Formula=[MeasureSunRiseMinuteString]
DynamicVariables=1
That seems to work, thank you! The only thing I noticed is that if the minutes is 00 in the string, it gets converted to 0 in the number. So if the sunrise time is 6:00, it displays as 6:0 instead.

I've currently got the following code, which seems to be working for the roundline suntrail (Meter=Roundline, MeasureName=MeasurePosition2), although I'll double check tomorrow during the day!

Code: Select all

[MeasureCurrentHourString]
Measure=String
String=[@CurrentObservationTime]
StringIndex=44
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureCurrentMinuteString]
Measure=String
String=[@CurrentObservationTime]
StringIndex=45
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureCurrentHourNumber]
Measure=Calc
Formula=[MeasureCurrentHourString]
DynamicVariables=1

[MeasureCurrentMinuteNumber]
Measure=Calc
Formula=[MeasureCurrentMinuteString]
DynamicVariables=1

[MeasureSunRiseHourString]
Measure=String
String=[@CurrentSunriseTime]
StringIndex=46
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureSunRiseMinuteString]
Measure=String
String=[@CurrentSunriseTime]
StringIndex=47
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureSunRiseHourNumber]
Measure=Calc
Formula=[MeasureSunRiseHourString]
DynamicVariables=1

[MeasureSunRiseMinuteNumber]
Measure=Calc
Formula=[MeasureSunRiseMinuteString]
DynamicVariables=1

[MeasureSunsetHourString]
Measure=String
String=[@CurrentSunsetTime]
StringIndex=48
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureSunsetMinuteString]
Measure=String
String=[@CurrentSunsetTime]
StringIndex=49
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureSunsetHourNumber]
Measure=Calc
Formula=[MeasureSunsetHourString]
DynamicVariables=1

[MeasureSunsetMinuteNumber]
Measure=Calc
Formula=[MeasureSunsetMinuteString]
DynamicVariables=1

[MeasureDifferenceMin]
Measure=Calc
Formula=(MeasureSunsetHourNumber*60+MeasureSunsetMinuteNumber)-(MeasureSunRiseHourNumber*60+MeasureSunRiseMinuteNumber)
Group=Weather
DynamicVariables=1

[MeasurePosition1]
Measure=Calc
Formula=((MeasureCurrentHourNumber*60+MeasureCurrentMinuteNumber)-(MeasureSunRiseHourNumber*60+MeasureSunsetMinuteNumber))/(MeasureDifferenceMin=0?1:MeasureDifferenceMin)
Group=Weather
DynamicVariables=1

[MeasurePosition2]
Measure=Calc
Formula=MeasurePosition1 < 0 ? 0 : (MeasurePosition1 < 1 ? MeasurePosition1 : 1)
Group=Weather
DynamicVariables=1
User avatar
jsmorley
Developer
Posts: 22856
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

bravo-lemur wrote: August 20th, 2020, 11:43 pm That seems to work, thank you! The only thing I noticed is that if the minutes is 00 in the string, it gets converted to 0 in the number. So if the sunrise time is 6:00, it displays as 6:0 instead.

I've currently got the following code, which seems to be working for the roundline suntrail (Meter=Roundline, MeasureName=MeasurePosition2), although I'll double check tomorrow during the day!

Code: Select all

[MeasureCurrentHourString]
Measure=String
String=[@CurrentObservationTime]
StringIndex=44
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureCurrentMinuteString]
Measure=String
String=[@CurrentObservationTime]
StringIndex=45
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureCurrentHourNumber]
Measure=Calc
Formula=[MeasureCurrentHourString]
DynamicVariables=1

[MeasureCurrentMinuteNumber]
Measure=Calc
Formula=[MeasureCurrentMinuteString]
DynamicVariables=1

[MeasureSunRiseHourString]
Measure=String
String=[@CurrentSunriseTime]
StringIndex=46
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureSunRiseMinuteString]
Measure=String
String=[@CurrentSunriseTime]
StringIndex=47
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureSunRiseHourNumber]
Measure=Calc
Formula=[MeasureSunRiseHourString]
DynamicVariables=1

[MeasureSunRiseMinuteNumber]
Measure=Calc
Formula=[MeasureSunRiseMinuteString]
DynamicVariables=1

[MeasureSunsetHourString]
Measure=String
String=[@CurrentSunsetTime]
StringIndex=48
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureSunsetMinuteString]
Measure=String
String=[@CurrentSunsetTime]
StringIndex=49
Group=Weather
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureSunsetHourNumber]
Measure=Calc
Formula=[MeasureSunsetHourString]
DynamicVariables=1

[MeasureSunsetMinuteNumber]
Measure=Calc
Formula=[MeasureSunsetMinuteString]
DynamicVariables=1

[MeasureDifferenceMin]
Measure=Calc
Formula=(MeasureSunsetHourNumber*60+MeasureSunsetMinuteNumber)-(MeasureSunRiseHourNumber*60+MeasureSunRiseMinuteNumber)
Group=Weather
DynamicVariables=1

[MeasurePosition1]
Measure=Calc
Formula=((MeasureCurrentHourNumber*60+MeasureCurrentMinuteNumber)-(MeasureSunRiseHourNumber*60+MeasureSunsetMinuteNumber))/(MeasureDifferenceMin=0?1:MeasureDifferenceMin)
Group=Weather
DynamicVariables=1

[MeasurePosition2]
Measure=Calc
Formula=MeasurePosition1 < 0 ? 0 : (MeasurePosition1 < 1 ? MeasurePosition1 : 1)
Group=Weather
DynamicVariables=1
Yeah, I wouldn't use the "number" value to display the minutes. You are going to want the "string" value from the String measure, which will display the minutes as "00". Use the "number" value for calculations. "00" is not a valid number. That is why I used String measures to extract the values, and Calc measures to turn that into actual numbers.
User avatar
Yincognito
Rainmeter Sage
Posts: 8465
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

Yep, after some analysis, it turns out that the differences are indeed minor in the webpage JSON. Just the name of the forecast section and some other subsection that was introduced at the end of the forecast one (called responseHeaders). In my case the "fix" is trivial and I've already identified it, I'm just weighing in which pattern would be best suited for it. So far my aim of requiring only minor adaptations in my skin when weather.com JSON changes remains intact.

Regarding jsmorley's "standardization" around his .inc files, I agree 95% - I'm all for standardization in general, as long as the solution is efficient and comprehensive. However, what happens when everybody is in the same boat (so to speak) is that everyone "navigates" properly when things go well, but when things go south everybody drowns. In other words, a single solution works well if it suits circumstances, but when it doesn't anymore, it leaves you without alternatives. That's why while I'm all for the same data "back-end" in theory, I must admit that in practice having multiple options to choose from is quite useful when issues arise. Like with everything in life, moderation is a good approach here as well.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
katastrofa
Posts: 2
Joined: August 21st, 2020, 9:02 am

Re: Weather Skins Not Working

Post by katastrofa »

hello, my english is not the best
can someone tell me where to insert the code for my city

Code: Select all

[Rainmeter]
AccurateText=1
Update=1000
Group=Sephi

[Metadata]
Name=Weather
Author=Sephirotess
Information=Weather. A large portion of code is taken from JSMorley.
Version=1.1
License=Creative Commons Attribution-Noncommercial-Share Alike 4.0 License

@include=#@#Measures\Divers\Weather.inc
User avatar
ikarus1969
Posts: 591
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Weather Skins Not Working

Post by ikarus1969 »

As i can see the skin is/was made by sephirotess. This user once posted a lot of skins but did not post anything recently. It's unclear if the skin you use is already updated to reflect the latest changes in the used weather-site(s).

So please post a link where you downloaded the skin so we can have a look at it?
User avatar
Yincognito
Rainmeter Sage
Posts: 8465
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

katastrofa wrote: August 21st, 2020, 9:11 amhello, my english is not the best
can someone tell me where to insert the code for my city
ikarus1969 wrote: August 21st, 2020, 9:38 am As i can see the skin is/was made by sephirotess. This user once posted a lot of skins but did not post anything recently. It's unclear if the skin you use is already updated to reflect the latest changes in the used weather-site(s).

So please post a link where you downloaded the skin so we can have a look at it?
Although sephirotess usually reuses the code and only builds a different visual appearance for each of his skin suites so it's a bit difficult to identify the skin we're talking about, I believe this could be this skin. The text matches the one posted above, it's even a higher version (i.e. 1.2), judging from the Version string, but still uses the old wxdata. In other words, if version 1.2 used wxdata, then for sure version 1.1 did as well, so no jsmorley's .inc files for this, I suppose. The skin will probably have to be entirely rewritten to be up to date with the changes...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
katastrofa
Posts: 2
Joined: August 21st, 2020, 9:02 am

Re: Weather Skins Not Working

Post by katastrofa »

ikarus1969 wrote: August 21st, 2020, 9:38 am As i can see the skin is/was made by sephirotess. This user once posted a lot of skins but did not post anything recently. It's unclear if the skin you use is already updated to reflect the latest changes in the used weather-site(s).

So please post a link where you downloaded the skin so we can have a look at it?
https://visualskins.com/skin/botanicula-vr11

If it can't work, recommend one that can
User avatar
Yincognito
Rainmeter Sage
Posts: 8465
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

katastrofa wrote: August 21st, 2020, 10:20 am https://visualskins.com/skin/botanicula-vr11

If it can't work, recommend one that can
Yep, this works with the now defunct wxdata.com, so the effort of converting it is probably bigger than the gain. Take a look here or here. The skin from the last link (by jsmorley) works for sure, as it uses the API JSON and not the main site one. Even the other skins should work in theory, as long as you copy jsmorley's .INC files in order to update the code that parses the JSON.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
5T3F4N
Posts: 1
Joined: September 10th, 2020, 12:26 pm

Re: Weather Skins Not Working

Post by 5T3F4N »

Hey guys, you're much more experienced than me, but I think my old wxdata weather just started working again last night, and it works today as well. Can anyone confirm?

I remember something happened with weather couple months back, but I was too busy to read the forums and everything, so I left it like that, it was just showing the clock, and suddenly yesterday night, all weather icons appeared, temperatures etc.