It is currently October 15th, 2019, 5:01 am

JSBarometer

Post your work-in-progress and completed skins to share and discuss.
User avatar
jsmorley
Developer
Posts: 19544
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

JSBarometer

jsmorley » February 16th, 2019, 5:47 pm

Updated and improved an old skin I had that used to use Yahoo Weather as the source. Now uses WXData / Weather.com.

Shows you the current barometric pressure in inches / Hg (US, Imperial) or millibars / mb (Metric), with some guidance about what the pressure, combined with the state of change, means for your short-term weather forecast.

Properly read, a barometer is all you really need to know what is likely to happen for the next couple of hours.

JSBarometer_Feb 17, 2019.rmskin


1.jpg

Code: Select all

	if tonumber(currentPressure) <= 28.59 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Increasingly Stormy'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Stormy'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Stormy, but Improving'
		end
	end
		
	if tonumber(currentPressure) >= 28.6 and tonumber(currentPressure) <= 29.50 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Rain Forecasted'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Rainy'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Rainy, but Improving'
		end
	end
	
	if tonumber(currentPressure) >= 29.51 and tonumber(currentPressure) <= 30.09 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Changing toward Rain'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Change Possible'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Changing toward Fair'
		end
	end
	
	if tonumber(currentPressure) >= 30.1 and tonumber(currentPressure) <= 30.5 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Fair, but Degrading'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Fair'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Fair, and Improving'
		end
	end
	
	if tonumber(currentPressure) >= 30.6 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Very Dry, but Degrading'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Very Dry'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Increasingly Very Dry'
		end		
	end

Note that WXData only updates more or less once an hour, so if you live in Kansas, and you are watching the skies and keeping one eye on the door to the storm cellar, it's best not to depend on this, but turn the crank on that portable radio and listen to that. When you head down, don't forget your little dog too...
You do not have the required permissions to view the files attached to this post.
User avatar
Smurth
Posts: 5
Joined: February 2nd, 2019, 2:10 pm

Re: JSBarometer

Smurth » February 17th, 2019, 11:29 am

Nice ;)
User avatar
jsmorley
Developer
Posts: 19544
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

jsmorley » February 17th, 2019, 5:42 pm

Changed some cosmetics to add arrows indicating direction and rate of change. New version in first post.
momo2000
Posts: 2
Joined: August 12th, 2019, 3:57 pm

Re: JSBarometer

momo2000 » August 12th, 2019, 4:01 pm

Exactly what I'm looking for.
I see your instruction of: "Set your Weather.com LocationCode in WXDataWeatherVars.inc" but looking through the code, I am still unclear where to edit the location. Any hints? Thanks.

MO.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3568
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: JSBarometer

eclectic-tech » August 12th, 2019, 4:23 pm

momo2000 wrote:
August 12th, 2019, 4:01 pm
Exactly what I'm looking for.
I see your instruction of: "Set your Weather.com LocationCode in WXDataWeatherVars.inc" but looking through the code, I am still unclear where to edit the location. Any hints? Thanks.

MO.
Open this file: "Skins\JSBarometer\@Resources\WXDataWeatherVars.inc" in your text editor.

Look for the lines:

Code: Select all

; LocationCode can be obtained at http://wxdata.weather.com/wxdata/search/search?where=YourCityName
LocationCode=USVA0944
Get your location code from the link mentioned in the code above, or look it up from https://weather.codes/
Replace USVA0944 with your code; as an example change the line to: LocationCode=USNY0996
Save the file and refresh all
User avatar
jsmorley
Developer
Posts: 19544
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

jsmorley » August 12th, 2019, 4:54 pm

I'm actually not in love with that https://weather.codes/ page, as I find the search very limited and often unreasonably unsuccessful.

If you want it, here is a stand-alone skin that will let you search the http://wxdata.weather.com search site and when you find and click on a location, it will be copied to your Windows Clipboard, so you can paste it in wherever you need it.

WXDataLocation_1.0.rmskin

1.jpg

The search is quite robust and forgiving. The only thing I caution is that the skin only returns up to the first 10 results, so you might want to be reasonably specific. If you search for "Springfield", you may well not find what you want, as there are probably HUNDREDS of towns called "Springfield" in the US. If you search for "Springfield Pennsylvania" or even just "Springfield PA", you will zero in on what you are looking for. Heck, there are four towns called "Springfield" in Pennsylvania alone... You can also search by Zip Code in it.
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3568
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: JSBarometer

eclectic-tech » August 12th, 2019, 4:59 pm

Hmm... Never had an issue with that site :???: but I agree that your locator skin is the way to go! :thumbup:
User avatar
jsmorley
Developer
Posts: 19544
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

jsmorley » August 12th, 2019, 5:04 pm

eclectic-tech wrote:
August 12th, 2019, 4:59 pm
Hmm... Never had an issue with that site :???: but I agree that your locator skin is the way to go! :thumbup:
Well, my location name is "Fort Hunt, VA", and uses the weather station at "Fort Belvoir, VA", neither of which is found on that site, but are found fine in WXData.
momo2000
Posts: 2
Joined: August 12th, 2019, 3:57 pm

Re: JSBarometer

momo2000 » August 12th, 2019, 5:45 pm

Thanks eclectic-tech. Gee I totally mis-read those instructions. Originally, I was looking for it in the main JSBarometer.ini file ;) thanks for the pointer! All good now.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3568
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: JSBarometer

eclectic-tech » August 12th, 2019, 8:35 pm

@momo2000 ... Happy to help.
jsmorley wrote:
August 12th, 2019, 5:04 pm
Well, my location name is "Fort Hunt, VA", and uses the weather station at "Fort Belvoir, VA", neither of which is found on that site, but are found fine in WXData.
Well then, I guess you need to move to a new "Fort"! ;-)

EDIT:
FYI, you are right, using the "Search Box" on that site usually doesn't work for me either. :uhuh:

A manual search by Region and State will find the code. Not as simple, but the results are there:
fort.png
You do not have the required permissions to view the files attached to this post.