Webtags (preserving history): Difference between revisions

m
m (→‎Extra Sensors: added "with MX")
Line 741: Line 741:
==Recent History==
==Recent History==


There are a set of web tags for 'recent historical data', based on an array stored by Cumulus giving data values from 1 minute ago, up to 1 week ago, in 1 minute intervals. (Note that Cumulus uses current time read from the computer to determine which array element used. Hence when clocks go back the value stored for winter time overwrites the value previously stored for same time during summer time for the relevant repeating hour). As Cumulus runs it will add the latest values to the array with full resolution, and shift existing values along so those older than 7 days fall off. [[#No_Commas]] versions of the array are available for use in script.
There are a set of web tags for 'recent historical data', based on an array stored by Cumulus giving data values from 1 minute ago, up to 1 week ago, in 1 minute intervals. As Cumulus runs it will add the latest values to the array with full resolution, and shift existing values along so those older than 7 days fall off. [[#No_Commas]] versions of the array are available for use in script.
 
(Note that Cumulus uses current time read from the computer to determine which array element it stores each value in. Hence ''when clocks go back'' the value stored for winter time overwrites the value previously stored for same time during summer time for the relevant repeating hour. Hence even if you use 10am for your rollover time in summer, you will not have access to a whole hour worth of data when the clocks change as either the hour has been overwritten or ''when the clocks go forward'' it simply does not exist).  


=== Input Parameters ===
=== Input Parameters ===
You specify which value you want from the array by using parameters on the web tags for number of days ago, hours ago, and minutes ago. For example, <#RecentOutsideTemp m=1> will give the temperature one minute ago, <#RecentOutsideTemp h=1> will give the temperature one hour ago (as will <#RecentOutsideTemp m=60>), and <#RecentOutsideTemp d=1> will give the temperature one day ago. <#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago. All values supplied for parameters must be whole numbers. If you don't supply any parameters, the result is undefined. (Again note that parameters specify time-stamped array element to retrieve based on counting back from current local time so the result for any period when clocks change may not be quite what you anticipated).
You specify which value you want from the array by using parameters on the web tags for number of days ago, hours ago, and minutes ago. The same d, h, and m, parameters are used by Cumulus 1 and MX.
 
For example, <#RecentOutsideTemp m=1> will give the temperature one minute ago, <#RecentOutsideTemp h=1> will give the temperature one hour ago (as will <#RecentOutsideTemp m=60>), and <#RecentOutsideTemp d=1> will give the temperature one day ago. <#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago. All values supplied for parameters must be whole numbers. If you don't supply any parameters, the result is undefined. (Again note that parameters specify time-stamped array element to retrieve based on counting back from current local time so the result for any period when clocks change may not be quite what you anticipated).
 
=== Other weather derivatives ===
=== Other weather derivatives ===
Although 'Apparent Temperature' is not included as a tag, it can be [[FAQ#What_formula_does_Cumulus_use_for_Apparent_Temperature.3F | calculated]] in a script from recent 'outside temperature', 'wind speed', and 'relative humidity' values (using the same time selection for all).
Although 'Apparent Temperature' is not included as a tag, it can be [[FAQ#What_formula_does_Cumulus_use_for_Apparent_Temperature.3F | calculated]] in a script from recent 'outside temperature', 'wind speed', and 'relative humidity' values (using the same time selection for all). There are other derivatives that can be calculated similarly from a set of simultaneous values.
 
=== During catch-up ===
=== During catch-up ===
When Cumulus is re-started the array it sets up will be based on reading the logs, so the contents will initially have a resolution according to the logger interval you have set in Cumulus and/or your station.  You'll get the nearest value if you ask for a time for which there is currently no exact match, and the first tag listed tells you that nearest time.  
When Cumulus is re-started the array it sets up will be based on reading the logs, so the contents will initially have a resolution according to the logger interval you have set in Cumulus and/or your station.  You'll get the nearest value if you ask for a time for which there is currently no exact match, and the first tag listed tells you that nearest time.  
=== Variations between Builds/Versions ===
=== Variations between Builds/Versions ===
Before build 1098, the recent history array did not initialise correctly from the station logger for the period since Cumulus was last run.
Before build 1098, the recent history array did not initialise correctly from the station logger for the period since Cumulus was last run.
5,838

edits