Webtags (preserving history): Difference between revisions

→‎Recent History: Mention dst effect as per http://sandaysoft.com/forum/viewtopic.php?f=27&t=1444
(→‎Recent History: Mention dst effect as per http://sandaysoft.com/forum/viewtopic.php?f=27&t=1444)
Line 1,205: Line 1,205:
==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.   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. (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.


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.  
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).


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).
5,838

edits