Weather Synopsis

Discussion of the Meteohub software package

Moderator: Mattk

cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Weather Synopsis

Post by cbhiii »

With the aid of some Javascript and the many variety of [variables] available on Meteohub. I was able to create a text weather synopsis of the day for my station.

Check out the top box on my weather page to read it: http://weather.huffman.info

I've attached the html text file code I used to create the text if someone is interested. Let me know what you think.

Cheers! [file name=synopsis.txt size=3820]http://www.meteohub.de/joomla/images/fb ... nopsis.txt[/file]
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
rune
Expert Boarder
Expert Boarder
Posts: 104
Joined: Wed Jun 24, 2009 10:51 pm

Re:Weather Synopsis

Post by rune »

I really like it and see huge potential in this script. Thanks for sharing!
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

I agree. This is my first draft and I'm sure I'll be tweaking it now and then over the next few weeks.

Especially when it comes to detecting the cloudy or partly cloudy skies. Right now I'm kind of guessing based on amount of daylight in the SOL sensor and the time of day. We'll see what happens. :)
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
rune
Expert Boarder
Expert Boarder
Posts: 104
Joined: Wed Jun 24, 2009 10:51 pm

Re:Weather Synopsis

Post by rune »

Great. Please keep on sharing, I'm sure your code will be popular :-)
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

Updated text file with some bug fixes. [file name=synopsis-d67d4a3dbbbbe163849b394682118f47.txt size=4173]http://www.meteohub.de/joomla/images/fb ... 118f47.txt[/file]
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
User avatar
WS Grave
Expert Boarder
Expert Boarder
Posts: 103
Joined: Fri Oct 30, 2009 3:42 pm
Location: Grave - the Netherlands
Contact:

Re:Weather Synopsis

Post by WS Grave »

Very nice script Chuck.
I'm using it on my site, but had to tweak a little bit to get it working. But still, very nice work.
I'm missing the "cloud" message, because I don't have a solar sensor anymore.

The "else" part wasn't working for me (don't know why), but I added the remaining directions manually (still have to add the 3 letter directions, but it is working). Also I could leave the mph :)):

Code: Select all

// wind
						var wtxt="";var b="";var c="";
						var wd="[last15m_wind0_maindir_en:-]";
						var wn=(Math.round([last15m_wind0_speed_mph:-]));
						if (wn<1){b="windstil. ";}
						if (wn>=1 && wn<=3){b="een lichte wind ";}
						if (wn>=4 && wn<=7){b="een lichte bries ";}
						if (wn>=8 && wn<=12){b="een zachte bries ";}
						if (wn>=13 && wn<=17){b="een matige wind ";}
						if (wn>=18 && wn<=24){b="een frisse wind ";}
						if (wn>=25 && wn<=30){b="een sterke wind ";}
						if (wn>=31 && wn<=38){b="een bijna stormachtige wind ";}
						if (wn>=39 && wn<=46){b="een stormachtige wind ";}
						if (wn>0 && wd=="N"){c="uit het noorden. ";}
						if (wn>0 && wd=="S"){c="uit het zuiden. ";}
						if (wn>0 && wd=="E"){c="uit het oosten. ";}
						if (wn>0 && wd=="W"){c="uit het westen. ";}
						if (wn>0 && wd=="SE"){c="uit het zuidoosten. ";}
						if (wn>0 && wd=="SW"){c="uit het zuidwesten. ";}	
						if (wn>0 && wd=="NW"){c="uit het noordwesten. ";}	
						if (wn>0 && wd=="NE"){c="uit het noordoosten. ";}						
						document.write(b,c);
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

Nice!

You can also get rid of var wtxt=""; as I decided not to use that variable. The code does need a bit of clean up, but it's too early for that.

In the interest of time I only did the four main wind directions and left the rest, but I will probably go back and do those in the future. ;)

I was also tweaking some things last night too, so some of the code is even different from what I posted. I'm excited to see what it looks like in a few weeks after I keep playing with it. :laugh:

Glad people are trying it out.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
bensca
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Sun Feb 17, 2008 5:17 pm
Location: Augsburg-Germany
Contact:

Re:Weather Synopsis

Post by bensca »

Hi,
your script is great! I think about it, to install it on my homepage. Small interposed question for understanding. How is the trend value calculated?
For example [last15m_th0_temp_trend]. Is the average of the last 15 minutes compared with the current? But this don´t work with the last24h value, because I would get -1 at night and +1 during the day. So how does it work?

Sorry for my bad English :blush:
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

You should use "last24h" for all trend variables. This was an error on my part. Use "last24h" and it should work fine.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
bensca
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Sun Feb 17, 2008 5:17 pm
Location: Augsburg-Germany
Contact:

Re:Weather Synopsis

Post by bensca »

Yes, but how is this value calculated?
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

I do not know the algorithm. This is either from the weather station unit or the Meteohub software.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
bensca
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Sun Feb 17, 2008 5:17 pm
Location: Augsburg-Germany
Contact:

Re:Weather Synopsis

Post by bensca »

Does the value -1 (last24h) mean that it is now colder than the same time yesturday? Or does it mean that it is currently colder than the average temperature of the last 24 hours.
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

It is not looking at the value from yesterday, but I don't know how it decides the temp trend.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
bensca
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Sun Feb 17, 2008 5:17 pm
Location: Augsburg-Germany
Contact:

Re:Weather Synopsis

Post by bensca »

ok, thanks. Perhaps Boris can give his comment to it :)
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Weather Synopsis

Post by cbhiii »

Yeah, I would like Boris to comment, because I'm using "Last24h" now and the temps are falling, but the trend says rising (1). The "last60m" reading appears to be correct now.

Boris?
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
Post Reply