Webtags (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
(43 intermediate revisions by the same user not shown)
Line 124: Line 124:
= Template Files =
= Template Files =


This is the name given by Steve Loft to any files that contain web tags/tokens.
This is the name given by Steve Loft to any files that contain web tags and need to be processed before they actually include values.  


When Cumulus processes these files it generates output files where the tags/tokens have been replaced by values.
When Cumulus processes these files it generates output files where the tags/tokens have been replaced by values. Consequently, a single template will actually generate a different file each time Cumulus processes that template because the part of the content that was web tags is now populated with text (values, times, dates, etc.) and as these values change that make the file different to the previous generated file.


For standard Cumulus, all the output files are web pages which it then uploads to your web site. There is more about processing of files on the [[Customised templates]] page, but think of a template as containing text that Cumulus copies from the template file to the web page it is constructing. The processing process is basically a parse, each time it finds what MX calls a token (a web tag complete with any parameters it needs) it looks up the value that it will use to replace that web tag before moving on through the text.  
For standard Cumulus, all the output files are web pages which it then uploads to your web site. There is more about processing of files on the [[Customised templates]] page, but think of a template as containing text that Cumulus copies from the template file to the web page it is constructing. The processing process is basically a parse, each time it finds what MX calls a token (a web tag complete with any parameters it needs) it looks up the value that it will use to replace that web tag before moving on through the text.  


The example web templates provided by Cumulus insert a "T" at the end of the intended web page name before the extension (.htm or .html), so that the template files and generated web pages cannot be confused.
The example web templates provided by Cumulus insert a "T" at the end of the intended web page name before the extension (.htm or .html), so that the template files and generated web pages cannot be confused. The generated file will often have "tmp" added to the end


When writing your own templates, some people will stick to this "T" notation, others will change the extension to "tmpl" or "cum" to indicate they are Cumulus templates. Cumulus does not care what extension is used for any local file specified in the MX '''Extra Web Files''' settings or Cumulus 1 '''Files''' tab settings.
When writing your own templates, some people will stick to this "T" notation, others will change the extension to "tmpl" or "cum" to indicate they are Cumulus templates. Cumulus does not care what extension is used for any local file specified in the MX '''Extra Web Files''' settings or Cumulus 1 '''Files''' tab settings.
For Cumulus 1 and MX, there are one template held within the program code, this is what produces the default [[Realtime.txt]]. You can define an alternative template with web tags and Cumulus can process that instead of its default template.
For MX only, there are other templates held within the program code (so you cannot edit them), these output in json format. Some are application program interface, and feed information to the admin interface, you can only view these by using the development interface in your browser that lets you see what has been loaded. The rest become the json files that are created in the '''web''' folder from where (like the web pages produced after processing the standard web templates), they can be uploaded to your web site.


= Web tags available in Cumulus =
= Web tags available in Cumulus =
Line 146: Line 150:
The [[BETA webtags|additional webtags]] page was created to hold web tags that were not yet available in any Cumulus 1 formal release, but were available in any Beta version that was under development. When development of Cumulus 1 ceased, that page held all web tokens specific to the MX Beta then under development. So at that time you had 2 articles to read to find which web tokens were available in MX Beta, and it was not clear in this article which web tags were only available in Cumulus 1!
The [[BETA webtags|additional webtags]] page was created to hold web tags that were not yet available in any Cumulus 1 formal release, but were available in any Beta version that was under development. When development of Cumulus 1 ceased, that page held all web tokens specific to the MX Beta then under development. So at that time you had 2 articles to read to find which web tokens were available in MX Beta, and it was not clear in this article which web tags were only available in Cumulus 1!


For a while, some web tokens alterations, for example [[BETA_webtags#Day.2FNight.2FSun.2FMoon|Moon web tags]] had parameters added to control the output from build 3047, continued to be added to the Beta article. You should keep an eye on that Beta article just in case as MX is being developed any more appear there, although at time of writing new MX web tokens are now being added to this article.
For a while, some web tag alterations, for example [[BETA_webtags#Day.2FNight.2FSun.2FMoon|Moon web tags]] had parameters added to control the output from build 3047, continued to be added to the Beta article. You should keep an eye on that Beta article just in case as MX is being developed any more appear there, although at time of writing new MX web tokens are now being added to this article.


When Mark Crossley brought MX out of Beta, all the web tokens that were on that page were moved into this article, and it was made clear which flavours each web tag was available in (excluding Cumulus 2).
When Mark Crossley brought MX out of Beta, all the web tags that were on that page were moved into this article, and it was made clear which flavours each web tag was available in (excluding Cumulus 2).


== Case sensitivity ==
== Case sensitivity ==
Line 174: Line 178:
=== Input modification Parameters ===
=== Input modification Parameters ===


Most web tags do not require any input parameters. However, those for [[#Recent_History|individual minutes in last week]] and for [[#Monthly_All_Time_Records|the highest and lowest values for a particular month of any year]] do need input parameters specifying how many minutes ago or which month respectively. See the respective sections for full details.
Most web tags do not require any input parameters. There are currently only two types of tags where an input parameter is mandatory:
 
*The recent history tags where a separate one exists for [[#Recent_History|individual minutes in last week]] need input parameter specifying how many minutes ago is required. There are 3 separate input parameters that can be used alone or in combination as explained in relevant section.
*The [[#Monthly_All_Time_Records]] where a separate one exists for each particular month (of any year) need input parameter specifying which month. Again see the respective section for full details of input parameter (which is 1 for January to 12 for December, but 0 is also available with a special meaning).


=== Output modification parameters ===
=== Output modification parameters ===
Line 206: Line 213:


[[File:Badge vMx.png]]
[[File:Badge vMx.png]]
Cumulus MX provides many, but not all web tags available in Cumulus 1. MX adds many more web tokens. The terminology change is just an extra complication! This badge is used when web tokens listed in one of the tables are only available in MX. See [[#GENERAL_TIP|tip]] at top of page for how to check which web tags/tokens are available in your build.  
Cumulus MX provides many, but not all web tags that were available in Cumulus 1. MX adds many more web tags, mostly in support of new weather stations or new sensors. This badge is used against web tags listed in one of the tables that are only available in MX. See [[#GENERAL_TIP|tip]] at top of page for how to check which web tags are available in your build.  


A combination of badges appears where certain aspects apply to Cumulus 1 or to MX. No information is given for Cumulus 2 as it is no longer available.
A combination of badges appears where certain aspects apply to Cumulus 1 or to MX. No information is given for Cumulus 2 as it is no longer available.


When MX is processing web tokens and finds one it cannot understand, a "*** web tag error - see MXdiags file ***" message will appear in the engine console, and the diagnostic file will include something like this:
When MX is processing web tags and finds one it cannot understand, a "*** web tag error - see MXdiags file ***" message will appear in the engine console, and the diagnostic file will include something like this, notice the actual web tag is labelled "token":
<pre>Web tag error
<pre>Web tag error
Exception: i=8998 len=106297
Exception: i=8998 len=106297
inputText.Length=106297
inputText.Length=106297
token=<#daylightlength format=H></pre>
token=<#daylightlength format=H></pre>
This particular error is that when you use a single output format character it does not have same meaning as when there are multiple characters, correct this particular token to:
This particular error is that when you use a single output format character it does not have same meaning as when there are multiple characters, correct this particular web tag to:
<pre><#daylightlength format=%H></pre>
<pre><#daylightlength format=%H></pre>


Line 222: Line 229:
=Output 'format' Parameter=
=Output 'format' Parameter=


=== Output Parameter Differences between Cumulus 1 and Cumulus MX (Cumulus 3) ===
The majority, but not all, of web tags either can use an output format parameter or, in a few cases, really do need an output format parameter.
 
== Output Parameter Differences between Cumulus 1 and Cumulus MX (Cumulus 3) ==
 
There are a number of differences between Cumulus 1 (C1) and Cumulus MX (MX). These nearly all involve times and dates, so the next section deals with this.
 
 
=== Output (format modifier) parameters for times and dates ===
 
Time/Date format codes are used in two places:
# As part of report names for NOAA style reports (see [[Cumulus.ini#Section:_NOAA]])
# As part of web-tags that report either times or dates or both a date and a time
From version 1.9.1 most web-tags  that report any form of time or date will accept an optional 'format' parameter, e.g. (Cumulus 1 only): <#YearTempHT format=hh:nn>.
 
This allows you to override the default display format for that item, using the format specifiers in the table below.
 
Although, in theory, you can specify date formatting to times, and vice versa, this will not always yield a sensible result. It is best to look at the default format (in most, but not all, cases this reveals whether date and time information are both available):
*The time-stamps for today, and yesterday, only contain time information, so only time-based format instructions should be applied to them. You can use date format parameters on (for example) <#metdate>, and <#metdateyesterday> and that may give you your desired date information to augment the time-stamps.
*Almanac times such as sun-rise, moon-rise, are also only times, and time-based format instructions can generally be applied to them.  However, be aware these are calculated as at midnight GMT and for some of your calendar days, the times may be reported (in default format) as '--' if for example the moon does not rise that day.


There are a number of differences between Cumulus 1 (C1) and Cumulus MX (MX). C1 can work with times in 14.24 format using a full stop to separate the figures, MX must have ':' between hour and minute numbers.  
C1 can work with times in 14.24 format using a full stop ('.') to separate the figures, MX must have colon (':') between hour and minute numbers. But with both flavours you can choose whether 12-hour clock is used with am/pm (in lowercase or capitals) or the 24-hour clock is used. You can choose to include/exclude leading zero for hours. You can only report the hour if you don't care about the minutes, or only report the minutes if you don't need the hour. In most cases you can add seconds to the output, and either milliseconds or microseconds. This does not imply that Cumulus calculates everything every microsecond, in fact many are only calculated once a minute, but the flexibility is there for time outputs.


The characters used to represent year, month, day, hour, minute, second, microsecond, also differ between C1 and MX.
Some web tags contain dates, or both dates and times, and for these there is flexibility (apart from those with fixed format, these might have ISO, or another format indicator, in their tag name) as to how the date is output. Thus you can choose to include or exclude the year; you can represent month in letters or numbers, and you can vary the order in which elements of the date are shown.


In Cumulus 1 we are able to use "m" or "M" for two different meanings (minutes or month) depending on context. Similarly, in MX the same character sometimes has two different meanings depending on context, but this applies to lots of characters and the context is whether the character is used on its own or with other characters. '''Sounds confusing?''' Well it is complicated.
The characters used to represent year, month, day, hour, minute, second, microsecond, do differ between C1 and MX. In Cumulus 1 we are able to use "m" or "M" for two different meanings (minutes or month) depending on context. Similarly, in MX the same character sometimes has two different meanings depending on context, but this applies to lots of characters and the context is whether the character is used on its own or with other characters. '''Sounds confusing?''' Well it is complicated.


==== Explanation ====
==== Explanation ====


*Cumulus MX (when running on Windows) uses the '''.NET''' software.  
*Cumulus MX (when running on Windows) uses the '''.NET''' software.  
*If Cumulus MX is running on Linux or Mac OS X, or any other device that uses UNIX derived operating system, then it uses '''Mono''' software for same purposes. (MONO is a operating system independent version of .NET, although they are developed independently, they have common origins).
*If Cumulus MX is running on Linux or Mac OS X, or any other device that uses UNIX derived operating system, then it uses '''Mono''' software for same purposes. (MONO is a operating system independent version of .NET, although they are developed independently, they have common origins). Please see the [[Cumulus MX]] article for more details of their differences and what will change in November 2020.
*The date and time format characters in Mono (and .NET) software framework are not exactly the same as the '''Delphi''' software framework ones that Cumulus 1 uses.   
*The date and time format characters in Mono (and .NET) software framework are not exactly the same as the '''Delphi''' software framework ones that Cumulus 1 uses.   
*For Cumulus MX see [http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx this Microsoft site] for format selectors available.  
*For Cumulus MX see [http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx this Microsoft site] for format selectors available.  
*The differences come about because Delphi is case-insensitive, while .NET and MONO are case sensitive, so .NET (and MONO) can use upper and lower case for different items, where Delphi has to use different letters for each item.
*The differences come about because Delphi is case-insensitive, while .NET and MONO are case sensitive.  Consequently, .NET (and MONO) can use upper and lower case for different items, but Delphi has to use different letters, ignoring case, for each item.


==== When it causes problems ====
==== When it causes problems ====
Line 268: Line 293:
* You may need to use both single quotes and back slashes in some format specifiers, depending whether the characters you want to include can be interpreted as control characters (yes, backslash is also used to escape control characters, so backslash will NOT work for some characters such as those in "on" and "at" [\n will produce new line not the letter n, \t will produce a tab not the letter t]), consequently for some characters you must use the literal approach to include them in your format.
* You may need to use both single quotes and back slashes in some format specifiers, depending whether the characters you want to include can be interpreted as control characters (yes, backslash is also used to escape control characters, so backslash will NOT work for some characters such as those in "on" and "at" [\n will produce new line not the letter n, \t will produce a tab not the letter t]), consequently for some characters you must use the literal approach to include them in your format.


==== Using HTML tags within format parameters (available in MX only) ====
=== List of allowed modifiers for output format parameters ===
Note for Cumulus 1 - where lower (or upper, for easier comparison with MX) case shown, because Delphi is case insensitive, upper (or lower) case (in some cases, indicated by use of curved brackets) could be used instead (exceptions: a/p, ampm, am/pm, Am/Pm, AM/PM, A/P, AMPM etc display as input).


'''Example using a class to change the look of part of the output'''
[[File:Badge vMx.png]]Remember that most single character format specifiers have a different meaning to when the same letter appears in a multi-character format.


<pre><#TapptempH format="dd'&nbsp;'MMM'&nbsp;'yyyy'<span class=\'xx\'> at 'HH:mm'</span>'"></pre>
the output from this will look like ''04&nbsp;Dec&nbsp;2018<span class='xx'> at 10:12</span>''


'''Note where the quotes are, and where you need to use '\' escape characters'''.
==== Forum reference ====


'''Example using HTML tags'''
For official full details see [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=17888 Cumulus MX forum], the following table is revised for simplicity. (I've given a different selection of combinations and included '%' where necessary to avoid single character versus custom complications).


<pre><#RecentTS d=2 format="h:mm'&nbsp;'tt'<small>on' d/M/yyyy'</small>'"></pre>
==== My Revised Table of Time and Date Output Modifiers ====
This puts the date in a smaller font than the time


=== Output (format modifier) parameters for decimal places ===
In some rows of this table, square brackets [] indicate optional items, they are included just to make it clearer how items can be combined in a single output parameter.
 
{| class="wikitable" border="1"
 
|-
Cumulus 1 allows use of <tt>dp=n</tt> modifier (where n represents desired number of decimal places for latitude and longitude e.g. <#latitude dp=5> gives "59.24250". This is also available in MX.
!style="width:150px" | {{Version badge 1}}Delphi Specifier for Cumulus 1.9.x
MX makes much more usage of these '''dp''' parameters. For example in the moon tags  <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234"  
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX
 
!style="width:600px" | Displays
*<tt>dp=i</tt> is used for both Cumulus 1 and MX. The value '''i''' following the attribute '''dp''' is an integer, how many decimal places you want for the output you see. Only available for a limited range of web tags (latitude and longitude, plus in MX <#MoonPercent> and <#MoonPercentAbs>).
!style="width:600px" | Example
*<tt>tc=y</tt> is a new parameter only in MX, the attribute '''tc''' takes the value 'y' to remove decimal places by truncation instead of using <tt>dp=0</tt> which would round to nearest integer. e.g. <#MoonAge tc=y>. At present not available in any other web tags.
|-
 
|c
=== Output (format modifier) indicating remove commas ===
|G
 
|Displays the date using the format given by the Short Date format, followed by the time using the format given by the Long Time format. The time is not displayed in Cumulus 1 if the date-time value indicates midnight precisely.
"rc=y" is a '''new parameter for MX''', the attribute '''rc''' takes the value 'y' to replace any commas defined by the locale with full stops to separate integer and decimal parts of the output value. It was initially only implemented on a few new web tags (#MoonPercent, #MoonPercentAbs, #MoonAge) for MX versions up to and including 3.5.3. From version 3.6.6 only can all web tags that can output real numbers can now use alternative syntax of <tt><#tag_name rc=y></tt> to replace all commas in the output by a full stop (don't worry, MX does not use a comma for separating off thousands, so it is the decimal comma that becomes a decimal full stop like character when this remove comma specifier is used.
|'22/03/2019 09:47:25' produced by {{Version badge 1}}<#time format=c>[[File:Badge vMx.png]]<#time format=G>
 
|-
 
|d
Why would you want to remove decimal commas?  Well because the JavaScript language cannot understand decimal commas, and MX has several scripts written in this language, equally some third party alternative web pages rely on ajax to update them (and Ajax uses JavaScript).
|%d
 
|Displays the day as a number without a leading zero (1-31). [[File:Badge vMx.png]]Note that Cumulus MX requires a ' ' (space), '%' or other modifier to be included, as 'd' on its own returns full 'short date').
=== Output (format modifier) parameters for times and dates ===
|27 produced by {{Version badge 1}}<#metdate format="d">[[File:Badge vMx.png]]<#metdate format="%d">
 
|-
Time/Date format codes are used in two places:
|dd
# As part of report names for NOAA style reports (see [[Cumulus.ini#Section:_NOAA]])
|dd
# As part of web-tags that report either times or dates or both a date and a time
|Displays the day as a number with a leading zero (01-31).
From version 1.9.1 most web-tags  that report any form of time or date will accept an optional 'format' parameter, e.g. (Cumulus 1 only): <#YearTempHT format=hh:nn>.
|07 produced by <#metdate format="dd">
 
|-
This allows you to override the default display format for that item, using the format specifiers in the table below.
|ddd
 
|ddd
Although, in theory, you can specify date formatting to times, and vice versa, this will not always yield a sensible result. It is best to look at the default format (in most, but not all, cases this reveals whether date and time information are both available):
|Displays the day as an abbreviation (Sun-Sat) using the strings appropriate to the Locale.
*The time-stamps for today, and yesterday, only contain time information, so only time-based format instructions should be applied to them. You can use date format parameters on (for example) <#metdate>, and <#metdateyesterday> and that may give you your desired date information to augment the time-stamps.
|'Wed' produced by <#metdate format="ddd"> (English locale)
*Almanac times such as sun-rise, moon-rise, are also only times, and time-based format instructions can generally be applied to them.  However, be aware these are calculated as at midnight GMT and for some of your calendar days, the times may be reported (in default format) as '--' if for example the moon does not rise that day.
|-
 
|dddd
=== Additional text in output format partameters ===
|dddd
 
|Displays the day as a full name (Sunday-Saturday) using the strings appropriate to the Locale.
You should put anything that is additional, to the defined format modifier specification below, into single quotation marks to prevent it being interpreted as a date or time format modifier:
|'Friday' produced by <#metdate format="dddd"> (English locale)
 
#For example, the word "on" contains the character "n", which for Cumulus versions 1.9.1 to 1.9.4 will be interpreted as a time format modifier unless you put it into single quotation marks. Example of valid Cumulus 1 syntax: <#TtempH format="'at' hh: mm 'on' dd / mm / yyyy">.
#You can include HTML tags (but they cannot have any attributes because both single and double quote characters have defined meanings) and special characters as quoted text within the 'format' parameter.<br>  Example of valid syntax: <#TapptempH format="'at 'h:nn'&nbsp;'am/pm '&lt;small&gt;on' d/m/yyyy'&lt;/small&gt;'">.
 
{{Version badge 1}}'''Note for Cumulus 1 -  if your format has any spaces in it''', you must enclose the whole format parameter value in double quotes, for example (Cumulus 1.9.x): <#YearTempHT format="hh nn">. Consequently, you cannot include double quote characters in any other position (see [[Php_webtags#Web_tag_Complications| here for work-around]]).
 
[[File:Badge vMx.png]]Note for MX - you can use single quotation marks round spaces and text (e.g. ' on '), but you can also use '\' as escape character (e.g. for 'on' use '''\o\n'''). However for 'at' the only alternative is '''\a't''''  because the character t has another meaning and escape followed by a t becomes a tab!
 
=== List of allowed modifiers for output format parameters ===
Note for Cumulus 1 - where lower (or upper, for easier comparison with MX) case shown, because Delphi is case insensitive, upper (or lower) case (in some cases, indicated by use of curved brackets) could be used instead (exceptions: a/p, ampm, am/pm, Am/Pm, AM/PM, A/P, AMPM etc display as input).
 
[[File:Badge vMx.png]]Remember that most single character format specifiers have a different meaning to when the same letter appears in a multi-character format.
 
 
==== Forum reference ====
 
For official full details see [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=17888 Cumulus MX forum], the following table is revised for simplicity. (I've given a different selection of combinations and included '%' where necessary to avoid single character versus custom complications).
 
==== My Revised Table of Time and Date Output Modifiers ====
 
In some rows of this table, square brackets [] indicate optional items, they are included just to make it clearer how items can be combined in a single output parameter.
{| class="wikitable" border="1"
|-
|-
!style="width:150px" | {{Version badge 1}}Delphi Specifier for Cumulus 1.9.x
|ddddd
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX
|d (as single character format)
!style="width:600px" | Displays
|Displays the date using the format given by the Short Date format.
!style="width:600px" | Example
|e.g. '22/03/2019' (British Locale)
|-
|-
|c
|dddddd
|G
|D
|Displays the date using the format given by the Short Date format, followed by the time using the format given by the Long Time format. The time is not displayed in Cumulus 1 if the date-time value indicates midnight precisely.
|Displays the date using the format given by the Long Date format.
|'22/03/2019 09:47:25' produced by {{Version badge 1}}<#time format=c>[[File:Badge vMx.png]]<#time format=G>
|e.g. '22 March 2020' (British Locale)
|-
|-
|d
|M (or ''m'')
|%d
|%M
|Displays the day as a number without a leading zero (1-31). [[File:Badge vMx.png]]Note that Cumulus MX requires a ' ' (space), '%' or other modifier to be included, as 'd' on its own returns full 'short date').
|Displays the month as a number without a leading zero (1-12).  
|27 produced by {{Version badge 1}}<#metdate format="d">[[File:Badge vMx.png]]<#metdate format="%d">
*{{Version badge 1}}Cumulus 1.x.y:If the 'M' or 'm' specifier immediately follows an h, hh, HH, or H specifier, the minute rather than the month is displayed.
*[[File:Badge vMx.png]]Cumulus MX: Note that including a ' ' (space) or '%' before the M makes it a custom modifier e.g. '7' is returned for July as any initial zero is suppressed. ('M' on its own returns both Month and Day according to local format e.g. 22 July).
|2
|-
|-
|dd
|MM (or ''mm'')
|dd
|MM
|Displays the day as a number with a leading zero (01-31).
|Displays the month as a number with a leading zero (01-12).
|07 produced by <#metdate format="dd">
*{{Version badge 1}}Cumulus 1.x.y:If the 'm' or 'M' specifier immediately follows an h, H, HH, or hh specifier, the minute rather than the month is displayed.
|'03' produced by <#LastDataReadT format=MM>
|-
|-
|ddd
|MMM (or ''mmm'')
|ddd
|MMM
|Displays the day as an abbreviation (Sun-Sat) using the strings appropriate to the Locale.
|Displays the month as an abbreviation (Jan-Dec) using the strings appropriate to the Locale.produced by <#metdate format="MM">
|'Wed' produced by <#metdate format="ddd"> (English locale)
|'Jun' produced by <#metdate format="MMM"> (English locale)
|-
|-
|dddd
|MMMM (or ''mmmm'')
|dddd
|MMMM
|Displays the day as a full name (Sunday-Saturday) using the strings appropriate to the Locale.
|Displays the month as a full name (January-December) using the strings appropriate to the Locale.
|'Friday' produced by <#metdate format="dddd"> (English locale)
|'June' produced by <#metdate format="MMMM"> (English locale)
|-
|-
|ddddd
|yy
|d (as single character format)
|yy
|Displays the date using the format given by the Short Date format.
|Displays the year as a two-digit number (00-99).
|e.g. '22/03/2019' (British Locale)
|19 produced by <#LastDataReadT format=yy>
|-
|-
|dddddd
|yyyy
|D
|yyyy
|Displays the date using the format given by the Long Date format.
|Displays the year as a four-digit number (0000-9999).
|e.g. '22 March 2020' (British Locale)
|2019 produced by <#LastDataReadT format=yyyy>
|-
|-
|M (or ''m'')
|h [''AM/PM'']
|%M
|h [''tt'']
|Displays the month as a number without a leading zero (1-12).  
|Displays the hour (12 hour clock) without a leading zero (1-12) [optionally in combination with AM/PM]. What "tt" produces depends on locale settings for your device, it might be capitals or it might be lower case (in Windows use Control Panel, not Settings app, to get to these regional additional settings).
*{{Version badge 1}}Cumulus 1.x.y:If the 'M' or 'm' specifier immediately follows an h, hh, HH, or H specifier, the minute rather than the month is displayed.
{{Version badge 1}}For Cumulus 1 the formats for am/pm depend on the case in which you type the parameter as shown later in this table
*[[File:Badge vMx.png]]Cumulus MX: Note that including a ' ' (space) or '%' before the M makes it a custom modifier e.g. '7' is returned for July as any initial zero is suppressed. ('M' on its own returns both Month and Day according to local format e.g. 22 July).
|2
|-
|-
|MM (or ''mm'')
|h:mm (or ''h:nn'') [''AM/PM'']
|MM
|h:mm [''tt'']
|Displays the month as a number with a leading zero (01-12).  
|Displays the hour (12 hour clock) without a leading zero (1-12) followed by 2 digit minutes [optionally in combination with AM/PM whose case varies as explained in previous entry].
*{{Version badge 1}}Cumulus 1.x.y:If the 'm' or 'M' specifier immediately follows an h, H, HH, or hh specifier, the minute rather than the month is displayed.
{{Version badge 1}}For Cumulus 1, the minutes can be represented by 'mm' only when appearing in combination with 'h'
|'03' produced by <#LastDataReadT format=MM>
|'10:27 am' produced by {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|-
|-
|MMM (or ''mmm'')
|H (or ''H'')
|MMM
|%H
|Displays the month as an abbreviation (Jan-Dec) using the strings appropriate to the Locale.produced by <#metdate format="MM">
|Displays the hour using 24 hour clock without a leading zero (0-23). [[File:Badge vMx.png]]Note that % is only needed when H is on its own.
|'Jun' produced by <#metdate format="MMM"> (English locale)
|7 produced by {{Version badge 1}}<#daylength format=H>
[[File:Badge vMx.png]]<#daylength format=%H>
|-
|-
|MMMM (or ''mmmm'')
|H:mm (or ''H:nn'')
|MMMM
|H:mm
|Displays the month as a full name (January-December) using the strings appropriate to the Locale.
|Displays the hour using 24 hour clock without a leading zero (0-23) followed by 2 digit minutes. [[File:Badge vMx.png]]Note that % is not needed when H is not on its own.
|'June' produced by <#metdate format="MMMM"> (English locale)
|'7:27' produced by <#LastDataReadT format="H:mm">
|-
|-
|yy
|HH (or ''hh'')
|yy
|HH
|Displays the year as a two-digit number (00-99).
|Displays the hour using 24 hour clock with a leading zero (00-23).
|19 produced by <#LastDataReadT format=yy>
|'06' or 19 produced by <#LastDataReadT format=HH>
|-
|-
|yyyy
|hh (''am/pm'')
|yyyy
|hh [''tt'']
|Displays the year as a four-digit number (0000-9999).
|Displays the hour (12 hour clock) with a leading zero (01-12) [optionally in combination with am/pm].
|2019 produced by <#LastDataReadT format=yyyy>
{{Version badge 1}}For Cumulus 1 the case output for the optional 'am/pm' depends on the case used for that parameter as shown later in this table
[[File:Badge vMx.png]] For MX, the optional 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight
|'07 am' produced by {{Version badge 1}} <#LastDataReadT format="hh am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="hh tt">
|-
|-
|h [''AM/PM'']
|hh:mm (or ''hh:nn'') [''am/pm'']
|h [''tt'']
|hh:mm [''tt'']
|Displays the hour (12 hour clock) without a leading zero (1-12) [optionally in combination with AM/PM]. What "tt" produces depends on locale settings for your device, it might be capitals or it might be lower case (in Windows use Control Panel, not Settings app, to get to these regional additional settings).
|Displays the hour (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally in combination with am/pm].
{{Version badge 1}}For Cumulus 1 the formats for am/pm depend on the case in which you type the parameter as shown later in this table
{{Version badge 1}}For Cumulus 1, the minutes can be represented by 'mm' only when in combination with 'h', in other contexts 'mm' is interpreted as month number, and the case output for am/pm depends on the case used for that parameter as shown later in this table
[[File:Badge vMx.png]] For MX, the optional 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight
|'8:27 am' produced by {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|-
|-
|h:mm (or ''h:nn'') [''AM/PM'']
|n
|h:mm [''tt'']
|m
|Displays the hour (12 hour clock) without a leading zero (1-12) followed by 2 digit minutes [optionally in combination with AM/PM whose case varies as explained in previous entry].
|Displays the minute without a leading zero (0-59).  
{{Version badge 1}}For Cumulus 1, the minutes can be represented by 'mm' only when appearing in combination with 'h'
|7 produced by {{Version badge 1}}<#daylength format=n>[[File:Badge vMx.png]]<#daylength format=m>
|'10:27 am' produced by {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|-
|-
|H (or ''H'')
|nn
|%H
|mm
|Displays the hour using 24 hour clock without a leading zero (0-23). [[File:Badge vMx.png]]Note that % is only needed when H is on its own.
|Displays the minute with a leading zero (00-59).  
|7 produced by {{Version badge 1}}<#daylength format=H>
|'07' produced by {{Version badge 1}}<#daylength format=nn>[[File:Badge vMx.png]]<#daylength format=mm>
[[File:Badge vMx.png]]<#daylength format=%H>
|-
|-
|H:mm (or ''H:nn'')
|s
|H:mm
|s
|Displays the hour using 24 hour clock without a leading zero (0-23) followed by 2 digit minutes. [[File:Badge vMx.png]]Note that % is not needed when H is not on its own.
|Displays the second without a leading zero (0-59).
|'7:27' produced by <#LastDataReadT format="H:mm">
|-
|-
|HH (or ''hh'')
|ss
|HH
|ss
|Displays the hour using 24 hour clock with a leading zero (00-23).
|Displays the second with a leading zero (00-59).
|'06' or 19 produced by <#LastDataReadT format=HH>
|'06' or 19 produced by <#LastDataReadT format=ss>
|-
|-
|hh (''am/pm'')
|z
|hh [''tt'']
|FFF
|Displays the hour (12 hour clock) with a leading zero (01-12) [optionally in combination with am/pm].
|Displays the millisecond without a leading zero (Cumulus 1:0-999, Cumulus MX: nothing, or 1-999). Note that the system clock in some versions of Windows only has precision to 15 ms.
{{Version badge 1}}For Cumulus 1 the case output for the optional 'am/pm' depends on the case used for that parameter as shown later in this table
|  
[[File:Badge vMx.png]] For MX, the optional 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight
|'07 am' produced by {{Version badge 1}} <#LastDataReadT format="hh am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="hh tt">
|-
|-
|hh:mm (or ''hh:nn'') [''am/pm'']
|(not available)
|hh:mm [''tt'']
|ff (or ''f'')
|Displays the hour (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally in combination with am/pm].
|Displays hundredths of a second (or tenths) with leading zero(s)
{{Version badge 1}}For Cumulus 1, the minutes can be represented by 'mm' only when in combination with 'h', in other contexts 'mm' is interpreted as month number, and the case output for am/pm depends on the case used for that parameter as shown later in this table
|
[[File:Badge vMx.png]] For MX, the optional 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight
|'8:27 am' produced by {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|-
|-
|n
|zzz
|m
|fff
|Displays the minute without a leading zero (0-59).  
|Displays the millisecond with a leading zero (000-999). Note that the system clock in some versions of Windows only has precision to 15 ms, so requesting thousandths of a second may not return anything useful. The 'fff' modifier can actually be extended to 'ffffff' for a millionth of a second!
|7 produced by {{Version badge 1}}<#daylength format=n>[[File:Badge vMx.png]]<#daylength format=m>
|
|-
|-
|nn
|t
|mm
|t
|Displays the minute with a leading zero (00-59).  
|Displays the time using the Short Time format. [[File:Badge vMx.png]]Remember that 't' combined with other specifiers (or preceded by space or '%') has a different meaning - see below.
|'07' produced by {{Version badge 1}}<#daylength format=nn>[[File:Badge vMx.png]]<#daylength format=mm>
| '09:47' produced by <#LastDataReadT format=t> (might not use colon in your locale) for both flavours of Cumulus
|-
|-
|s
|TT
|s
|T
|Displays the second without a leading zero (0-59).
|Displays the time using the Long Time format.
|'09:47:56'  (might not use colon in your locale) produced by {{Version badge 1}}<#LastDataReadT format=TT> [[File:Badge vMx.png]]<#LastDataReadT format=T>
|-
|-
|ss
|am/pm or Am/Pm or AM/PM
|ss
|tt
|Displays the second with a leading zero (00-59).
|{{Version badge 1}}Uses the 12-hour clock for the preceding h or H specifier, and displays 'am' for any hour from midnight until just before noon, and 'pm' for any hour from noon onwards. The am/pm specifier for Cumulus 1 can use lower, upper, or mixed case, and the result is displayed accordingly.
|'06' or 19 produced by <#LastDataReadT format=ss>
 
[[File:Badge vMx.png]] For MX, 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight
| {Version badge 1}} 'am' produced by <#LastDataReadT format=am/pm>, 'AM' produced by <#LastDataReadT format=AM/PM>
|-
|-
|z
|a/p
|FFF
|t
|Displays the millisecond without a leading zero (Cumulus 1:0-999, Cumulus MX: nothing, or 1-999). Note that the system clock in some versions of Windows only has precision to 15 ms.
|Uses the 12-hour clock for the preceding h or H specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon.
|  
{{Version badge 1} The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
[[File:Badge vMx.png]]Remember that 't' has to be combined with other specifiers (or preceded by space or '%') to display 'a' or 'p' as if it is alone it has a different (short format time) meaning - see above.
| see previous example
|-
|-
|(not available)
|ampm
|ff (or ''f'')
|(see above for 12 hour formats)
|Displays hundredths of a second (or tenths) with leading zero(s)
|This displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight.
|
{{Version badge 1}Uses the 12-hour clock for the preceding h or H specifier
| see previous examples
|-
|-
|zzz
|/
|fff
|/
|Displays the millisecond with a leading zero (000-999). Note that the system clock in some versions of Windows only has precision to 15 ms, so requesting thousandths of a second may not return anything useful. The 'fff' modifier can actually be extended to 'ffffff' for a millionth of a second!
|Displays the date separator character given by the Date Separator. It might not display a slash.
|
| '/' for British locale
|-
|-
|t
|:
|t
|:
|Displays the time using the Short Time format. [[File:Badge vMx.png]]Remember that 't' combined with other specifiers (or preceded by space or '%') has a different meaning - see below.
|Displays the time separator character given by the Time Separator. It might not display a colon.
| '09:47' produced by <#LastDataReadT format=t> (might not use colon in your locale) for both flavours of Cumulus
|':' for British locale
|-
|-
|TT
|'xy'
|T
|'xy' or ''\x\y''
|Displays the time using the Long Time format.  
|Characters enclosed in single quotation marks are displayed as such, and do not affect formatting. In MX each character to be displayed as it was typed can be prefixed by a backslash.
|'09:47:56' (might not use colon in your locale) produced by {{Version badge 1}}<#LastDataReadT format=TT> [[File:Badge vMx.png]]<#LastDataReadT format=T>
|Hyphens are added in this PHP language example  '<#LastDataReadT format=yyyy>'.'-'.'<#LastDataReadT format=MM>'.'-'.'<#LastDataReadT format="dd">'
|-
|}
|am/pm or Am/Pm or AM/PM
 
|tt
==== Using HTML tags within format parameters (available in MX only) ====
|{{Version badge 1}}Uses the 12-hour clock for the preceding h or H specifier, and displays 'am' for any hour from midnight until just before noon, and 'pm' for any hour from noon onwards. The am/pm specifier for Cumulus 1 can use lower, upper, or mixed case, and the result is displayed accordingly.
 
'''Example using a class to change the look of part of the output'''


[[File:Badge vMx.png]] For MX, 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight
<pre><#TapptempH format="dd'&nbsp;'MMM'&nbsp;'yyyy'<span class=\'xx\'> at 'HH:mm'</span>'"></pre>
| {Version badge 1}} 'am' produced by <#LastDataReadT format=am/pm>, 'AM' produced by <#LastDataReadT format=AM/PM>
the output from this will look like ''04&nbsp;Dec&nbsp;2018<span class='xx'> at 10:12</span>''
|-
|a/p
|t
|Uses the 12-hour clock for the preceding h or H specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon.
{{Version badge 1} The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
[[File:Badge vMx.png]]Remember that 't' has to be combined with other specifiers (or preceded by space or '%') to display 'a' or 'p' as if it is alone it has a different (short format time) meaning - see above.
| see previous example
|-
|ampm
|(see above for 12 hour formats)
|This displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight.
{{Version badge 1}Uses the 12-hour clock for the preceding h or H specifier
| see previous examples
|-
|/
|/
|Displays the date separator character given by the Date Separator. It might not display a slash.
| '/' for British locale
|-
|:
|:
|Displays the time separator character given by the Time Separator. It might not display a colon.
|':' for British locale
|-
|'xy'
|'xy' or ''\x\y''
|Characters enclosed in single quotation marks are displayed as such, and do not affect formatting. In MX each character to be displayed as it was typed can be prefixed by a backslash.
|Hypens are added in this PHP language example  '<#LastDataReadT format=yyyy>'.'-'.'<#LastDataReadT format=MM>'.'-'.'<#LastDataReadT format="dd">'
|}


=The Web Tags for Cumulus =
'''Note where the quotes are, and where you need to use '\' escape characters'''.


These are available in both Cumulus 1 and MX unless indicated by a version 1 or MX badge.
'''Example using HTML tags'''
 
<pre><#RecentTS d=2 format="h:mm'&nbsp;'tt'<small>on' d/M/yyyy'</small>'"></pre>
This puts the date in a smaller font than the time
 
=== Output (format modifier) parameters for decimal places ===
 
 
Cumulus 1 allows use of <tt>dp=n</tt> modifier (where n represents desired number of decimal places for latitude and longitude e.g. <#latitude dp=5> gives "59.24250". This is also available in MX.
MX makes much more usage of these '''dp''' parameters. For example in the moon tags  <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234"
 
*<tt>dp=i</tt> is used for both Cumulus 1 and MX. The value '''i''' following the attribute '''dp''' is an integer, how many decimal places you want for the output you see. Only available for a limited range of web tags (latitude and longitude, plus in MX <#MoonPercent> and <#MoonPercentAbs>).
*<tt>tc=y</tt> is a new parameter only in MX, the attribute '''tc''' takes the value 'y' to remove decimal places by truncation instead of using <tt>dp=0</tt> which would round to nearest integer. e.g. <#MoonAge tc=y>. At present not available in any other web tags.
 
=== Output (format modifier) indicating remove commas ===


Here follow tables indicating what web tags/tokens can be used, tables group the tags/tokens by the basic purpose of the tags listed.
"rc=y" is a '''new parameter for MX''', the attribute '''rc''' takes the value 'y' to replace any commas defined by the locale with full stops to separate integer and decimal parts of the output value. It was initially only implemented on a few new web tags (#MoonPercent, #MoonPercentAbs, #MoonAge) for MX versions up to and including 3.5.3. From version 3.6.6 only can all web tags that can output real numbers can now use alternative syntax of <tt><#tag_name rc=y></tt> to replace all commas in the output by a full stop (don't worry, MX does not use a comma for separating off thousands, so it is the decimal comma that becomes a decimal full stop like character when this remove comma specifier is used.




===System===
Why would you want to remove decimal commas?  Well because the JavaScript language cannot understand decimal commas, and MX has several scripts written in this language, equally some third party alternative web pages rely on ajax to update them (and Ajax uses JavaScript).


Special tags returning information about the Windows device hosting Cumulus 1. ''If you are running MX, then most tags do not work.
== Additional text in output format parameters ==
''


{| class="wikitable" border="1"
You should put anything that is additional, to the defined format modifier specification below, into single quotation marks to prevent it being interpreted as a date or time format modifier:
|-
 
!style="width:150px" |Web tag_name
#For example, the word "on" contains the character "n", which for Cumulus versions 1.9.1 to 1.9.4 will be interpreted as a time format modifier unless you put it into single quotation marks. Example of valid Cumulus 1 syntax: <#TtempH format="'at' hh: mm 'on' dd / mm / yyyy">.
!style="width:600px" |Function
#You can include HTML tags (but they cannot have any attributes because both single and double quote characters have defined meanings) and special characters as quoted text within the 'format' parameter.<br>  Example of valid syntax: <#TapptempH format="'at 'h:nn'&nbsp;'am/pm '&lt;small&gt;on' d/m/yyyy'&lt;/small&gt;'">.
|-
 
|<#OsVersion>
{{Version badge 1}}'''Note for Cumulus 1 -  if your format has any spaces in it''', you must enclose the whole format parameter value in double quotes, for example (Cumulus 1.9.x): <#YearTempHT format="hh nn">. Consequently, you cannot include double quote characters in any other position (see [[Php_webtags#Web_tag_Complications| here for work-around]]).
|OS version, e.g. "Windows 7 x64 build 7600"
 
|-
[[File:Badge vMx.png]]Note for MX - you can use single quotation marks round spaces and text (e.g. ' on '), but you can also use '\' as escape character (e.g. for 'on' use '''\o\n''').  However for 'at' the only alternative is '''\a't''''  because the character t has another meaning and escape followed by a "t" i.e. "\t" becomes a tab!
|<#OsLanguage>
 
|OS language, e.g. "English"
 
 
=The Web Tags for Cumulus =
 
These are available in both Cumulus 1 and MX unless indicated by a version 1 or MX badge.
 
Here follow tables indicating what web tags/tokens can be used, tables group the web tags available by the basic purpose of the tags listed.
 
== System ==
 
Special tags returning information about the Windows device hosting Cumulus 1. ''If you are running MX, then most tags do not work.
''
 
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:600px" |Function
|-
|<#OsVersion>
|OS version, e.g. "Windows 7 x64 build 7600"
|-
|<#OsLanguage>
|OS language, e.g. "English"
|-
|-
|<#SystemUpTime>
|<#SystemUpTime>
Line 582: Line 595:
|}
|}


==Miscellaneous==
== Miscellaneous ==


All tags are available in all flavours, as far as I know, although their output might vary, and which input/output parameters they permit might vary between Cumulus 1 and MX.
All tags are available in all flavours, as far as I know, although their output might vary, and which input/output parameters they permit might vary between Cumulus 1 and MX.
Line 828: Line 841:
|-
|-
|<#feelslike>
|<#feelslike>
|The current [[Feels_Like|Feels Like]] temperature.  The referenced page in weather terminology section of this Wiki explains it. Although output from version 3.5.4 build 3075, the correct value is only available from version 3.6.10 (build 3086) onwards as incorrect formula used in builds 3084 and 3085, and a different formula used in builds from 3075 to 3083.
|Not available in Cumulus 1. Not available in all MX versions. Please see sub-section below this table regarding availability by MX versions if you are using a MX version earlier than 3.6.10.
 
The current [[Feels_Like|Feels Like]] temperature.  The referenced page in weather terminology section of this Wiki explains it.
|-
|-
|<#IsFreezing>
|<#IsFreezing>
Line 1,015: Line 1,030:
|The same as <#currcond> but also has all characters above (decimal base) code 159 encoded as HTML entities for example this would encode any use of symbol for degree.
|The same as <#currcond> but also has all characters above (decimal base) code 159 encoded as HTML entities for example this would encode any use of symbol for degree.
|}
|}
==== Feels Like ====
The figures quoted for this derivative vary between versions:
* The first formula was used from MX version 3.5.4 (25 Apr 2020) build 3075 until version 3.6.7 (4 June 2020) build 3083
* The second formula, which was coded incorrectly, and so gave strange results, applied in versions 3.6.8 to 3.6.9 (build 3084, 3085)
* The third, and hopefully final, formula applies from version 3.6.10 (build 3086).
A php script for adding feels like as calculated in version 3.6.10 to any standard log line created either without feels like, or with an older calculation, can be downloaded from [https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=18096 Create Missing topic on support forum]


==Extra Sensors Davis (and a few others)==
==Extra Sensors Davis (and a few others)==
Line 1,195: Line 1,218:
|-
|-
|<#RecentWindChill>
|<#RecentWindChill>
|Wind Chill
|Wind Chill (if temperature is below 10°C or 50 °F, then the new Feels Like now available in MX will report this same value).
| <#RecentWindChill d=48 m=1> reports the wind chill temperature 2 days ago
| <#RecentWindChill d=48 m=1> reports the wind chill temperature 2 days ago
|-
|-
Line 1,256: Line 1,279:
| d=n (where n runs 0 to 6) days ago; h=n (where n is any number of hours ago); m=n (where n is any number of minutes ago)
| d=n (where n runs 0 to 6) days ago; h=n (where n is any number of hours ago); m=n (where n is any number of minutes ago)
|}
|}


=== Other weather derivatives ===
=== Other weather derivatives ===
Line 1,277: Line 1,299:
H = (5/9 * (<#RecentHumidity h=3> /100 * svp - 10)) + <#RecentOutsideTemp h=3;
H = (5/9 * (<#RecentHumidity h=3> /100 * svp - 10)) + <#RecentOutsideTemp h=3;


==== Apparent Temperature ====
==== Apparent Temperature and Feels Like ====


Note this formula uses Celsius for temperature and metres per second for wind speed. You will need to do the appropriate conversions if you use different units.  Formula is same for Cumulus 1 and MX.
Note this apparent temperature formula uses Celsius for temperature and '''metres per second''' for wind speed. You will need to do the appropriate conversions from the quoted recent history tags if you use different units.  The Australian Apparent temperature formula is same for Cumulus 1 and MX:


var actualVaporPress = <#RecentHumidity h=3>/100) * 6.105 * Math.exp(17.27 * <#RecentOutsideTemp h=3>) / (237.7 + parseFloat(<#RecentOutsideTemp h=3>))));
var actualVaporPress = <#RecentHumidity h=3>/100) * 6.105 * Math.exp(17.27 * <#RecentOutsideTemp h=3>) / (237.7 + parseFloat(<#RecentOutsideTemp h=3>))));
var appTempDegC = parseFloat(<#RecentOutsideTemp h=3) + (0.33 * actualVaporPress) - (0.7 * <#RecentWindSpeed h=3>) - 4;
var appTempDegC = parseFloat(<#RecentOutsideTemp h=3) + (0.33 * actualVaporPress) - (0.7 * <#RecentWindSpeed h=3>) - 4;


==== Feels Like ====
Feels Like as implemented at version 3.6.10 (see [[#Feels_Like|Feels Like section below Current condition web tags]]) uses Celsius for temperature and '''km per hour''' for wind speed. Again, you will need to do the appropriate conversions from the quoted recent history tags if you use different units.
 
Calculation from recent history tags is much more complicated because there are 3 different calculations: Feels Like reports exactly same as wind chill for temperatures '''below''' 10°C or 50°F so the WC here should equal <#RecentWindChill h=3>:
<pre>if(<#RecentWindSpeed h=3> < 4.828) WC =  <#RecentOutsideTemp h=3>;
else{
wind_pow =  Math.pow(<#RecentWindSpeed h=3>, 0.16);
WC = (13.12 + 0.1625 * <#RecentOutsideTemp h=3>) - (11.37 * wind_pow) + (0.3965 * <#RecentOutsideTemp h=3> * wind_pow);// Brackets used to ensure "+" is interpreted as addition not concatenation
} </pre>
 
For temperatures '''above''' 20°C or 68°F Feels Like uses a different way to calculate apparent temperature that it uses at these higher temperatures (this formula only used for 3.6.10 onwards):
<pre>var actualVaporPress = <#RecentHumidity h=3>/100) * 6.112* Math.exp((17.62 * <#RecentOutsideTemp h=3>)/(243.12 + <#RecentOutsideTemp h=3>)) / 10.0;  // Not same as at build 3084
/* uses kilometres per hour for wind speed */
/*  What Cumulus MX will use to calculate apparent temperature for feels like is changed very slightly */
if(<#RecentWindSpeed h=3> > 72) <#RecentWindSpeed h=3> =72;
AT= (1.04 * <#RecentOutsideTemp h=3>) + (2 * actualVaporPress) - (0.1805553 * <#RecentWindSpeed h=3>) - 2.7;</pre>
 
For in-between temperatures it uses a more complicated merge of the two formulas for AT and WC as defined above:
<pre>app_temp_mult = (<#RecentOutsideTemp h=3> - 10) / 10;
wind_chill_mult = 1 - app_temp_mult;


Formula deleted, as only used from MX version 3.5.4 (25 Apr 2020) build 3075 until version 3.6.7 (4 June 2020) build 3083
FL= AT * app_temp_mult + WC * wind_chill_mult;</pre>


==Today==
==Today==
Many of these web tags are used on the supplied '''todayT.htm''' template, and the supplied '''todayyest.html''' page within the MX admin interface.
For web tags that report values that refer to a particular time of day, there is a corresponding web tag that can give the time of day, shown in same row of table below.  
For web tags that report values that refer to a particular time of day, there is a corresponding web tag that can give the time of day, shown in same row of table below.  


Line 1,295: Line 1,338:
|-
|-
!style="width:150px" | Web tag_name
!style="width:150px" | Web tag_name
!style="width:450px" | Function
!style="width:650px" | Function
!style="width:150px" | Time tag_name
!style="width:150px" | Time tag_name
|-
|-
Line 1,325: Line 1,368:
|-
|-
|<#feelslikeTH>
|<#feelslikeTH>
|[[File:Badge vMx.png]] Available from version 3.6.0 Today's high feels like temperature
|[[File:Badge vMx.png]] Available from version 3.6.10 Today's high feels like temperature
|<#TfeelslikeH>
|<#TfeelslikeTH>
|-
|-
|<#feelslikeL>
|<#feelslikeTL>
|[[File:Badge vMx.png]] Available from version 3.6.0 Today's low feels like temperature
|[[File:Badge vMx.png]] Available from version 3.6.10 Today's low feels like temperature
|<#TfeelslikeL>
|<#TfeelslikeTL>
|-
|-
|<#heatindexTH>
|<#heatindexTH>
Line 1,459: Line 1,502:


==Yesterday==
==Yesterday==
Note that the Y indicating yesterday is sometimes a prefix, sometimes a suffix (with H for High, L for Low), web tags are not named consistently!
Note that the Y indicating yesterday is sometimes a prefix, sometimes a suffix (with H for High, L for Low), web tags are not named consistently!


Many of these web tags are used on the supplied yesterdayT.htm template, and the supplied todayyest.html page within the MX user interface.
Many of these web tags are used on the supplied '''yesterdayT.htm''' template, and the supplied '''todayyest.html''' page within the MX admin interface.


For web tags that refer to a particular time of day, there is a corresponding web tag that can give the time of day. Please note none of the time web tags can be modified by output parameters to give a date, but they can be changed from the default time format that is 'h:mm'.
For web tags that refer to a particular time of day, there is a corresponding web tag that can give the time of day. Please note none of the time web tags can be modified by output parameters to give a date, but they can be changed from the default time format that is 'h:mm'.
Line 1,467: Line 1,511:
|-
|-
!style="width:150px" | Web tag_name
!style="width:150px" | Web tag_name
!style="width:450px" | Function
!style="width:550px" | Function
!style="width:150px" | Time
!style="width:150px" | Time
|-
|-
Line 1,614: Line 1,658:


==Monthly==
==Monthly==
This table shows the web tags used on the "thismonthT.htm" web page, the rainfall this month does not appear  on that page, does not appear  on that page, it is shown in [[#Current_Conditions|indexT.htm]] table earlier on this page.


The web tags in the date column output dates in the format "dd MMMM" (same for Cumulus 1 and Cumulus MX), this can be changed using the [[#Time.2FDate_.27format.27_Parameter|format parameters]] described above. For web tags that represent daily values, there are (obviously) no corresponding time web tags, but for high and low spot values the default 'h:mm' format of the time output can be changed using output parameters.
This table shows the web tags used on the '''thismonthT.htm''' web page,and the '''records.html''' page (accessed by penultimate tab) in the admin interface.
 
Because the rainfall this month does not appear on '''thismonthT.htm''' web page, it is shown in [[#Current_Conditions|indexT.htm]] table earlier in this article which is for the web page where it does appear.
 
The web tags in the date column output dates in the format "dd MMMM" (for once this is same for Cumulus 1 and Cumulus MX). Should you require a different output format, this can be changed using the [[#Time.2FDate_.27format.27_Parameter|format parameters]] described above. For web tags that represent daily values, there are (obviously) no corresponding time web tags, but for high and low spot values the default 'h:mm' format of the time output can be changed using output parameters. Do make sure that you get the web tag names right and the output form at parameters right.
 
As another example of inconsistency in how web tags added in different versions are coded, there are two web tags (highest minimum/lowest maximum temperatures) where a standard web tag is not provided by Cumulus (1 or MX) for the associated time-stamp. Consequently, for these 2 (and their corresponding tags in the this year group), there are mandatory output parameters required as shown in the table. Obviously Cumulus 1 lets you use "NN", "nn", "MM", or "mm" for the minutes, but minutes can only be represented in one way in Cumulus MX.


NB This table shows time of extremes for two daily figures (highest minimum/lowest maximum temperatures as of course these are actually associated with a particular time although a standard web tag was not provided for that), by including Cumulus time modifiers, and how minutes in time modifiers can be specified in two ways in Cumulus 1 but only in one way in Cumulus MX.
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,768: Line 1,816:


==Yearly==
==Yearly==
This table shows the web tags used on the "thisyearT.htm" web page, the rainfall this season (it need not start on 1 January) does not appear on that page, it is shown on [[#Current_Conditions|indexT.htm]].
This table shows the web tags used on the "thisyearT.htm" web page, and the '''records.html''' page (accessed by final tab) in the admin interface.
 
Because the rainfall this year does not appear on '''thisyearT.htm''' web page, it is shown in [[#Current_Conditions|indexT.htm]] table earlier in this article which is for the web page where it does appear.


The default format for web tags in the date column is (like the monthly web tags) "dd MMMM" (same for Cumulus 1 and Cumulus MX), this can be changed using the [[#Time.2FDate_.27format.27_Parameter|format parameters]] described above. For web tags that represent daily values, there are (obviously) no corresponding time web tags, but for high and low spot values the default 'h:mm' format of the time output can be changed using output parameters.
The web tags in the date column output dates in the format "dd MMMM" (for once this is same for Cumulus 1 and Cumulus MX). Should you require a different output format, this can be changed using the [[#Time.2FDate_.27format.27_Parameter|format parameters]] described above. For web tags that represent daily values, there are (obviously) no corresponding time web tags, but for high and low spot values the default 'h:mm' format of the time output can be changed using output parameters. Do make sure that you get the web tag names right and the output form at parameters right.


NB Year runs from roll-over time on 1 January for all web tags listed here
As another example of inconsistency in how web tags added in different versions are coded, there are two web tags (highest minimum/lowest maximum temperatures) where a standard web tag is not provided by Cumulus (1 or MX) for the associated time-stamp. Consequently, for these 2 (and their corresponding tags in the this month group), there are mandatory output parameters required as shown in the table. Obviously Cumulus 1 lets you use "NN", "nn", "MM", or "mm" for the minutes, but minutes can only be represented in one way in Cumulus MX.
 
Remember that the Year-to-date runs from roll-over time on 1 January for all web tags listed here. Although, some web tags represent seasonal derivatives, i.e. where you define the month from which they start counting, this does not apply to any listed in this group.




Line 1,779: Line 1,831:
!style="width:150px"|Web tag_name
!style="width:150px"|Web tag_name
!style="width:300px"|Function
!style="width:300px"|Function
!style="width:150px"|Time
!style="width:350px"|Time
!style="width:150px"|Date
!style="width:150px"|Date
|-
|-
Line 1,846: Line 1,898:
|<#YearMinTempH>
|<#YearMinTempH>
|This years highest daily minimum temperature
|This years highest daily minimum temperature
|<#YearMinTempHD format=HH:nn> for Cumulus 1, <#YearMinTempHD format=HH:mm> for Cumulus MX
|Flavour specific mandatory output parameters:
* <#YearMinTempHD format=HH:nn> ''for Cumulus 1'',
* <#YearMinTempHD format=HH:mm> ''for Cumulus MX''
|<#YearMinTempHD>
|<#YearMinTempHD>
|-
|-
|<#YearMaxTempL>
|<#YearMaxTempL>
|This years lowest daily maximum temperature
|This years lowest daily maximum temperature
|<#YearMaxTempHD format=HH:nn> for Cumulus 1, <#YearMaxTempHD format=HH:mm> for Cumulus MX
|Flavour specific mandatory output parameters:
* <#YearMaxTempHD format=HH:nn> ''for Cumulus 1'',
* <#YearMaxTempHD format=HH:mm> ''for Cumulus MX''
 
|<#YearMaxTempLD>
|<#YearMaxTempLD>
|-
|-
Line 1,927: Line 1,984:


==All Time==
==All Time==
The web tags in the date/time column have the default format seen on "records.htm". So for an extreme month it just shows the month name in full i.e. format 'MMMM'. For an extreme day it shows the day of the month and the month name in full i.e. format "dd MMMM" (same for Cumulus 1 and Cumulus MX), prefixed with the word 'on'. For the highest/lowest within a day in the year it shows both time and date adding the word "at" before the time, and the word 'on' before the date.


You can change the default output using the [[#Time.2FDate_.27format.27_Parameter|formats features described above, but this can involve complicated use of single and double quotes and there are differences between Cumulus 1 and Cumulus MX.
The web tags in the date/time column have the default format as seen on "records.htm" in the standard web pages.
 
These are also available in the admin interface on "records.html" where they appear in the first tab, although the format used there is different and not able to be edited (any time is shown after the date).
 
*The default format for an extreme month is to show the month name in full i.e. format 'MMMM' followed by the year in full.
*For an extreme day it shows the day of the month and the month name in full i.e. format "dd MMMM" (same for Cumulus 1 and Cumulus MX), prefixed with the word 'on' again ending with the year.
*For the highest/lowest within a day in the year it shows both time and date adding the word "at" before the time, and the word 'on' before the date (i.e. on the standard web page the time comes first, not as seen in admin interface).
 
You can change the default output on either the standard web template, or in your own file,  by using the [[#Time.2FDate_.27format.27_Parameter|formats features described above, but this can involve complicated use of single and double quotes and there are differences between Cumulus 1 and Cumulus MX. Please see examples section above for advice.
 
Note that unlike the this month and this year web tags, the time and the date are both included in the default format of the standard time-stamp web tags for the 'highest minimum' and 'lowest maximum' temperatures, yet another inconsistency!


Note that unlike the monthly web tags, the time is included in the default format of the standard web tags for the 'highest minimum' and 'lowest maximum'.
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
!style="width:150px" | Web tag_name
!style="width:150px" | Web tag_name
!style="width:300px" | Function
!style="width:400px" | Function
!style="width:150px" | Date/Time
!style="width:150px" | Date/Time
|-
|-
Line 2,001: Line 2,066:
|-
|-
|<#wchillH>
|<#wchillH>
|All time greatest wind chill (i.e. lowest temperature)  
|All time greatest wind chill (i.e. lowest temperature, but highest wind speed)  
|<#TwchillH>
|<#TwchillH>
|-
|-
Line 2,057: Line 2,122:
==Monthly All Time Records==
==Monthly All Time Records==


There are a set of tags for monthly all-time highs and lows, in other words the highest and lowest values for a particular month of the year. For example, the highest ever temperature in July. Each Value 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). For example, <#ByMonthTempH mon=7> will give you the highest ever temperature in July.  The corresponding date/time web tags are formatted like the all time records directly above this section.
There are a set of tags for monthly all-time highs and lows, in other words the highest and lowest values for a particular month of the year. To supply both optional input, and optional output 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.


If you don't supply a parameter (or supply an invalid value) the current month will be used. You can customise the date and time formats using the 'format' parameter on the web tag. To supply both input and output parameters, separate them with spaces, e.g. <#ByMonthTempHT mon=7 format=hh:nn>
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).  The corresponding date/time web tags are formatted like the all time records directly above this section. You can customise the date and time formats using the output  'format' parameter on the web tag.
 
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.




Line 2,065: Line 2,132:
|-
|-
!style="width:150px"|Web tag_name
!style="width:150px"|Web tag_name
!style="width:300px"|Function
!style="width:400px"|Function
!style="width:150px"|Date/Time
!style="width:150px"|Date/Time
|-
|-
Line 2,083: Line 2,150:
|-
|-
|<#ByMonthWChillL>
|<#ByMonthWChillL>
|Greatest wind chill (i.e. lowest temperature)
|Greatest wind chill (i.e. lowest temperature and highest wind speed)
|<#ByMonthWChillLT>
|<#ByMonthWChillLT>
|-
|-
Line 2,190: Line 2,257:
|-
|-
!style="width:150px" | Web tag_name
!style="width:150px" | Web tag_name
!style="width:600px" | Function
!style="width:900px" | Function
|-
|-
|<#sunrise>
|<#sunrise>
5,838

edits

Navigation menu