Webtags (preserving history): Difference between revisions

m
→‎Recent History: adjust introduction for build 1098
m (→‎Miscellaneous: added '<#dailygraphperiod>')
m (→‎Recent History: adjust introduction for build 1098)
Line 1,114: Line 1,114:
==Recent History==
==Recent History==


There are a set of tags for 'recent historical data', giving data values from 1 minute ago, up to 1 week ago, in 1 minute intervals. Note that values over 12 hours old are initialised from the log files when Cumulus starts, so they 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 one for which there is currently no exact match, and the first tag listed tells you that nearest time. More recent data values are based on those at, and since, start-up as the first tag will report. As Cumulus runs it updates all values for times since it started with full resolution.
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.


You specify how old you want the value to be by using parameters on the web tags for number of days, hours, and minutes. 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.  
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.  


Although 'Apparent Temperature' is not included, it can be 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).
 
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. Before build 1098, the recent history array did not initialise correctly from the station logger for the period since Cumulus was last run.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
5,838

edits