It is currently October 9th, 2024, 5:15 pm

JSBarometer

Weather skins
User avatar
jsmorley
Developer
Posts: 22847
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

Post by jsmorley »

shellerik wrote: April 29th, 2020, 1:18 am What a wonderful idea for a weather skin! I was able to easily customize it to fit in with my existing skins.

Image
Very nice.
User avatar
jsmorley
Developer
Posts: 22847
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

Post by jsmorley »

Corrected the .rmskin in the first post of this thread to change the @Include .inc files to reflect the new V3 version of the JSON on weather.com.
User avatar
jsmorley
Developer
Posts: 22847
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

Post by jsmorley »

Ok, I think I have fully addressed the new issues with the weather.com site.

Please get the .rmskin in the first post of this thread.

ONE IMPORTANT NOTE!

The new approach of using the API for the weather.com JSON requires a change to how you access a particular location.

All of the location "codes", like USVA0944 or bbd510e73cb5870f973cea9253bb1f9bfe239a129dfc2b89589cbb6d2d46b4bc or 22308 and such are NO LONGER SUPPORTED.

The new approach requires that you provide a Latitude and Longitude in the WeatherComJSONVariables.inc file. See that file for details on how you can get that for your location.

Please read WeatherCOMJSONVariables.inc carefully, it HAS changed.
Wim
Posts: 72
Joined: September 22nd, 2010, 8:30 pm

Re: JSBarometer

Post by Wim »

Since i had some issues with my own version of jsbarometer i downloaded it again from the first post in this thread a few days ago to get the original version. I thought that the issues with my own version were due to the changes i made but it turns out that the original version i downloaded has the same issue.

It doesn't update. In Rainmeter i can see the actual values it should be displaying but it hasn't updated the skin (see screenshot) and it's still showing the values from the previous refresh. A manual refresh is the only way to update the skin.

I've solved it (sort of) bij removing

Code: Select all

UpdateDivider=-1
with the [MeasureLuaScript] and [CurrentPressurePercent] measures; it does now update, so i don't have tot do a manual refresh to update the skin all the time.

But those lines were there for a reason i figure and i still don't understand why it wasn't updating. What am i missing?
Update.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22847
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

Post by jsmorley »

The way the skin works is that every 10 minutes WebParser will go out and get the info. This is driven by the @Include files.

Then there is this measure:

Code: Select all

[CheckParent]
Measure=String
String=[@CurrentPressure]
DynamicVariables=1
IfMatchMode=1
IfMatch=^$
IfNotMatchAction=[!EnableMeasure MeasureLuaScript][!UpdateMeasure MeasureLuaScript]
Which forces the Lua script measure to be updated once a second, IF there is valid information returned by the WebParser measures.

Then the Lua itself sets the values of most of the other measures.
Wim
Posts: 72
Joined: September 22nd, 2010, 8:30 pm

Re: JSBarometer

Post by Wim »

That's exactly what i thought it should be doing, but it doesn't, which is the reason for my question.
Last edited by Wim on December 31st, 2020, 3:50 pm, edited 1 time in total.
Wim
Posts: 72
Joined: September 22nd, 2010, 8:30 pm

Re: JSBarometer

Post by Wim »

The code you posted is not the same as in the skin that can be download from the first post in this thread.

Code: Select all

[CheckParent]
Measure=String
String=[@CurrentPressure]
DynamicVariables=1
IfMatchMode=1
IfMatch=^$
IfNotMatchAction=[!EnableMeasure MeasureLuaScript][!UpdateMeasure MeasureLuaScript]
The code in the skin downloaded (and i downloaded it again today to be certain) has this

Code: Select all

[CheckParent]
Measure=String
String=[@CurrentPressure]
DynamicVariables=1
IfMatch=^$
IfNotMatchAction=[!EnableMeasure MeasureLuaScript][!UpdateMeasure MeasureLuaScript][!Update]
I'll run this and see if it makes a difference
Wim
Posts: 72
Joined: September 22nd, 2010, 8:30 pm

Re: JSBarometer

Post by Wim »

This one works. The skin is now updating properly

Code: Select all

[CheckParent]
Measure=String
String=[@CurrentPressure]
DynamicVariables=1
IfMatchMode=1
IfMatch=^$
IfNotMatchAction=[!EnableMeasure MeasureLuaScript][!UpdateMeasure MeasureLuaScript]
I actually tried using IfMatchMode=1 but Rainmeter always crashed completely. Reason of course is that in the original code i never thought to remove [!Update] from

Code: Select all

IfNotMatchAction=[!EnableMeasure MeasureLuaScript][!UpdateMeasure MeasureLuaScript][!Update]
IfMatch.PNG
Urghh O.O

You may want to update your rmskin though.
You do not have the required permissions to view the files attached to this post.
Commander2311
Posts: 4
Joined: August 25th, 2023, 5:39 pm

Re: JSBarometer

Post by Commander2311 »

So something is not working on my end.
I installed the skin, i set my lat/long but the skin does not load, my bar is greyish empty!
What could have gone wrong?
User avatar
balala
Rainmeter Sage
Posts: 16645
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: JSBarometer

Post by balala »

Commander2311 wrote: August 25th, 2023, 5:41 pm So something is not working on my end.
I installed the skin, i set my lat/long but the skin does not load, my bar is greyish empty!
What could have gone wrong?
You have to update the API key. Do the followings: open the JSBarometer\@Resources\WeatherComJSONVariables.inc file, identify the APIKey variable (you can find it almost on the end of the file) and replace its old value (APIKey=d522aa97197fd864d36b418f39ebb323), with the following one: APIKey=21d8a80b3d6b444998a80b3d6b1449d3. Don't forget to refresh the skin.