Weather Synopsis
Moderator: Mattk
Weather Synopsis
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]
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)
Hardware: Raspberry Pi 2 (Meteohub status)
Re:Weather Synopsis
I really like it and see huge potential in this script. Thanks for sharing!
Re:Weather Synopsis
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. :)
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)
Hardware: Raspberry Pi 2 (Meteohub status)
Re:Weather Synopsis
Great. Please keep on sharing, I'm sure your code will be popular :-)
Re:Weather Synopsis
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)
Hardware: Raspberry Pi 2 (Meteohub status)
- WS Grave
- Expert Boarder
- Posts: 103
- Joined: Fri Oct 30, 2009 3:42 pm
- Location: Grave - the Netherlands
- Contact:
Re:Weather Synopsis
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 :)):
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);
Re:Weather Synopsis
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.
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)
Hardware: Raspberry Pi 2 (Meteohub status)
Re:Weather Synopsis
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
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
Re:Weather Synopsis
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)
Hardware: Raspberry Pi 2 (Meteohub status)
Re:Weather Synopsis
Yes, but how is this value calculated?
Re:Weather Synopsis
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)
Hardware: Raspberry Pi 2 (Meteohub status)
Re:Weather Synopsis
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.
Re:Weather Synopsis
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)
Hardware: Raspberry Pi 2 (Meteohub status)
Re:Weather Synopsis
ok, thanks. Perhaps Boris can give his comment to it :)
Re:Weather Synopsis
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?
Boris?
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
Hardware: Raspberry Pi 2 (Meteohub status)