It is currently April 23rd, 2024, 5:40 pm

Help with Error message in log (weather skin)

Get help with creating, editing & fixing problems with skins
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Help with Error message in log (weather skin)

Post by scub »

Hello,
I fixed (or trying to fix and make better) a skin that displays the weekly weather temperature in a graph.

it used yahoo for weather data which is broken/unreliable.. I converted it to use weather underground.

I also added an extra day to the graph (Friday) and some tweaks I'm still working on. one problem... in the log I see a few errors. these errors seem to have been there before I started fixing this skin so it might of had an underlining problem the original author didn't solve.

for some reason the values of the variables aren't being passed to other meters and showing a value of "0" in the log file, but all the strings are populated when I look under about>skin tab. anyone help?
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Error message in log (weather skin)

Post by balala »

scub wrote:Hello,
I fixed (or trying to fix and make better) a skin that displays the weekly weather temperature in a graph.

it used yahoo for weather data which is broken/unreliable.. I converted it to use weather underground.

I also added an extra day to the graph (Friday) and some tweaks I'm still working on. one problem... in the log I see a few errors. these errors seem to have been there before I started fixing this skin so it might of had an underlining problem the original author didn't solve.

for some reason the values of the variables aren't being passed to other meters and showing a value of "0" in the log file, but all the strings are populated when I look under about>skin tab. anyone help?
Yeah, it is. Those days when I've created that skin, I wasn't yet careful enough to the error messages in the log.
So, here are the fixes:
  • Add an extremely low numeric value to each denominator of formulas used into the Y options of the [MeterCurrentTempLineOnGraph], [MeterHorizontalMaxTempLine], [MeterHorizontalTodayMinTempLine], [MeterHorizontalTodayMaxTempLine], [MeterCurrentTempOnGraph], [MeterTodayMinTempOnGraph], [MeterTodayMaxTempOnGraph], [Meter1DayMinTempOnGraph], [Meter1DayMaxTempOnGraph], [Meter2DayMinTempOnGraph], [Meter2DayMaxTempOnGraph], [Meter3DayMinTempOnGraph], [Meter3DayMaxTempOnGraph], [Meter4DayMinTempOnGraph], [Meter4DayMaxTempOnGraph], [Meter5DayMinTempOnGraph] and [Meter5DayMaxTempOnGraph] measures. Eg, the formula of the Y option of [MeterCurrentTempLineOnGraph] meter should be: Y=(200*(1-(([MeasureCurrentTemp]-[MeasureMinTemp])/([MeasureMaxTemp]-[MeasureMinTemp][color=#FF0000]+0.001[/color])))+#OffsetY#). These very small values don't change the result, but makes the denominators to be different then 0. This step will avoid y lot of error messages. Also, the quotation marks around the formula aren't needed, you can remove them.
  • The "Extra operation in key:..." messages are given by the fact that initially when the skin is loaded, the WebParser measures don't have yet a value. Details: https://forum.rainmeter.net/viewtopic.php?p=119130#p119130
    To fix this problem, just add a Substitute="":"0" option to each of the following measures: [MeasureCurrentTemp], [MeasureTodayMaxTemp], [MeasureTodayMinTemp] and [MeasureMinTemp].
  • And finally also add the same small value as you did above, to both denominators of the Formula of [MeasureDegreeUnit] measure:

    Code: Select all

    [MeasureDegreeUnit]
    Measure=Calc
    Formula=(( MeasureTodayMaxTemp <> 0 ) ? (( Abs ( [MeterTodayMaxTempOnGraph:Y] - [MeterHorizontalAxis:Y] + 1 )) / ( Abs ( MeasureTodayMaxTemp + 0.001 ))) : (( Abs ( [MeterTodayMinTempOnGraph:Y] - [MeterHorizontalAxis:Y] + 1 )) / ( Abs ( MeasureTodayMinTemp + 0.001 ))))
    DynamicVariables=1
Now please check the messages in the log. Is it ok now?
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Help with Error message in log (weather skin)

Post by scub »

that fixed it. I knew it was something rather simple.

i'm not very good with the lines and bars part, the math just drives me nuts, but I'm pretty good with the pulling the data and parsing it out.. I was surprised you can make these line graph with rainmeter. thanks a bunch and what a surprise that I bumped into the original author here. love the work, keep doing it, I'm a huge weather geek :D

cheers.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Error message in log (weather skin)

Post by balala »

Thanks for using my work, but don't be surprised you bumped into the author of the skin, I'm usually here on the forum, keeping my eyes on the new posts / questions.
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Help with Error message in log (weather skin)

Post by scub »

here are some tweaks I made.
I don't know if this was already present, but there is only one minor bug that I noticed.. if the temp is lower than the current day temp (52 for example) on any given day (such as Saturday) the line will go a bit below it. Today and Friday both have low temp of 52, but for Sat 51 it goes slightly below the bar.

the weather underground API feed has tons more weather information and I noticed they also use precise temperature, for example. 53.X with extra decimal. I don't know if this is causing problems with your original code, but not a big issue.

cheers.

Edit: Ok I see that "MeasureMinTemp" is 52, looks like it should be 51 instead. wonder if extra decimal in temperature causing it. I don't think so..

does this look right?

Code: Select all

[MeasureMinTemp]
Measure=Calc
Formula=Min(MeasureCurrentTemp, Min(MeasureTodayMinTemp, Min(Measure1DayMinTemp, Min(Measure2DayMinTemp, Min(Measure3DayMinTemp, Max(Measure4DayMinTemp, Max(Measure5DayMinTemp, Max(Measure6DayMinTemp, Max(Measure7DayMinTemp, Measure8DayMinTemp)))))))))
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Error message in log (weather skin)

Post by balala »

It's hard for me to say something relevant, because I should get the same values as you have on the posted image, but I can't. Right now I have totally different values. Due to this, the only thing I can say now is that I'll try to figure out next days what's happening.
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Help with Error message in log (weather skin)

Post by scub »

I made some more changes to the data weather parser.
there is so much data potential to this skin to really turn this into a weather power house. the data is maybe 10 more than you can get from weather.com or yahoo.. they even have other API data to get more weather data (alerts, sea temps, hurricanes, etc)..

anyhow,
I attached the new graph to this post, I put some info in the skin/meter at the top of the variable section for the link get API key from weather underground in case you wanted to play around with it, or get more precise weather data ;) the key is free for developers.

I may expand it with more data in the future since I already did much of the regexp syntax on another version I saved for improving further.


you can see in this image how it sometimes the line will dip below the meter when "MeasureMinTemp" isn't always the min temp. it's working fine now so I have to wait until it happens again to test. maybe you'd have better luck finding the problem as you have more experience than I do.

cheers
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Error message in log (weather skin)

Post by balala »

scub wrote:you can see in this image how it sometimes the line will dip below the meter when "MeasureMinTemp" isn't always the min temp. it's working fine now so I have to wait until it happens again to test. maybe you'd have better luck finding the problem as you have more experience than I do.
That's not a question of experience, better it's one of luck. Me too have to wait for a moment when the line dips bellow the horizontal axis. I'll try to figure out something, but maybe I need some time.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Error message in log (weather skin)

Post by balala »

scub wrote:you can see in this image how it sometimes the line will dip below the meter when "MeasureMinTemp" isn't always the min temp. it's working fine now so I have to wait until it happens again to test. maybe you'd have better luck finding the problem as you have more experience than I do.
Found the issue: the formula of the [MeasureMinTemp] measure is wrong. I suppose you've copied the formula of the [MeasureMaxTemp] measure and have changed the Max functions to Min, but you didn't make these changes to the end: the first 5 are changed, the rest aren't. To fix the issue, just replace the following marked Max functions, with Min: Formula=Min(MeasureCurrentTemp, Min(MeasureTodayMinTemp, Min(Measure1DayMinTemp, Min(Measure2DayMinTemp, Min(Measure3DayMinTemp, [color=#FF0000]Max[/color](Measure4DayMinTemp, [color=#FF0000]Max[/color](Measure5DayMinTemp, [color=#FF0000]Max[/color](Measure6DayMinTemp, [color=#FF0000]Max[/color](Measure7DayMinTemp, Measure8DayMinTemp)))))))))
This issue can cause troubles only sometimes, when the lowest temperature is the 4th day temperature or a later one. This explains why sometimes the function is working well, while other times it doesn't.
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Help with Error message in log (weather skin)

Post by scub »

aye..guess it couldn't be more obvious that I actually posted the code I broke and managed to not notice it. :D
thanks again.