Webtags/Parameters (preserving history): Difference between revisions

m
Line 45: Line 45:
'''Most web tags do not require any input parameters'''.  
'''Most web tags do not require any input parameters'''.  


An input parameter is used where the same web tag can represent a value for a number of different past time instants. Each of those past time instants is represented by a different value for the input parameter. So a combination of web tag name and input parameter lets Cumulus to pick the value you want to see.  
* An input parameter is used where the same web tag can represent a value for a number of different past time instants.  
* Each of those past time instants is represented by a different value for the input parameter.  
* So a combination of web tag name and input modification parameter lets Cumulus to pick the value you want to see.
* The web tags that can use input modification parameters will depend on which Cumulus release you are using
* To supply both optional input modification, and optional output modification parameters, separate them with spaces, e.g. <#ByMonthTempHT mon=7 format=hh:nn>. In that example,  the time only is returned for the highest ever temperature in July, after processing by Cumulus of the time-stamp web tag.


For the legacy Cumulus 1, there are only two groups of tags where an input parameter is mandatory:
{| class="wikitable" border="1"
#The [[Webtags#Recent_History|'''recent history tags''']] where a separate value exists for potentially every individual minute in last week.
|-
#* These tags need between one and three input parameters as explained below.
!style="width:30px" | Web Tags
#The [[Webtags#Monthly_All_Time_Records|'''monthly all-time records''']] where a separate value exists for each particular month (of any year).
!style="width:100px" | Values Available
#*These tags need an input parameter specifying which month.
!style="width:300px" | Input Modification Parameters
#*To save you looking up the linked section, a single input parameter is needed (which is 1 for January to 12 for December, or 0 for current month), e.g. <#ByMonthDewPointH mon=3> is highest monthly dew point for any March and <#ByMonthDewPointHT mon=3> is the related time and date.
!style="width:60px" | Introduced
!style="width:500px" | Examples
!style="width:600px" | Description
|-
| [[Webtags#Recent_History|'''recent history tags''']]
| One value for each minute in last 7 days
|  '''d''' specifies number of days ago, '''h''' specifies number of hours ago, and '''m''' specifies number of minutes ago.
* You can use any combination of the three parameters.
* The same d, h, and m, parameters are used by Cumulus 1 and MX.
| Cumulus 1.9.3 beta build 1033
| Examples for outside temperature:
* <#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>).
* <#RecentOutsideTemp d=1> will give the temperature one day ago. '''Please note:''' Some Cumulus users say that using <#RecentOutsideTemp  d=1 m=1> is more reliable at getting the temperature at a similar time the day before, the extra minute apparently gives better results when you might not be using Cumulus all the time, or your weather station might have some drift on when it supplies readings. See which works best for you.
* <#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 for Cumulus 1, and an illegal web tag for MX.
* '''Please note that parameters specify time-stamped array element to retrieve based on counting back from current local time''' so the result for ''any period including when clocks change'' may not be quite what you anticipated.
* When Cumulus is re-started the array it sets up will be based on reading any station log that exists, 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 [[Webtags#Recent_History|listed here]] 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.
* The input parameters are same for Cumulus 1 and Cumulus MX, they always use lower case d, h or m.
* The list of recent history web tags available has not changed between last Cumulus 1 release and any MX release.
* Any new derivatives introduced by MX, will have current value web tags, and may have tags for extremes this month, extremes this year, all-time extremes, and monthly-all-time-extremes but do not have equivalent new recent history tags.
|-
| [[Webtags#Monthly_All_Time_Records|'''monthly all-time extreme records''']]
| These exist for all occurrences of the current month, and for all occurrences of each month
|  '''mon=N''' where N is the index of the month of the year that you want the value for (1 =January, and so on, to 12 =December)  
| Cumulus 1.9.3 beta build 1033
| e.g. <#ByMonthDewPointH mon=3> is highest monthly dew point for any March and <#ByMonthDewPointHT mon=3> is the related time and date.


MX release 3.12.0 onwards adds a third group of tags where an input parameter is optional:
<#ByMonthTempH mon=3> gives highest temperature in any March, <#ByMonthTempHT mon=3> gives the date and time for that highest temperature
* The web tag <#SunshineHoursMonth> is new in 3.12.0 and optionally take parameters
| Only one input parameter applies:
** Without input parameters, the above two web tags will return the total sunshine hours for the current month, and current year, respectively
* The value of "N" supplied should be an integer between 1 and 12
** Use <code><#SunshineHoursMonth m=xx y=nnnn></code> to show the monthly total sunshine hours for month number xx and 4 digit year nnnn e.g. <#SunshineHoursMonth y=2021 m=1> for the January 2021 total
* If you don't supply an input parameter (or supply an invalid value like zero) the current month will be used. This is useful if you want to write a template that will always supply values for the current month and don't want to process a script, to calculate the correct input parameter, before Cumulus processes the template.
** Alternatively use <code><#SunshineHoursMonth r=-ww></code> to show the monthly total sunshine hours for relative month number e.g. <#SunshineHoursMonth r=-1> for last months total, and <#SunshineHoursMonth r=-12> for same month as current month, but one tear ago
|-
* The web tag <#SunshineHoursYear> is also new in 3.12.0 and optionally take parameters
| Only <#SunshineHoursMonth> and <#SunshineHoursYear>
** Use <code><#SunshineHoursYear y=nnnn></code> to show the yearly total sunshine hours for a previous year, e.g. <#SunshineHoursYear y=2019> for the total for 2019
| Values available for current month/year, and for past month/year
** Alternatively use <code><#SunshineHoursyear r=-ww></code> to show the yearly total sunshine hours for relative year number, e.g. <#SunshineHoursYear r=-2> total for the year before last
| All web tags take '''r=-ww'''
 
* Monthly tags also take: '''m=N y=nnnn'''
 
* Yearly tags also take: '''y=nnnn'''
==Input Modification Parameters for Recent History tags ==
Omit input modification parameter to get value for current month/year
 
| MX release 3.12.0
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.
| Monthly examples:
 
* <#SunshineHoursMonth> gives total sunshine hours since 1 minute past midnight at start of current month  
All values supplied for parameters must be whole numbers.
* <#SunshineHoursMonth y=2021 m=1> for the January 2021 total
 
* <#SunshineHoursMonth r=-1> for last months total
If you don't supply any parameters, the result is undefined for Cumulus 1, and an illegal web tag for MX.
* <#SunshineHoursMonth r=-12> for same month as current month, but one year ago
 
  Yearly examples:
<#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>).
* <#SunshineHoursYear> gives total sunshine hours since 1 minute past midnight on New Year's Day
 
* <#SunshineHoursYear y=2019> for the total for 2019
<#RecentOutsideTemp d=1> will give the temperature one day ago. '''Please note:''' Some Cumulus users say that using <#RecentOutsideTemp  d=1 m=1> is more reliable at getting the temperature at a similar time the day before, the extra minute apparently gives better results when you might not be using Cumulus all the time, or your weather station might have some drift on when it supplies readings. See which works best for you.
* <#SunshineHoursYear r=-2> total for the year before last (if current year is 2021, that is same as previous example)
 
| Returns the sunshine hours total in selected period
<#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago.
|}
 
'''Please note that parameters specify time-stamped array element to retrieve based on counting back from current local time''' so the result for ''any period including when clocks change'' may not be quite what you anticipated.
 
 
=== 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.
 
=== 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.
 
The input parameters are same for Cumulus 1 and Cumulus MX, they always use lower case d, h or m.
 
The list of tags available has not changed between last Cumulus 1 release and any MX release. Any new derivatives reported elsewhere have not resulted in equivalent new recent history tags.
 
==Input Modification Parameters for Monthly all-time tags==
 
Each Monthly All Time Records web tag has an optional input parameter "mon=N" where N is the index of the month of the year that you want the value for (January=1 and so on).
 
If you don't supply an input parameter (or supply an invalid value like zero) the current month will be used. This is useful if you want to write a template that will always supply values for the current month and don't want to use a script to enter the correct input parameter by processing with that script before Cumulus processes the template.
 
The corresponding date/time web tags are formatted just like the all time records. You can customise the date and time formats by adding the output  'format' modification parameters (shown later on this page) to the web tag.
 
To supply both optional input modification, and optional output modification parameters, separate them with spaces, e.g. <#ByMonthTempHT mon=7 format=hh:nn>. In that example,  the highest ever temperature in July is returned in the value after processing by Cumulus.


= Output modification parameters =
= Output modification parameters =
5,838

edits