Last 3 hours variable [last3h...] request

Requests for future functionality

Moderator: Mattk

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

Last 3 hours variable [last3h...] request

Post by cbhiii »

Boris,

We would like to see a [last3h...] variable choice for trends so we can get a more accurate trend indication from Meteohub.

The [last60m] is a bit too small of a window and the [last24h] is too large and not accurate if the falling temp is still higher than the 24hr average temp.

I called Davis Instruments today and confirmed that their barometer trend is based on a 3 hour window. I think it would be a benefit to have 3 hour trends for barometer, temp, dew and humidity as well in Meteohub.

Thanks!
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
User avatar
d_l
Expert Boarder
Expert Boarder
Posts: 140
Joined: Fri Mar 13, 2009 12:58 am
Location: Reno, Nevada USA
Contact:

Re:Last 3 hours variable [last3h...] request

Post by d_l »

Some other weather forecasting tools, e.g. the Sager Weathercaster, use the last 6 hr trend for wind direction and barometric changes. How about that period instead?

Edit: I guess some of this info, either 3 hr or 6 hr trends, could be extracted from the seqhour6 strings.
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Last 3 hours variable [last3h...] request

Post by cbhiii »

For 6 hour readings, this script might be useful. It takes the 6 hour temp reading used for WD and compares it to actual. Not sure how accurate it will be since I've not played with the 6 hour WD readings before. Best of luck.

Updated with simplified code

Code: Select all

<script type="text/javascript">

var now = "[actual_th0_temp_c]";
var act = "[seqhour6_th0_temp_c@1:-]";
}

if (now>act){trend="1"}
else if (now<act){trend="-1"}
else if (now==act){trend="0"}

document.write("<img border=\\"0\\" src =\\"icons/",trend,".gif\\">");

</script>
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Last 3 hours variable [last3h...] request

Post by cbhiii »

This code for the 6 hour trend has been updated and seems to be working fine on my site: http://weather.huffman.info

Email me if you have questions and I might be able to help.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Last 3 hours variable [last3h...] request

Post by cbhiii »

I can still see problems with using 6 hour blocks of time for the trend. It too provides sometimes incorrect results. I believe a 3 hour window is the best solution for this trend problem.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
sevenless
Gold Boarder
Gold Boarder
Posts: 160
Joined: Wed Jul 02, 2008 7:35 pm
Location: Seattle WA, USA

Re:Last 3 hours variable [last3h...] request

Post by sevenless »

Nearly the same code can be used to extract the data from three hours ago using the seqhour1_ variable. It's an identical concept and you can extract data from any previous hour going as far back as 31 hours prior to current time if you wanted, and all without adding yet more redundant variables into the already large all_sensors output.

Just change the line reading 'var act = "[seqhour6_th0_temp_c@1:-]";' to this:

Code: Select all

var act = "[seqhour1_th0_temp_c@4:-]"; 
(note that entry 1 in seqhour1_ entries is the current hour.)

Also you're always going to have the possibility of oddities if the temperature has a sudden spike or drop due to a front passing through, and the historic data trend will take a little while to catch up. It's impossible to avoid without either constant human observation or some complex regression analysis.
cbhiii
Gold Boarder
Gold Boarder
Posts: 306
Joined: Fri Feb 15, 2008 2:02 am
Location: Michigan, USA
Contact:

Re:Last 3 hours variable [last3h...] request

Post by cbhiii »

Actually the data for each of the last 3 hours needs to be evaluated not just a single value from 3 hours ago.

See this thread where I posted a script to do this.
Station: Davis Vantage Pro2 Plus
Hardware: Raspberry Pi 2 (Meteohub status)
Post Reply