Cumulus 3 (MX) beta documentation and Webtags/Parameters (preserving history): Difference between pages
m (Text replacement - "[[Setting_up_Raspberry_Pi" to "[[MX_on_Linux") |
m (→Which tag names take date/time output formatting modifiers: add 'StormRainStart') |
||
| Line 1: | Line 1: | ||
{{Template:Version badge Mx}}{{Version badge 1}}This Wiki page applies to both flavours of Cumulus currently available. |
|||
=Intoduction= |
|||
=Introduction= |
|||
This page has been created to hold information that Steve Loft made available when in 2015 he first made Cumulus MX beta builds available to the minority who showed an interest in trying it out: |
|||
*In 2015, Cumulus 1 was still recommended for most users, and it would remain so for another couple of years. |
|||
*In 2017, the text, now on this page, was first put on another page in this Wiki. At that stage, MX was still in beta, and everything here applied to the latest build available. |
|||
*Most new Cumulus users, up to 2019, installed the original Cumulus. Relatively few new users adopted this MX beta, even when Mark Crossley first took over development and the original Cumulus was labelled as the legacy version by administrator Freddie. |
|||
*Up to mid-2020, '''there were many, many more people using Cumulus 1 than were using MX'''. |
|||
*In mid-2020, the trickle of migrations from Cumulus 1 to MX became a flood, because by then Mark Crossley had added a lot of extra functionality to MX that was missing from Steve Loft's beta builds that this page talks about. |
|||
This page is about parameters used for modifying Cumulus web tags. |
|||
A [[Cumulus template file|'''Cumulus Template File''']] is the name given by Steve Loft to any files that contain web tags. Each of those files need to be processed before they actually include values: |
|||
{{TOCright}} [[Category:Cumulus_MX]] |
|||
* MX avoids using these template files, the code itself internally generates most of the data files that are sent externally. |
|||
If you are using MX beta (versions 3.0.0 to 3.0.2), this page is for you. However, you will gain many benefits if you follow advice on [[Updating_MX_to_new_version]] page, as not only do newer builds have more functionality (including ability to correct errors e.g. in extreme records), but they also fix lots of bugs present in the software you are using. |
|||
* The legacy Cumulus 1 software, and MX releases up to release 3.9.7 - build 3107, used lots of template files (see [[Customised templates]]. |
|||
For Cumulus MX, there is still one Cumulus template file, the web tags that supply values to the various tables in the [[New Default Web Site Information|Default Web Site]] are stored in [[websitedataT.json]] file. Most of those web tags use the default output format, but a few use some of the [[#Output modification parameters]] listed below. To customise the default web site, you might want to edit '''websitedataT.json''', by using information found on this page. |
|||
This page may also be of historic interest to those wondering about Cumulus MX as originally developed by Steve Loft, before Mark Crossley took over development. |
|||
To set context, let us learn the terminology with cross-references to where those features are explained further. |
|||
Much of the content below is based on material that Steve Loft wrote in the Cumulus support forum when it was hosted by Steve (http://sandaysoft.com/forum/ is no longer available). Mark Crossley copied the material into the Cumulus Wiki (the page title was "Cumulus_MX" at the time), to ensure it was preserved, in the period between Steve Loft saying he would not host the Wiki and Support Forum any more (September 2018) and Ken True taking over the hosting of the Wiki (October 2018). At that stage, nobody had agreed to take over the Cumulus Support Forum and there was a danger that the information below would be lost. Around a month later, Neill Hosiene fixed some problems on the Sandaysoft host and subsequently he took over hosting of the forum, so you can now find the original content at [https://cumulus.hosiene.co.uk/viewforum.php?f=39 MX early builds support forum]. |
|||
==What is a web tag? == |
|||
Put simply, a [[Webtags|web tag]] is included in a [[Cumulus template file]] to indicate where Cumulus should insert values when it [[Customised_templates#What_is_meant_by_.27Cumulus_processes_templates.27|processes that template]] and produces an output file. |
|||
== Message from Steve Loft about who can use MX == |
|||
The output file can be: |
|||
Note: The graphs used in Cumulus MX are drawn using Highcharts and they are free for non-commercial use only, i.e. you may not use them on a company web site, see http://shop.highsoft.com/faq/non-commercial for clarification. '''For this reason, and others, use of Cumulus MX in a commercial environment is expressly forbidden.''' |
|||
* a [[Customised_templates#HTML_5_-_a_very_quick_guide_to_structure|web page]], |
|||
* a [[Php_webtags#Option_3:_JavaScript_Object_Notation|JavaScript Object Notation (.json) file]] |
|||
* a [[Feels_Like#HTML_code_to_translate_web_tags_to_JavaScript_variables_.28as_modified_for_additional_parameters.29|JavaScript file]], |
|||
* a [[PHP]] script file, or |
|||
* a [[Xml_webtags|eXtensible Mark-up Language (XML)]] file. |
|||
==General Format for Web Tags== |
|||
''Please include a link to the Highstock web site (as the supplied web page does) if you use the charts under the terms of the non-commercial licence.'' |
|||
In the position in the template file where Cumulus is to insert the relevant data, place a web tag in the '''general format''' specified here: |
|||
== Message from Steve Loft about documentation == |
|||
<code><#tag_name [optional input selection parameters] [optional output modification parameters]></code> |
|||
''The following was written by Steve Loft, on 2 January 2015, when he first made his MX beta available to Cumulus users.'' |
|||
==== Case sensitivity for tag names ==== |
|||
There's quite a lot to read before you start - please do read all of this page and all the references it mentions, most of it is very important. |
|||
The tag_name in the general format above is case sensitive, so please type the tag name exactly as shown in the tag name columns in the tables on the [[Webtags|tag names page]]. |
|||
If MX is your first encounter with Cumulus, you will be at a disadvantage regarding documentation of many of the features, while those who have previously been familiar with Cumulus 1 will find most aspects of MX easier to pick up. |
|||
== What is a web tag parameter?== |
|||
Note that most of the Cumulus 1 documentation also applies to Cumulus MX, so although [[FAQ|Frequently Asked Questions for Cumulus 1]] is specific to the original Cumulus software it might help you. Looking at the Cumulus 1 help file, it is available on the [[Software#Resources|Software Resources page]] will help you. If you already use Cumulus 1, the help is part of the standard installation. |
|||
Now we get to the terminology for what this Wiki page will document. |
|||
MX specific documentation, for this beta, is currently in very early stages (e.g. [[Cumulus MX FAQ|Frequently asked questions for MX]]) and some settings may not be obvious. Some of the articles elsewhere in this wiki will help, and will in due course be updated to cover MX. |
|||
The parameters shown in the general format above are of two kinds: |
|||
# Input modifying |
|||
# Output modifying |
|||
You can include both optional input modification, and optional output modification parameters |
|||
* As the general format above shows, you 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. |
|||
=== Case sensitivity for parameters === |
|||
The optional input modification parameters always use lower case, so please type them exactly as shown in the [[#Input modification Parameters|section below]]. |
|||
The content of optional output parameters are only case insensitive when used in Cumulus 1. |
|||
For Cumulus 2 and later, so this includes MX, the output parameters are case sensitive and also dependent on what other output formatters are being used if any, so please read the sections on output parameters and study the examples in the tables carefully. |
|||
= Input modification Parameters = |
|||
'''Most web tags do not require any input parameters'''. Luckily, where they are needed, it is quite simple to use them, see table below. |
|||
* 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 select the value you want to see. |
|||
* The web tags that can use input modification parameters will depend on which Cumulus release you are using |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:15px" | Tag names |
|||
!style="width:100px" | Values Available |
|||
!style="width:200px" | Input Modification Parameters |
|||
!style="width:60px" | Introduced |
|||
!style="width:500px" | Examples |
|||
!style="width:900px" | Description |
|||
|- |
|||
! scope="row"| Tag names listed at [[Webtags#Table of Recent History tag names available|'''Table of Recent History tag names available''']] (see [[Recent history]] page for explanation) |
|||
| 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 (remain available in MX) |
|||
| 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. |
|||
* <#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. |
|||
* '''Beware: If you use <code><#RecentRainToday d=2></code> remember that rainfall can accumulate during a day, so "d=2" returns an estimate of the rain between rollover 2 days ago and the same time as now 48 hours ago, it does not return the total rainfall 2 days 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. |
|||
|- |
|||
! scope="row"| [[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 (remain available in MX) |
|||
| <#ByMonthDewPointH mon=3> is highest monthly dew point for any March and <#ByMonthDewPointHT mon=3> is the related time and date. |
|||
<#ByMonthTempH mon=3> gives highest temperature in any March, <#ByMonthTempHT mon=3> gives the date and time for that highest temperature |
|||
| Only one input parameter applies: |
|||
* The value of "N" supplied should be an integer between 1 and 12 |
|||
* If you don't supply an input parameter (or supply an invalid value like zero) the current month will be used. |
|||
Use without an input parameter applies 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. |
|||
|- |
|||
! scope="row"| [[Webtags#Monthly|Only <#SunshineHoursMonth>]] and [[webtags#Yearly|Only <#SunshineHoursYear>]] |
|||
| Values available for current month/year, and for past month/year |
|||
| Listed web tags take: '''r=-ww''' (note minus sign and up to 2 digits) |
|||
* Monthly tags also take: '''m=N y=nnnn''' ('''N''' can be 1 to 12, ''nnnn'' is 4 digit year) |
|||
* Yearly tags also take: '''y=nnnn''' |
|||
Omit input modification parameter to get value for current month/year |
|||
| MX release 3.12.0 |
|||
| Monthly examples: |
|||
* <#SunshineHoursMonth> gives total sunshine hours since 1 minute past midnight at start of current month |
|||
* <#SunshineHoursMonth y=2021 m=1> for the January 2021 total |
|||
* <#SunshineHoursMonth r=-1> for last month's total |
|||
* <#SunshineHoursMonth r=-12> for same month as current month, but one year ago |
|||
Yearly examples: |
|||
* <#SunshineHoursYear> gives total sunshine hours since 1 minute past midnight on New Year's Day |
|||
* <#SunshineHoursYear y=2019> for the total for 2019 |
|||
* <#SunshineHoursYear r=-2> total for the year before last (if current year is 2021, that returns total for 2019 as previous example) |
|||
| Returns the sunshine hours total in selected period |
|||
(You need a sensor to be monitoring this throughout selected period) |
|||
|} |
|||
= Output modification parameters = |
|||
This page does not tell you which web tags fall into each of these 3 types: |
|||
* A few web tags always need an output format specifier |
|||
* Some web tags ignore any output format specifier as they have a fixed output format |
|||
* The majority of web tags have a default output if there is no output format modifier, but accept an output format parameter, so you can change what they output. |
|||
To make life more complicated, the availability of output format parameters for particular web tags is dependent on which Cumulus release you are running. There is a general [[Webtag_Applicability|discussion about applicability]], but that needs updating as it does not specify dependencies for individual [[Webtags|web tags]]. |
|||
If you are using MX: |
|||
* if your locale specifies that integer and decimal parts of real numbers are separated by a comma, there is an output parameter to replace that decimal comma by a decimal point for any script that does not recognise decimal commas |
|||
* there are two output modifiers for changing number of decimal places |
|||
* there are multiple output modifiers for changing date and/or time format |
|||
If you are using the legacy Cumulus (or a very early MX release), please skip to [[#Two Output (format modifier) parameters for decimal places]] as the changing decimal comma into decimal point parameter is not available to you. |
|||
Each of these will be explained in turn. |
|||
==Output Modification Parameter for changing any decimal comma into a decimal point== |
|||
General format: <tt><#tag_name rc=y></tt> |
|||
This only applies: |
|||
*if the web tag name represents a real number with integer and decimal parts |
|||
*if you are using MX |
|||
**From beta release 3.0.0, build 3047 (3 February 2019), up to and including release 3.5.3, only implemented on a few new web tags (#MoonPercent, #MoonPercentAbs, #MoonAge) |
|||
**From release 3.6.6 onwards (1 June 2020), it was extended to other web tags that output real numbers. |
|||
**From release 3.10.5 onwards (29 March 2021), the use of <tt><#tag_name rc=n></tt> became also possible, to ensure decimal comma shown when locale specifies it |
|||
This output modification format parameter can be used 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). |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:150px" | Parameter |
|||
!style="width:600px" | Explanation |
|||
!style="width:600px" | Example |
|||
|- |
|||
|rc=n |
|||
|This is the default, so does not need to be specified. The output from the web tag will use either decimal comma or decimal point as specified by the locale in which MX is running |
|||
For more information about how the computer determines whether decimal commas is your default, see [[#Locale]] section later. |
|||
| Both <#tempYH> and <#tempYH rc=n> will return yesterday's highest temperature using what is specified by locale to separate integer and decimal parts |
|||
|- |
|||
|rc=y |
|||
|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. |
|||
| <#tempYH rc=y> will return yesterday's highest temperature as integer part then full stop then decimal part, regardless of local |
|||
|} |
|||
'''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). |
|||
==Controlling the number of decimal places== |
|||
Internally, Cumulus stores numbers in binary. You cannot represent base 10 decimal places exactly in base 2. |
|||
Therefore, Cumulus stores to a precision that would generally give about 24 significant figures when expressed in base 10. |
|||
Cumulus is written to assign particular numbers of decimal places to any outputs it makes, and in any logging of current, or extreme values (for day or longer periods). It determines these precisions, by reference to the units chosen for outputs. |
|||
From release 3.12.0, you can set the default number of decimal places to output for all derivatives of temperature, pressure, etc. by [[Cumulus.ini#Units.2C_Derivative_Options.2C_and_Decimal_Places|advanced settings]]. Those settings can force output as integers, stopping these modification parameters from working. |
|||
As handling of each web tag is coded individually, the number of decimal places output by default in any web tag might vary slightly from the above default. As Cumulus has been developed, people have commented that these defaults do not reflect the precision of their instrumentation (weather stations used with Cumulus tend not to have the accuracy of those used by meteorologists, or are not recalibrated as often). |
|||
This section (and its subsections) only applies to tag names that output real numbers (with integer and decimal parts). You can't change anything that is output as an integer, or is text with these parameters, nor can you change the decimal places for any time element. |
|||
Consequently, gradually Cumulus has allowed more and more of its output to take an output format modifier that allows people to control number of decimal places shown. |
|||
===Two Output (format modifier) parameters for decimal places=== |
|||
From release 3.10.5 (which did a big rewrite of web tag handling), you can modify real number output for individual tag names, using output modification parameters in either of the following formats: |
|||
* <tt><#tag_name dp=i></tt> and |
|||
* <tt><#tag_name tc=y></tt> |
|||
These can be applied to any tag names that represent real numbers (with integer and decimal parts). |
|||
====Rounding to a specific number of decimal places==== |
|||
<tt>dp=i</tt> is used for both Cumulus 1 and MX. |
|||
*The value '''i''' following the attribute '''dp''' is an integer, it represents how many decimal places you want for the output you see. |
|||
This functionality was trialled in the original Cumulus, but has been properly implemented in MX. |
|||
If you are using the legacy Cumulus (1.9.4), only <tt><#latitude dp=i></tt> and <tt><#longitude dp=i></tt> were able to be output with "i" denoting number of decimal places, e.g. <#latitude dp=5> gives "59.24250". |
|||
If you are not using latest MX release, you may find this is not available for particular web tag names |
|||
# From beta releases (3.0.0) onwards, <tt><#latitude dp=i></tt> and <tt><#longitude dp=i></tt> were able to be output with "i" decimal places |
|||
#* But this output modification parameter could not be applied to any other tags in the MX beta. |
|||
# MX when it came out of beta, added this output modification parameter usage in the moon tags <#MoonPercent> and <#MoonPercentAbs>). |
|||
#* Specifically, <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234" |
|||
====Truncation of unwanted decimal places==== |
|||
=== Message about this update to documentation === |
|||
This output format modifier is only available in MX. |
|||
Although the message above from Steve Loft has been retained, it is no longer really true. When that was written MX had only been worked on for a year or so. During that time it had been only available to people who had specifically requested for a copy of the package, and been subsequently provided with it. After that, the beta testing package became available at a download site where anyone could get it. |
|||
<tt>tc=y</tt> is the truncation parameter, the attribute '''tc''' takes the value 'y' to remove decimal places by truncation. e.g. <#MoonAge tc=y>. |
|||
Since then, of course MX has come out of beta and added a lot more functionality. More importantly, it has gained a large user base (although Cumulus 1 is still used by considerably more people than MX, there has been a recent surge of converts), and that means it is much better known, and consequently it is possible now to document it much better. You will now (January 2021) find there is extensive MX (out of beta) documentation available from [[:Category:Cumulus_MX|this Wiki]]. |
|||
Whilst many people want Cumulus to round output as done by the previous parameters, there are circumstances when rounding down (or truncation) gives the result desired. |
|||
* If you are using an early release of MX, you will need to research whether this is available for particular tag names |
|||
* Later releases of MX implement this for any tag that by default outputs decimal places. |
|||
Note, truncation by MX converts real numbers to integers. There is no option to truncate to one decimal place, Airports are expected to report air field level (QFE), and sea level (QNH), pressures truncated to one decimal place rather than rounded. |
|||
== Multiple Output Format Modifier parameters for times and dates == |
|||
= Executables = |
|||
These are highly complicated, and so have been left until after the simpler ones! |
|||
The MX package, at time of typing this, includes two executables: |
|||
To start with a simple example, suppose you want date/time in ISO 8601 format: |
|||
== CumulusMX.exe == |
|||
# This means, something like ''2019-02-28 06:59:05''. |
|||
# Take the tag name (from tables on [[Webtags]] page) |
|||
# Next check in [[#Which tag names take date/time output formatting modifiers]] to see if that tag accepts both time and date modifiers |
|||
# If our tag name does accept both date and time modifiers, simply modify the web tag as shown here <code><#tag_name format="yyyy-MM-dd HH:mm:ss"></code> where tag_name is set from step 1, but all the rest is typed as shown. |
|||
# To explain each element in that format value, look in [[#Year formats]], [[#Month formats]], [[#Day formats]], [[#Use of spaces]], [[#Time formats]]. |
|||
Should you want a different date/time format, then the sub-sections just referenced should help you to select a different arrangement, although there are some more options in [[#Date formats]]. |
|||
Whilst effectively MX is run by a '''CumulusMX.exe''' or '''sudo mono CumulusMX.exe''' depending on device, you actually need to ensure all the other components are loaded, so you either have a package that runs it for you, or you click a shortcut that includes the necessary path setting. |
|||
===Which tag names take date/time output formatting modifiers=== |
|||
=== Optional parameters to add to the instruction to run the MX engine === |
|||
There are nearly a thousand different tag names. |
|||
Beta builds in MX version 3.0.0 had an optional parameter <tt>-wsport nnnn</tt> that determined which port (represented by a 4 digit number ''nnnn'') was used for '''WebSockets'''. That parameter is now deprecated as WebSockets in all builds since 3045 uses the same port as the rest of the [[MX_Administrative_Interface#The_API_interface|Admin Interface]]. The remaining parameters that are still available are described in subsequent sub-sections. |
|||
There are a few time-related tag names labelled as being fixed format, that means any time/date output modifiers you might try would be ignored. |
|||
==== Parameter for changing Port ==== |
|||
Some tag names, although it can be hard to tell which, report durations. You can use time modifiers to change how these are reported. Examples include '''<#daylength format=H:mm:ss>''' and '''<#MonthDailyRainHD format=H:mm>'''. |
|||
When Cumulus starts, it will display the URL of the user interface. It runs on port 8998 by default; if this is not suitable for some reason you can over-ride it using the '-port' parameter on the command line, e.g. to use port 9999 instead: |
|||
<pre>sudo mono CumulusMX.exe -port 9999</pre> |
|||
Time modifiers can also be used to change the way that clock times are reported, you might only want the hour, or you might (if resolution is available) want to also see seconds. The [[webtags]] page has columns headed "Time" to clearly identify all tag names that report clock times. |
|||
==== Parameter for adding debugging ==== |
|||
There are some tag names (e.g. moon rise) that relate to an event that does not happen each Earth day, so those tags have to be able to report "--:--", and you cannot modify their output. |
|||
MX has a default level of logging that stores in the [[MXDiags_folder_folder]] a log file that shows some of the interaction with the weather station and some of the output actions done as MX runs. A new log is started each time MX is restarted. |
|||
There are some tags (e.g. highest temperature range in month/year), for which Cumulus has been coded to report "--" for value, and "--:--" for time, on the first day of that period (because there is only a partial day to consider you might not yet have experienced a true maximum and a true minimum), so modifying the time output can only be done on subsequent days. |
|||
If there is a problem, then there is a great benefit in actually increasing the level of detail in these logs; and that is done either within the settings ('''options''' section of ''station settings'') in admin interface while MX is running, or by adding 1 or 2 parameters when you start MX. Obviously this log file continues to grow, the longer MX is left running, and if debugging is switched on the file will grow in size must faster. Consequently, the default is not to add the extra debugging information and the settings can be used to switch it off again if you do have it switched on. Whether you start it with a parameter or enable it within settings, stopping MX will end the extra debugging, and on restart it will default back to no debugging unless turned on again with parameter or setting. |
|||
It is not practical to indicate which time/date modifiers are accepted on a tag by tag basis. It would involve a lot of repetition. Instead, the following table, explains much more simply, which web tags will accept time and/or date output modifiers: |
|||
You can also add '''CumulusMX.exe -debug''' (to have full debugging of actions by MX turned on as MX starts), and/or '''CumulusMX.exe -Logging=1''' (for the station to MX transfers to have increased debugging logging). |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:100px" | Cross-reference to table on web tag names page |
|||
!style="width:300px" | Tag names that accept only time output modifiers |
|||
!style="width:300px" | Tag names that accept only date output modifiers |
|||
!style="width:300px" | Tag names that accept both time and date output modifiers |
|||
|- |
|||
|- |
|||
! scope="row"| Any tag names that don't report times nor dates |
|||
| None |
|||
| None |
|||
| None |
|||
|- |
|||
! scope="row"| [[Webtags#No_Commas]] |
|||
| None |
|||
| None |
|||
| None |
|||
|- |
|||
! scope="row"| [[Webtags#Date_.26_Time]], [[Webtags#Day/Night/Sun/Moon]] |
|||
| Only <#timehhmmss>, <#minute>, <#hour>, <#sunrise>, <#sunset>, <#dawn>, <#dusk> |
|||
| Only <#LatestErrorDate>, <#date> (but no others) |
|||
| Only <#LastDataReadT>, <#time>, <#metdate>, <#metdateyesterday>, <#update>, <#LastDataReadT> |
|||
|- |
|||
! scope="row"| [[Webtags#Today]], [[Webtags#Yesterday]] |
|||
| Any tag name in "Time" column of linked table |
|||
| None |
|||
| None |
|||
|- |
|||
! scope="row"| [[Webtags#Monthly]], [[Webtags#Yearly]] |
|||
| Any tag name in "Time" column of linked table in first column |
|||
| Any tag name in "Date" column of linked table in first column |
|||
| None of the tag names. For explanation see the ^ below this table |
|||
|- |
|||
! scope="row"| [[Webtags#All_Time]], [[Webtags#Monthly_All_Time_Records]] |
|||
| None (all tag names combine both time and date) |
|||
| None (all tag names combine both time and date) |
|||
| Any tag name in "Date/Time" column of linked table |
|||
|- |
|||
! scope="row"| [[Webtags#Davis]] |
|||
| None |
|||
| <#StormRainStart> only |
|||
| None |
|||
|} |
|||
^ For the monthly and yearly web tags, the date and time are in separate tag names. It is not possible to get both time and date out of either tag name. |
|||
Note: There are some monthly/yearly web tags (e.g. wettest day) where a date tag is available (i.e. <#MonthDailyRainHD>), but there is no time tag. As explained before, in that wettest day example '''<#MonthDailyRainHD format=H:mm>''' returns the duration in hours and minutes since rollover for which rain continued to increase on that date, not the clock time. For rainfall, only '''<#LastRainTip>''' can have output modifiers added to report a clock time. |
|||
<pre>sudo mono CumulusMX.exe -debug -Logging=1</pre> |
|||
===Locales=== |
|||
Since this parameter is applied when you start MX, it applies while MX continues to run. Obviously, it must be applied every time you start MX if you want this increased level of logging to continue every time you restart MX. |
|||
The default format for many tag names reporting date and/or time is dependent on the locale you are using for running Cumulus (1 or MX). |
|||
The comments in the MX source suggests -debug turns on both debug and data logging (see [[MX_Administrative_Interface#Options|Station_Settings#Options]] in admin interface settings), but I believe that is wrong as per example above, there are 2 separate parameters. |
|||
The effect of some output format modifiers is also dependent on locale. |
|||
==== Parameter for changing Locale ==== |
|||
For MX running on most operating systems (and therefore using Mono), type <code>locale</code> to see the default locale that will be adopted when mono-complete is installed as MX will, by default, take locale setting from Mono. When you start MX, you can ask it to use a different locale to that picked up by Mono, by adding the parameter "-lang locale-code", see examples at [[MX_on_Linux#Parameter_for_changing_Locale]]. For example, the Australian English language with UTF-8 encoding locale is defined as: en_AU.UTF-8. |
|||
<pre> |
|||
sudo mono CumulusMX.exe -lang en-GB |
|||
</pre> |
|||
Other local examples: '''CumulusMX.exe Current culture: English (United States)''', '''CumulusMX.exe -lang de-DE''', '''CumulusMX.exe -lang el-GR''' (this is one of the locales that reads numbers with '''integer,decimal''' format), '''CumulusMX.exe -lang nl-NL'''. |
|||
The available locales on your computer in Linux are listed by <code>locale -a</code>. For example, the Russian locale would be selected as the one your computer uses ''for the current session only'' by using <code>LANG=ru_RU.utf8</code> either typed into a terminal session before you start MX, or used as a parameter (preceded by "-") as you start MX interactively. |
|||
If you are not sure what value you need to supply for the -lang parameter, there is a list here - http://msdn.microsoft.com/en-gb/library/ee825488%28v=cs.20%29.aspx. You need to supply the code in the first column ("Language Culture Name") in that list. |
|||
For permanently changing the locale used by your system, the instructions vary considerably according to the kernel used in your operating system, so you need to look up the instructions for yourself. However, if you have a graphical user interface, such as the full Raspberry Pi Operating System provides, you might have a configuration command in terminal mode and a configuration app accessed (within ''Preferences'') from the "Raspberry" key on the official keyboard. For the Raspberry Pi, please read [[Raspberry Pi computer page]] for more details. |
|||
Note that this does not affect the language used by Cumulus MX (although it may in the future), it affects the decimal separator and the list separator. |
|||
For Microsoft Windows Operating Systems, a Language is defined within the "Region" page of the Settings app. That should be sufficient for the legacy software that uses Delphi. |
|||
Note that you ''may'' need to supply your administrator password after typing the 'sudo ...' command line. The system will prompt you for this if it is needed. |
|||
However for MX date and time formats within Windows Operating System, you must use the older '''Control Panel''' (go to "Clock and Region" screen, choose "Change date, time or number formats", choose "Language preferences") because it is only there that you can adjust all the defaults used by .NET. |
|||
== [[ExportMySQL.exe]] == |
|||
===Time zones=== |
|||
This second exe file (see link in heading) has been available since the original MX package as Steve Loft developed this in April 2015, but sadly few people even notice it exists, and if they do, it is unlikely they know how to use it. Hopefully, some people will read this section and find out! |
|||
Before I explain what time/date output modifiers can do, something they can't do. |
|||
Obviously it was updated when Mark Crossley added the Feels Like fields to log files. |
|||
All web tag outputs are in local time, except '''<#timeUTC>'''. |
|||
Put simply, this executable will read log files and insert (insert ignore) rows into an existing database table. Since it only does inserts, despite the name of this function, it is not just for MySQL tables, the included SQL should work with whatever database table type you have. |
|||
Although Cumulus 2 internally stored all date/times in UTC, no flavour of Cumulus is currently able to output the time-stamp for any weather extreme in UTC, if your current time is not in UTC. |
|||
The executable has a mandatory single parameter that tells it which log files to read, there are only 3 possible parameters ("dayfile", "monthly", or path to a file). It needs to know what locale (or culture settings) it is to use to work out what character separates each item in the log file list. It also needs to read your Cumulus.ini file, as it takes these "input parameters" from MySQL section in that: |
|||
*Host |
|||
*Port |
|||
*User |
|||
*Pass |
|||
*Database |
|||
*MonthlyTable |
|||
*DayfileTable |
|||
However, for MX only, you can use a script to convert a time to UTC. This is not the place to tell you how to write the script, but taking time of highest pressure today as an example, you would use <#TpressTH format=Hh:mm> and <#TpressTH format=zzz>, the first gives hours and minutes in your local time, and the second gives the offset that needs to be applied to that time to convert it to UTC. |
|||
=== Daily summary log file === |
|||
===Time resolution=== |
|||
# Use the feature in the admin interface: |
|||
#* Settings menu |
|||
#* MySQL settings page |
|||
#* In '''Dayfile.txt upload''' section, give your database table a name, or accept default ''Dayfile''. |
|||
#* Click '''Save''' to ensure this setting is updated |
|||
# Now scroll down to '''Create database table (save settings first)''' |
|||
#* Here click '''Create Dayfile''' |
|||
# Now you have a database table ready, you can use the executable to read all lines in your '''CumulusMX/data/dayfile.txt''' log file. |
|||
# Open a terminal display (if you are using Windows then, open a Command Window, a Windows Powershell window, or a Windows Terminal window) |
|||
# Run this executable in that terminal display (or command window) by using '''sudo mono ExportMySql.exe daily''' or <tt>ExportMySql.exe daily</tt> depending on device. |
|||
# In the terminal display (or command window) you will see '''Parameter = daily''' confirming what you entered and in the line below that a rapidly updating code that is the primary key displayed for each row it tries to insert into the table. If that primary key already exists in the table, it will still show the key, but no insert will take place. |
|||
#If you want MX to continue adding new rows to this database table, still in the admin interface, still in MySQL settings page: |
|||
#* Return to '''Dayfile.txt upload''' section, and select '''Enable'''. |
|||
For the legacy software, there may be no point in asking for seconds, as Cumulus 1 did some actions at one minute intervals. |
|||
=== Standard Log files === |
|||
If Cumulus obtained archive data, as part of the catch-up process it can do when it restarts, any time-stamps for that period can only be the time of a particular archive record, so that might be every half an hour, but not aligned precisely with hour changes. |
|||
# Use the feature in the admin interface: |
|||
#* Settings menu |
|||
#* MySQL settings page |
|||
#* In '''Monthly log file upload''' section, give your database table a name, or accept default ''Monthly''. |
|||
#* Click '''Save''' to ensure this setting is updated |
|||
# Now scroll down to '''Create database table (save settings first)''' |
|||
#* Here click '''Create Monthly''' |
|||
#If you want MX to continue adding new rows to this database table, still in the admin interface, still in MySQL settings page: |
|||
#* In the same '''Monthly log file upload''' section, now select '''Enable'''. |
|||
# Now you have a database table ready, you can use the executable to read all lines in either one (if path to that file is in parameter), or every (if parameter is monthly) standard log file. |
|||
#*If the parameter is "monthly" it will look in folder '''data''' for every file it can find with a file name of datestring + "log.txt" where datestring is a 3 letter code (in your locale) for each month (1 to 12) followed by a 2 digit year (from "00" to "99") so that is how it finds every standard log file in the folder. |
|||
# Open a terminal display (if you are using Windows then, open a Command Window, a Windows Powershell window, or a Windows Terminal window) |
|||
# Run this executable in that terminal display (or command window) by using '''sudo mono ExportMySql.exe monthly''' or <tt>ExportMySql.exe monthly</tt> depending on device. |
|||
#* Alternatively, replace '''monthly''' parameter by a full path to a single standard log file, and it will process just that log file. |
|||
# In the terminal display (or command window) you will see '''Parameter = monthly''' confirming what you entered and in the line below that a rapidly updating code that is the primary key (omitting the first two digits of the year) displayed for each row it tries to insert into the table. If that primary key already exists in the table, it will still show the key, but no insert will take place. So you can run this again to pick up any additions to the latest log file since the original run. Also notice that if you use the parameter "monthly" the order in which it will process different standard log files is not predicable, they probably will not be in any particular order, but as one feature of SQL databases is that the row order is not able to be determined, it does not matter if rows are not added in chronological order. |
|||
#* It is worth noting that it is safe to run this procedure while MX is also running, because this procedure only updates log entries that exist as this procedure reads the logs, and MX only adds new entries to the log and at the same time uploads that new entry (if enabled) to the database table. |
|||
===Dependency on Cumulus flavour=== |
|||
Please be aware that the transfer to the database table adds two columns where bearings in the original log file given in degrees are output as compass directions, and these use up to 3 letters of how the compass directions are defined in the '''strings.ini''' file. Thus the number of columns in the database table will be at least 2 more than the number of fields in the log files. It is also important to stress that whilst the database table must contain one column defined for each field (plus the extra 2) being uploaded, you can add even more columns to your table if you want and populate those some other way. For example, I have added a Canadian Humidity Index (Humidex) column which is not in the standard logs, but is calculated by Cumulus, and can be calculated from columns that are uploaded from the standard log. Humidex is not uploaded by either ExportMySQL or the normal CumulusMX process, but neither objects to extra columns being there. |
|||
You cannot,in general, use the same date/time formatting for both the original (legacy) Cumulus and MX. |
|||
When testing this, I had some log files produced by various old versions of Cumulus 1 in my MX data folder as well as the log files in has generated since I swapped to MX. Plus I had used a PHP script to add feels like to those log files produced before version 3.6.0 and to correct feels like for those log entries made by versions 3.6.0 to 3.6.9 inclusive because they used a different formula to the one being used from version 3.6.10. This php script is a web page with a HTML form and can be obtained from the forum in [https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=18096 Create Missing for MX] |
|||
All the tables explaining what is available, attempt to show what is used in each flavour for each type of output, both by including separate columns for each flavour, and by giving examples in each flavour. |
|||
I notice that the database rows produced by those short log file lines produced by say version 1.9.0 had nulls entered for all subsequent columns, except '''Feels Like''' and this column was initialised at 0.0! |
|||
====For the legacy software==== |
|||
For those log files produced by the final version 1.9.4, all columns are populated although feels like is set to 0.0. |
|||
I deal with this first, just because it is simple! |
|||
From version 1.9.1, most web-tags that report any form of time or date will accept an optional 'output format' parameter (we have already seen whether this can only affect time, only affect date, or both). |
|||
The legacy Cumulus uses Delphi to interpret the output modifiers: |
|||
= SPECIAL CONSIDERATIONS - Text by Steve Loft = |
|||
*For most modifiers, a particular character produces the same output regardless whether the output modification specifier is in capitals or lower-case |
|||
**There is an exception, the case you use for any am/pm output format modifiers determines the case that is output. |
|||
*In general, the context of a modifier does not affect the output it produces |
|||
**Again, there is an exception, "m" or "M" has two different meanings (minutes or month) depending on context. |
|||
====The complications with MX==== |
|||
== Restrictions in MX for decimal separators == |
|||
Cumulus MX works '''internally''' with dates specified in either a day before month before year format, or ISO 8601 date format where year comes first (yyyy-MM-dd) depending on context. Compatibility with the legacy software has so far meant while the [[:Category:Ini Files|*.ini Files]] have adopted the year first approach, the [[:Category:MX txt Files|*.txt Files]] have stuck to date formats as used in the legacy definitions. |
|||
On the subject of decimal and list separators, there are a couple of issues which users of decimal commas may encounter. |
|||
#The first is that there may be an issue with some of the user interface not working correctly. Please report these issues and I will fix them. There may be aspects of the displays that I cannot change (because the package used does not support decimal commas) but it should be possible to at least get it working. |
|||
#The second issue with decimal separators only affects the Raspberry Pi (as far as I am aware). There is apparently an issue with a version (3.2.8) of the Mono package on Raspbian 'hard float' where it cannot parse values using decimal commas. If this does turn out to be an issue, there are a number of possible workarounds until the Raspbian package gets updated. One workaround is to use the 'soft float' version of Debian instead. Obviously, this will have performance issues, but is probably the easiest. The second workaround is to build Mono from the latest sources, see http://www.mono-project.com/docs/compiling-mono/linux/. I am told that this fixes the problem. Another possible workaround would be to find an already fixed binary package, but I don't know if one currently exists. |
|||
For Cumulus MX output formatting, the date and time modifiers are complicated by the fact that the same character can have 4 different meanings depending on its case (capital letter or lower-case letter), and depending on whether it is on its own (standard format) or with another modifer (custom format). '''Sounds confusing?''' Well it is complicated. |
|||
''PLEASE NOTE: The issues that Steve describes seem to have gone away with currently available versions of Mono; update your Mono if you are using an old version and encounter problems.'' Like any software, Mono might have bugs at a particular version, and sometimes you might need to swap to an older version if the current version has an outstanding issue. |
|||
Consider context first: |
|||
== If you want to use your Cumulus 1 data with MX == |
|||
*<tt><#tag_name format=x></tt> |
|||
**If the '''x''' in the above general syntax is a single character, it represents a standard format code |
|||
**The standard characters for dates and times are defined at [https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings standard-date-and-time-format-strings] |
|||
*<tt><#tag_name format=xyz></tt> |
|||
**If the '''xyz''' in the above general syntax is replaced by two or more characters, it becomes a custom format code (combinations of characters, or single characters prefixed by %) |
|||
**The custom characters for dates and times are defined at [https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings custom-date-and-time-format-strings] |
|||
Consider case next: |
|||
If you use decimal commas in your Cumulus 1 data, you will need to edit the .ini files to change the decimal commas into periods/full stops, because '''Cumulus MX always expects periods/full stops in .ini files''' ''regardless of the locale in use''. The other data files will be OK - assuming you are using the same decimal and list separators in MX as you used in Cumulus 1 (i.e. the same locale). If you try to switch to a different locale, then your data log files will of course no longer be in the correct format, so you would need to edit all of your files. You can select the locale for MX to use as a switch parameter when it starts up, see earlier on this page. |
|||
*Cumulus MX (when running on Windows) uses the '''.NET''' software which is provided as standard by Microsoft Windows. |
|||
**".NET" was originally operating system independent, later only Microsoft Windows specific components were included, but since November 2020 ".Net" is used for an operating system independent version that originally Microsoft issued under another name! |
|||
**(actually it is possible to install and run "Mono" in Windows Operating Systems). |
|||
*If Cumulus MX is running on any Linux distribution (including Raspberry Pi Operating Systems) or Mac OS X, or any other device that uses an UNIX derived operating system, then MX uses '''Mono''' software for same purposes. (MONO is a operating system independent version of .NET, although they are developed independently, they have common origins). |
|||
===Use of spaces=== |
|||
== A note to Davis owners == |
|||
There are multiple symbols for specifying dates and times, and you might want spaces to appear between symbols in that output format. |
|||
I am experimenting with the use of the LOOP2 packet. The current code uses this for two purposes. First, it uses the 'peak 10-minute gust' value, to avoid the problem where a gust might be missed (although hopefully this will not be such an issue with Cumulus MX as it does not use the Davis DLL), and secondly it uses the 'absolute pressure' value to make calculation of 'altimeter pressure' easier and more accurate. This is mainly used if you upload to CWOP. |
|||
You need to add quotation marks to the output format specifier if spaces are present. |
|||
The LOOP2 packet is supported on the VP2 with firmware version 1.90 or later, and on the Vue. If you have a Vantage Pro (i.e. the original 'VP1'), or a VP2 with pre-1.90 firmware, or if you are using Virtual VP, none of these support the LOOP2 packet. In these cases, you should edit cumulus.ini and add a line to the [Station] section: |
|||
The first complication is that the parser that interprets time/date characters has two ways of interpreting a space character, depending on what immediately follows. In the tables, below, I have used a "%" in various places. In any of those places, a space is not a gap between characters, but an alternative to "%". I discuss this later in [[#Migrating from legacy Cumulus 1 to MX]] section. |
|||
UseDavisLoop2=0 |
|||
For a space character to be interpreted as a gap between symbols, the symbol that follows the space must include at least two characters. The syntax <code><#tag_name format="x y z"></code> works if the y and z in it are representing multi-character symbols. To explain this, an example is '''<#TpressTH format="h:mm tt">''' as both ''h:mm'' and ''tt'' are multi-character symbols, we have inserted a space after the minutes. |
|||
With this setting, Cumulus will revert to calculating the 10-minute gust value itself from the individual wind speed readings, but it will not currently attempt to calculate altimeter pressure correctly, it will simply use the sea-level pressure instead. This is likely to be an issue if you are at high altitude and you upload to CWOP using Cumulus MX. |
|||
If we have single character specifiers, then a space has to be enclosed in single quotes to mark it as a literal, not a modification of the subsequent single character. To explain this, a simple example is '''<#MonthPressHD format=" d' 'M">''', here the month number is a single character "M", so to insert the space we have to treat it as a literal by enclosing the space character in single quotes and the whole specifier in double quotes. |
|||
Also for Davis stations, I have assumed that people using millimetres in Cumulus have a metric rain gauge (0.2 mm per tip), and those using inches have a 0.01" rain gauge. This can be over-ridden by adding a line to the [Station] section of Cumulus.ini: |
|||
Literals are discussed fully in the [[#Including literals in format parameters]] sub-section later. If we want to include other characters not to be interpreted by the date time parameter parser, and spaces, then both double and single quotes must be used, and the spaces must be within the single quotes. An example, that shows all the options that MX allows, with literals is <code> <#TpressH format="\a't 'h:mm' ' tt' <nowiki><small>on 'd/M/yyyy' </small></nowiki>'"> </code>. |
|||
VPrainGaugeType=0 |
|||
Finally, the use of literals can cause you ''a problem if you want to use a date/time specification in a script'' because the script wants literal delimiters outside any web tags, so that delimiters remain when the web tag itself has been processed into a string by Cumulus. This means the type of quotes (single or double) used outside the web tag, cannot be used within the web tag. The complicated sounding (but actually simple solution) is to avoid placing literals, and/or spaces, within any output format specifier, instead put single quotes round the whole content. What you thought of putting as literals within any web tag is instead typed outside with separate web tags for the part of the specification before and after each literal. An example to make this clearer is <code>$MXDateTime = '<#date format=yyyy-MM-dd>' . 'T' . '<#time format=hh:mm:ss>';</code>, which is written in PHP Hypertext preprocessor format, the literal 'T' has been inserted between two separate web tags. |
|||
or |
|||
===Year formats=== |
|||
VPrainGaugeType=1 |
|||
These are the simplest output format modifiers. We choose from 2 options, and because both involve more than one character their context does not matter. Although the legacy Cumulus will accept upper case as meaning same as lower case, it is simplest if we just show the lower case options needed for MX: |
|||
Where 0 is a 0.2mm gauge and 1 is a 0.01" gauge. Note that changing this after MX has already read some data may cause your rainfall reading for today etc to change considerably, so you will need to correct that. |
|||
{| class="wikitable" border="1" |
|||
= Web Tags and related features = |
|||
|- |
|||
!style="width:150px" | Specifier |
|||
!style="width:600px" | Displays |
|||
!style="width:600px" | Example |
|||
|- |
|||
|yy |
|||
|Displays the year as a two-digit number (00-99). |
|||
|19 produced by <#LastDataReadT format=yy> |
|||
|- |
|||
|yyyy |
|||
|Displays the year as a four-digit number (2000-9999). |
|||
|2009 produced by <#LastDataReadT format=yyyy> |
|||
|} |
|||
====Month formats==== |
|||
Almost all of the [[Webtags|web tags for all Cumulus flavours on this Wiki page]] that you could use in Cumulus 1 are also supported in Cumulus MX. |
|||
All locales offer both numerical and alphabetical formats for representing months. |
|||
Each new build of the beta MX has increased the range of web tags it supports. For full details see the [[Webtags#Differences_between_Cumulus_1_and_Cumulus_MX_.28Cumulus_3.29:|web tags]] article, but a quick précis follows in next two sub-sections. |
|||
*In the following table "MMM" is shown as producing short month name. |
|||
**What language is used, and what characters appear, depend on what is set up for your language in your settings (by default or by you changing your settings) |
|||
**In British English (UK) locale this will be the appropriate 3 letter abbreviation that starts with "Jan" and runs to "Dec" |
|||
**It appears that language settings in many locales (not "en-gb"), add a full stop to any abbreviations |
|||
and in that case the 3-letter "MMM" is turned into a 4-letter output (e.g. Australia settings default would output from "Jan." to "Dec.") |
|||
*** MX has been coded to remove that full stop in various places (like in standard log file naming and NOAA report naming), but at the time this section was edited, "MMM" still reports the full stop in a web tag output if your locale uses it |
|||
*In the following table "MMMM" is shown as producing the full name for a month |
|||
**The output you get will depend on the language defined in your locale |
|||
**In English locales, the output will be in the range "January" - "December" |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:150px" | [[File:Badge v1.png]]Delphi Specifier for Cumulus 1.9.x |
|||
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX |
|||
!style="width:600px" | Displays |
|||
!style="width:600px" | Example |
|||
|- |
|||
|M (or ''m'') |
|||
|%M |
|||
|Displays the month as a number without a leading zero (1-12). |
|||
* [[File:Badge v1.png]]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, so different from the '''format=M''' included in previous table. |
|||
|2 |
|||
|- |
|||
|MM (or ''mm'') |
|||
|MM |
|||
|Displays the month as a number with a leading zero (01-12). |
|||
* [[File:Badge v1.png]]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> or <#metdate format="MM"> |
|||
|- |
|||
|MMM (or ''mmm'') |
|||
|MMM |
|||
|Displays the month using the strings defined for '''short month name''' in the Locale. |
|||
|'Jun' produced by <#metdate format="MMM"> (English locale) |
|||
|- |
|||
|MMMM (or ''mmmm'') |
|||
|MMMM |
|||
|Displays the month as a full name using the strings appropriate to the Locale. |
|||
|'June' produced by <#metdate format="MMMM"> (English locale) |
|||
|} |
|||
====Day formats==== |
|||
All locales offer both numerical and alphabetical formats for representing a day. |
|||
== All builds of MX == |
|||
The table below relates just to the day part of any date specifications. |
|||
The ''''format' parameter''' on the date/time output modifier for web tags is unfortunately different, because many of the characters used are different. See [[Webtags#List_of_allowed_modifiers|the modifiers list]] page of this Wiki. |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:150px" | [[File:Badge v1.png]]}Delphi Specifier for Cumulus 1.9.x |
|||
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX |
|||
!style="width:600px" | Displays |
|||
!style="width:600px" | Example |
|||
|- |
|||
| d (single character) |
|||
| %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 another modifier to be included, as 'd' on its own is inconsistent - see [[#Date formats]] table). |
|||
Note that this difference in date/time modifiers also affects how you specify the '''NOAA report''' file names. For example in Cumulus 1 you can specify a 2 digit month number by either 'mm' or 'MM', but MX (later versions) has to change the former to the latter as MX uses 'mm' for minutes. The same applies to using 'mmm' or 'MMM' for 3 letter month abbreviation in Cumulus 1, only the latter works in MX, so MX (later versions) will adjust that. If you are using an older MX version, you should upgrade to latest as you are missing a lot of functionality, but while you use that old version, ensure that your file names for NOAA reports do use the correct modifiers for MX. |
|||
| 27 produced by: |
|||
* [[File:Badge v1.png]]<#metdate format="d"> |
|||
* [[File:Badge vMx.png]]<#metdate format="%d"> |
|||
|- |
|||
|dd (2 characters long) |
|||
|dd |
|||
|Displays the day as a number with a leading zero (01-31). |
|||
|07 produced by <#metdate format="dd"> |
|||
|- |
|||
|ddd (3 characters long) |
|||
|ddd |
|||
|Displays the day as an abbreviation (in UK English will output Sun-Sat) using the strings appropriate to the Locale. |
|||
As for month above, the short day names that are generated depend on your locale, so you might see additional punctuation defined for abbreviated names in some locales. |
|||
== Beta builds of MX == |
|||
|'Wed' produced by <#metdate format="ddd"> (English locale) |
|||
|- |
|||
|dddd (4 characters long) |
|||
|dddd |
|||
|Displays the day as a full name (Sunday-Saturday) using the strings appropriate to the Locale. |
|||
|'Friday' produced by <#metdate format="dddd"> (English locale) |
|||
|} |
|||
====Date formats==== |
|||
The following web tags are not available or work differently: |
|||
*The individual 'record set' tags such as <#TempRecordSet> etc are not available in MX beta builds (because the interface by Steve Loft had no indicators for new records and no way to reset them). |
|||
*The <#newrecord> tag does work, but works differently, it turns itself off automatically after 24 hours. |
|||
*Some of the 'system status' web tags do not work: <#CpuName>, <#MemoryStatus>, <#DisplayMode>, <#DiskSize> and <#DiskFree> (These can not be implemented for software that can run on a multitude of devices) |
|||
*The <#txbattery> web tag has no content currently. Using it with a 'channel' parameter causes a 'token error'. |
|||
*The '''Weather Diary''' feature is only available from beta version 3.0.0 - Build 3046 of 2 Jan 2019 onwards, it offers same web tag (<#snowdepth>) as the original Cumulus 1. |
|||
*From beta version 3.0.0 - build 3047 onwards: |
|||
** Web token parser updated to cope with html tag characters "<>" in the format string e.g. <#TapptempH format="dd' 'MMM' 'yyyy'<span class=\'xx\'> at 'HH:mm'</span>'"> |
|||
**All record Value tags should return '---' and Date tags should return '----' until they are first set. |
|||
**<#MoonAge>, <#MoonPercent>, <#MoonPercentAbs> - all given new 'dp' and 'rc' parameters. |
|||
The [[#Year formats]], [[#Month formats]], and [[#Day formats]] listed above can be combined to make up a date output modifier, but there are some other modifiers available that can produce whole dates. |
|||
[[#Locales]] will define a '''Short Date Format''' and a '''Long Date Format'''. You will see references to those in the table below explaining available output format modifiers, for example the single character output format modifier ('''G''' or '''c''') listed at the start of the table below. |
|||
If you are in the USA, Cumulus will not use your month first date internally or in any files in the [[Data folder|'''data''' sub-folder]], but you can see your preferred format asan output from web tags, as you can can combine the month specifier, with the day specifier, in that order, to get an output where the month appears first (see example in table below). |
|||
<big>Please could an American contributor please check if the "M" modifier works for their locale as shown and update the table below</big>. |
|||
= Installing and Running Cumulus MX = |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:150px" | [[File:Badge v1.png]]Delphi Specifier for Cumulus 1.9.x |
|||
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX |
|||
!style="width:600px" | Displays |
|||
!style="width:600px" | Example |
|||
|- |
|||
|c |
|||
|G (as single character format) |
|||
|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. |
|||
|'22/03/2019 09:47:25' produced by [[File:Badge v1.png]]<#time format=c>[[File:Badge vMx.png]]<#time format=G> |
|||
|- |
|||
|ddddd (5 characters long) |
|||
|d (as single character format) |
|||
| Flavour issues: |
|||
* [[File:Badge v1.png]]Cumulus 1.x.y: 'ddddd' will output the date using the format given by the Short Date format. |
|||
* [[File:Badge vMx.png]]This MX parameter (when on its own, without space or '%' prefix) displays inconsistent behaviour as its effect depends on the tag name (sorry, there is no definitive list from the MX author specifying effect by individual tag name) with which it is used (you will need to experiment for yourself and compare with the two examples). |
|||
| [[File:Badge vMx.png]] '22' returned by e.g. <#yesterday=d> |
|||
Short date format e.g. '22/03/2019' (British Locale) produced by: |
|||
There is no automatic installer (this may change). Cumulus MX is supplied as a zipped package on a link from [[Software|Software download page]]. |
|||
* [[File:Badge v1.png]]<#metdate format=ddddd> |
|||
* [[File:Badge vMx.png]]<#metdateyesterday format=d> |
|||
|- |
|||
|dddddd (6 characters long) |
|||
|D (as single character format) |
|||
|Displays the date using the format given by the Long Date format. |
|||
[[File:Badge vMx.png]]The MX 'D' parameter '''cannot be combined''' with any other parameters. |
|||
== Replacing Cumulus 1 == |
|||
|e.g. '22 March 2020' (British Locale) |
|||
|- |
|||
|"D MMMM YYYY" |
|||
|D |
|||
|Long date format |
|||
|e.g.4 December 2009 |
|||
|- |
|||
|"D MMMM" |
|||
|M |
|||
|Day of month followed by Month name (except USA locales). |
|||
Compared with next table where '''format=%M''' used, '''format=M''' on its own returns both Month and Day according to local format |
|||
See [[Moving from Cumulus 1 to MX]] article. If you wish to run MX on Windows, then you can unzip the contents of the download package over your original cumulus installation, i.e. so the same data and Reports folders continue to be used. But it would be best if you take a back-up copy of the Cumulus 1 installation first! If you are going to run MX on another device, follow instructions in next sub-section. |
|||
| e.g. 22 July (English Locale) |
|||
|- |
|||
|"MMMM D" |
|||
|"MMMM d" if M alone does not work |
|||
| USA format of month before day of month |
|||
| e.g. July 4 (USA format) |
|||
|- |
|||
|TT |
|||
|T (as single character format) |
|||
|Displays the time using the '''Long Time format'''. |
|||
[[File:Badge vMx.png]] Note that this is a full time specifier and "T" is on its own as we are using a single character format. |
|||
The package contains several extra .dll files, and everything else you need, to continue to read from your weather station, to load up the [[MX Administrative Interface|admin interface]] on a Cumulus generated web server (there are some settings you will need to change using that interface), and some simple web template examples (that replace the standard Cumulus 1 example templates). You might want to read topics on the MX support forum to discover about other people's experiences. |
|||
|'09:47:56' (might not use colon in your locale) produced by |
|||
* [[File:Badge v1.png]]<#LastDataReadT format=TT> |
|||
*[[File:Badge vMx.png]]<#LastDataReadT format=T> |
|||
|} |
|||
== Completely new MX installation == |
|||
===Time formats=== |
|||
See earlier for links to other articles about installing on a Windows PC or a Raspberry Pi. Here only a brief indication of installation is covered. |
|||
Here context matters, so both standard (single character) and custom (two or more characters) formats are shown in the following table. As explained earlier, time formats can be used with durations and clock times. |
|||
*Create a new directory (recommended name CumulusMX) and unzip the contents of the [[Software|download package]] into it. |
|||
*See notes below for extras required in various operating systems. |
|||
*The package contains several extra .dll files, and everything else you need, to continue to read from your weather station, to load up the [[MX Administrative Interface|admin interface]] on a Cumulus generated web server (there are some settings you will need to change using that interface), and some simple web template examples (that replace the standard Cumulus 1 example templates). |
|||
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. If you want to include what is shown in square brackets you don't type the square brackets e.g. <tt><#LastDataReadT format="h:nn am/pm"></tt> |
|||
== Running Cumulus MX == |
|||
{| class="wikitable" border="1" |
|||
|- |
|||
!style="width:150px" | [[File:Badge v1.png]]Delphi Specifier for Cumulus 1.9.x |
|||
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX |
|||
!style="width:600px" | Displays |
|||
!style="width:600px" | Example |
|||
|- |
|||
|h |
|||
|%h |
|||
|Displays the hour (12 hour clock) without a leading zero (1-12) |
|||
| 7 |
|||
|- |
|||
|h ''AM/PM'' |
|||
|h ''tt'' |
|||
|Displays the hour (12 hour clock) without a leading zero (1-12) in combination with AM/PM. |
|||
[[File:Badge v1.png]]For Cumulus 1 the formats for am/pm depend on the case in which you type the parameter as shown later in this table |
|||
# Make sure your weather station (and any extra sensors) is connected to the device on which you have installed Cumulus MX, before you try to run Cumulus MX. |
|||
# Start '''Cumulus MX engine''' (command to do this varies between operating systems, so see sub-heading for your device below |
|||
# Start '''Admin Interface''', it runs in a browser, by default on port 8998, see [[#User_Interface|section]] below. |
|||
[[File:Badge vMx.png]]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). |
|||
If you have been running Cumulus 1 before, then [[Moving from Cumulus 1 to MX|as instructed here]] your MX installation will require various files from your Cumulus 1 installation including all files in the '''data''' and '''Reports''' folder and all [[:Category:Configuration Files|Configuration Files]] including [[Cumulus.ini#Swapping_from_Cumulus_1_to_MX|Cumulus.ini]] and follow that link for details of a few of the parameters that you may need to change. |
|||
| [[File:Badge v1.png]]7 PM |
|||
|- |
|||
|h:nn [''AM/PM''] |
|||
|h:mm [''tt''] |
|||
|Displays the hour (using 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]. |
|||
[[File:Badge v1.png]]For Cumulus 1, the minutes can be represented by 'mm' (instead of "nn") only when appearing in combination with 'h' |
|||
If you are running MX for the first time, without a configuration file (none is included in download package), see [[Cumulus.ini#Cumulus_MX|here]] for screen shots showing what you see as the engine starts running, and what you see in the admin interface where you set your weather station type. In that link there are more instructions. |
|||
|'10:27 am' produced by [[File:Badge v1.png]] <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt"> |
|||
|- |
|||
|H (or ''H'') |
|||
|%H |
|||
| Displays the hour part of any duration or clock time, without a leading zero (0-23). |
|||
[[File:Badge vMx.png]]Note that '%' before the "H", this makes it a custom modifier, needed because H is on its own. |
|||
|7 produced by |
|||
* [[File:Badge v1.png]]<#daylength format=H> |
|||
*[[File:Badge vMx.png]]<#daylength format=%H> |
|||
|- |
|||
|H:mm (or ''H:nn'') |
|||
|H:mm |
|||
| Displays the hour part of any duration or clock time, without a leading zero (0-23) followed by 2 digit minutes for that duration or clock time. |
|||
[[File:Badge vMx.png]]Note that %, of previous example, is not needed as the H is not on its own. |
|||
=== Requirements for running on Linux and OS X === |
|||
|'6:27' or '17:49' produced by <#LastDataReadT format="H:mm"> |
|||
|- |
|||
|HH (or ''hh'') |
|||
|HH |
|||
| Displays the hour part of any duration or clock time, using 24 hour clock with a leading zero (00-23). |
|||
|'06' or '17' produced by <#LastDataReadT format=HH> |
|||
|- |
|||
|hh [''am/pm''] |
|||
|hh [''tt''] |
|||
| Displays the hour part of any duration or clock time, (12 hour clock) with a leading zero (01-12) [optionally, if it is a clock time, in combination with am/pm]. |
|||
[[File:Badge v1.png]]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 |
|||
You will need to install the '''Mono-complete''' runtime (the latest version of Mono should work with all functionality of latest MX in all locales). Mark Crossley says "There shouldn't be any outstanding issues with Mono, afaik they are all resolved - except for the Moon image rotation in the southern hemisphere which does not work with Mono 6.0 thru to the latest 6.8.0, only version 5.x works correctly atm for System Drawing." |
|||
* For OS X, you can download this here - http://www.mono-project.com/download/. |
|||
* How you install on Linux depends on the flavour of Linux you are running. There are download links for Linux at the same URL, but it is often easier to use a package manager, which will download and install it automatically. |
|||
**For example, in 'Raspbian' on the Raspberry Pi, you can install mono with the following commands, but '''first you need to have set up various pre-requisites''' (see [[MX_on_Linux]] article for details): |
|||
[[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 but before midnight |
|||
<pre>sudo apt update && sudo apt upgrade |
|||
|'07 am' produced by |
|||
sudo apt install mono-complete</pre> |
|||
* [[File:Badge v1.png]] <#LastDataReadT format="hh am/pm"> |
|||
Note that you do need to have the '''mono-complete''' package installed, not just the Mono for developers. |
|||
*[[File:Badge vMx.png]] <#LastDataReadT format="hh tt"> if locale specifies lower case |
|||
|- |
|||
|hh:mm (or ''hh:nn'' or 'HH:NN') [''am/pm''] |
|||
|hh:mm [''tt''] |
|||
| Displays the hour part of any duration or clock time, (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally, if it is a clock time, in combination with am/pm]. |
|||
* [[File:Badge v1.png]]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. As Cumulus 1 is case insensitive there are variants with capital letters available. |
|||
*[[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 |
|||
* [[File:Badge v1.png]] <#LastDataReadT format="h:nn am/pm"> |
|||
*[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt"> |
|||
|- |
|||
|n |
|||
|%m |
|||
|Displays the minutes of any duration or clock time, without a leading zero (0-59). |
|||
[[File:Badge vMx.png]] As other examples show, the % is only needed when "m" is on its own. |
|||
The "sudo" prefix gives the command 'root' privileges, that allows administrative commands like update and install to run. |
|||
| 7 produced as a duration in minutes by |
|||
* [[File:Badge v1.png]]<#daylength format=n> |
|||
==== To actually run MX ==== |
|||
*[[File:Badge vMx.png]]<#daylength format=m> |
|||
|- |
|||
|nn |
|||
|mm |
|||
|Displays the minutes of any duration or clock time, with a leading zero (00-59). |
|||
|'07' produced as a duration in minutes by |
|||
* [[File:Badge v1.png]]<#daylength format=nn> |
|||
*[[File:Badge vMx.png]]<#daylength format=mm> |
|||
|- |
|||
|s |
|||
|%s |
|||
|Displays the seconds for any duration or clock time, that has resolution to less than a minute, without a leading zero (0-59). |
|||
[[File:Badge vMx.png]] As other examples show, the % is recommended when "s" is on its own, although I have not found any alternative meaning for "s" on its own. |
|||
| 9 produced by <#metdate format=s> |
|||
|- |
|||
|ss |
|||
|ss |
|||
|Displays the second with a leading zero (00-59). |
|||
|'06' or 19 produced by <#LastDataReadT format=ss> |
|||
|- |
|||
|z |
|||
|FFF |
|||
|Displays the millisecond without a leading zero (Cumulus 1: displays 0-999, Cumulus MX: displays either nothing, or displays 1-999, so don't write any code that assumes the MX output is numeric). |
|||
Note that the system clock (before Windows 10 64-bit systems) only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Windows. |
|||
Open a terminal window, change to the Cumulus MX directory, and then type: |
|||
| |
|||
<pre>sudo mono CumulusMX.exe</pre> |
|||
|- |
|||
|(not available) |
|||
|ff (or ''f'') |
|||
|Displays hundredths of a second (or tenths) with leading zero(s) |
|||
| |
|||
|- |
|||
|zzz |
|||
|fff |
|||
|Displays the millisecond with a leading zero (000-999). |
|||
Note that the system clock (before Windows 10 64-bit systems) only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Windows. |
|||
There are some optional parameters you might need to use, as they also apply to windows they are covered later. |
|||
[[File:Badge vMx.png]]The 'fff' modifier in MX can actually be extended to 'ffffff' for output to a millionth of a second! |
|||
Next start the administrative interface, basically same as described for Windows above. More information on admin interface [[MX Administrative Interface|in separate article]]. |
|||
| 09:47:25.000' produced by |
|||
* [[File:Badge v1.png]]<#time format=hh:nn:ss.zzz> |
|||
*[[File:Badge vMx.png]]<#time format=hh:mm:ss.fff> |
|||
|- |
|||
|(not available) |
|||
| zzz |
|||
|Displays the offset of any time from UTC in hours and minutes |
|||
| e.g.-07:00 |
|||
|- |
|||
|(not available) |
|||
|"h:mm K" |
|||
|Effectively another way of including time zone after a time, but it can only be used for times not in UTC (if I understand correctly) |
|||
|(no examples supplied yet) |
|||
|- |
|||
|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. |
|||
| '09:47' produced by <#LastDataReadT format=t> (might not use colon in your locale) for both flavours of Cumulus |
|||
|- |
|||
|am/pm or Am/Pm or AM/PM |
|||
|tt |
|||
| [[File:Badge v1.png]]Uses the 12-hour clock for the preceding h or H specifier, and displays 'am' for any (clock time) 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. |
|||
[[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, so whether it displays in capitals or lower case is determined by the locale settings, not the case of "tt". |
|||
| {Version badge 1}} 'am' produced by <#LastDataReadT format=am/pm>, 'AM' produced by <#LastDataReadT format=AM/PM> |
|||
|- |
|||
|h a/p |
|||
|h t |
|||
|Uses the 12-hour clock for the preceding h or H (clock time) specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon. |
|||
[[File:Badge v1.png]]The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly. |
|||
**If you have a Raspberry Pi 2, there is a later version of Mono available, which you may find works better that the one in the standard distribution, particularly if you use decimal commas. Mono 3.2.8 (which is the default in some Linux distributions) will not work if you use commas for decimals, as in some countries. |
|||
[[File:Badge vMx.png]]whether it displays the "a" or "p" in capitals or lower case is determined by the locale settings, not the case of "t". |
|||
**On Linux you will need library '''libudev.so.0''' which may not be installed by default. Installing '''package libudev0''' may resolve this. There may be issues if you are using a 64-bit version of Linux. I'm not sure what the resolution is at the moment, if this is the case. |
|||
| 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 typical British locale |
|||
|- |
|||
|: |
|||
|: |
|||
|Displays the time separator character given by the Time Separator. With Cumulus 1, this might not display a colon. |
|||
[[File:Badge vMx.png]]Note that by default Cumulus MX expects a locale to use ":" for any time separator. |
|||
You need to specify something like '''/dev/ttyUSB0''' for the connection for your weather station. This is set in the "station settings" and stored in the [[Cumulus.ini#station|ComportName attribute]] in Cumulus.ini configuration file. |
|||
|':' for British locale |
|||
|} |
|||
In some builds of MX you have to run as "root", there are ways of giving "root" like permissions when running MX as another user, see forum for details until this section has been updated. |
|||
=Some Extra Information= |
|||
====Stopping MX==== |
|||
Having covered the basics of both date and time modifiers above, it is time to talk about incorporating other information in an output modifying date/time format specification. |
|||
The best way to stop MX is by sending a '''control and C''' sequence to it. There is a start stop routine discussed in the support forum, where you will also find some topics about shutdown issues. |
|||
The MX source listing suggests it also accepts ''control and break'', '''Close main window''', ''user logoff'', and '''system shutdown''' and should still attempt to stop running tidily. There are various tasks like writing final values to log files and recreating the configuration file, [[Cumulus.ini]], that it needs to do as part of the MX closing routine, and obviously early closure of the device running MX (such as that caused by a power cut) will prevent a tidy end to MX. |
|||
Basically, we can include literal characters, and we can include HyperText Manipulation Language tags, in our specifiers. |
|||
Finally, there will be a section on migrating from the legacy Cumulus to MX and how to modify the web tags in your templates to keep them working. |
|||
==Including literals in format parameters== |
|||
[[#Use of spaces]] explained how double quotes were needed for date/time output specifiers containing spaces. It briefly talked about including literals, and we will expand on that now. |
|||
Consequently, you cannot include double quote characters in any other position (see [[Php_webtags#Web_tag_Complications| here for work-around]]). |
|||
=== Requirements for running on Windows === |
|||
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. In MX, such single quotation marks should include the spaces round the additional literal text. |
|||
For those who downloaded the first MX Beta in January 2015, the code was only experimental and that version had to be run by a Windows Administrative User, but Steve Loft soon improved the code and now none of the code requires any elevated rights and it can be run by a normal user (or a user with administrative rights) without needing to be started by '''Run as administrator'''. |
|||
#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">. |
|||
However, Cumulus MX initiates a web server, which is what runs the [[MX_Administrative_Interface|Admin Interface]]. To access that, all users need to be given elevated rights to the port on which the web server runs. By default this is port 8998, so that is used in the example below of the one-off command needed to give all users access to the port. You can use a '''-port=nnnn''' parameter when starting MX to make it use another port, if you use that then the command below needs revising accordingly. |
|||
#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' 'am/pm '<small>on' d/m/yyyy'</small>'">. |
|||
#* See next sub-section for more information on incorporating HTML if you are using MX. |
|||
To enter the command, first open a command window as administrator. One way to do this is to right click the windows symbol at the start of the windows task bar. The option to choose there is dependent on some settings which determine what appears when you right click: |
|||
*the normal default on Windows 10 is '''Windows PowerShell (admin)''', |
|||
*the normal default on earlier versions of Windows is '''Command Prompt (Administrator)''' |
|||
*an alternative is '''Windows Terminal''' |
|||
Whichever of these you can use, the result is it opens a new window on your monitor with a prompt for typing. In that window type the command: |
|||
<pre> |
|||
netsh http add urlacl url=http://*:8998/ user=\users |
|||
</pre> |
|||
[[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! |
|||
You only need to do that once. If you do not issue this command, administrative rights are needed every time to access the port. |
|||
Talking about command windows, if you want to check that the port is open for listening (i.e. able to access the admin interface) type <tt>netstat -an | findstr 8998</tt> into the command window. |
|||
{| class="wikitable" border="1" |
|||
The admin interface URL '''http://*:8998/''' needs to have that wildcard "*" replaced by a precise location if we are to access the admin interface. The missing part of the URL depends on how your local network is set up. If you are accessing the admin interface on the same device as that running MX (and you don't have another web server on that device) the "*" can be replaced by "localhost", i.e. '''http://localhost:8998/''' will be used to load the admin interface into your browser. In the more general case when you want to access the admin interface from anywhere on your local wired and wireless interface, then the "*" needs to be replaced by a string of 4 numbers representing what is called a IPv4 address (w.x.y.z) of the device you have installed MX on. |
|||
|- |
|||
!style="width:150px" | {{Version badge 1}}Delphi Specifier for Cumulus 1.9.x |
|||
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX |
|||
!style="width:600px" | Displays |
|||
!style="width:600px" | Example |
|||
|- |
|||
|'xy' |
|||
|'xy' or ''\x\y'' |
|||
|Characters enclosed in single quotation marks are displayed as such, and do not affect formatting. |
|||
[[File:Badge vMx.png]]In MX each character to be displayed as it was typed can be prefixed by a backslash. Also remember that any spaces in a MX modifier might need to be within single quotes as space is also used to change what a modifier represents. I told you MX modifiers were more complicated! |
|||
Look at your hub or router (this should have come with instructions on how to access its settings in your browser) and on one screen it should show what devices are connected to your LAN and wifi. Look for the IPv4 address, for example 192.168.1.64, it has assigned to the device where MX is running. That is what should replace the "*". However, there is one more complication, either the Windows networking settings may change, or else your hub or router may reconfigure, both can happen at any time and both can assign a different IPv4 address to the device running MX. |
|||
|Hyphens are added in this PHP language example '<#LastDataReadT format=yyyy>'.'-'.'<#LastDataReadT format=MM>'.'-'.'<#LastDataReadT format="dd">' |
|||
|} |
|||
== Using HTML tags within format parameters (available in MX only) == |
|||
'''Example using a class to change the look of part of the output''' |
|||
==== Setting up for either manual or automatic running ==== |
|||
<pre><#TapptempH format="dd' 'MMM' 'yyyy'<span class=\'xx\'> at 'HH:mm'</span>'"></pre> |
|||
the output from this will look like ''04 Dec 2018<span class='xx'> at 10:12</span>'' |
|||
'''Note where the quotes are, and where you need to use '\' escape characters'''. |
|||
To run Cumulus MX, Windows needs to know |
|||
#which '''.exe''' you want to run |
|||
#the path where all the required '''.dll''' files are located |
|||
'''Example using HTML tags''' |
|||
Therefore it is best to always start MX using what Windows calls a '''shortcut''', because when creating the shortcut you can enter all the required information into the properties. If you want MX to automatically start whenever you log into your PC, then the place to store your shortcut is <tt>C:\Users\...\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Run_CumulusMX</tt>. Don't forget to put your Microsoft username where I have put ... |
|||
<pre><#RecentTS d=2 format="h:mm' 'tt'<small>on' d/M/yyyy'</small>'"></pre> |
|||
With this you might want to right click on that shortcut, select properties, then you can set the starting position for the command window, the colours and font it will use, and even choose to start minimised, amongst many other selections. |
|||
This puts the date in a smaller font than the time |
|||
There are 3 ways on Windows to create a shortcut to run MX, as mentioned above you can't just click on the executable in file manager, because Windows needs to be told the path for loading all the related .dll files. |
|||
#Create a shortcut on your desktop (and/or the taskbar) for the '''CumulusMX.exe''' executable <tt>cmd.exe /C start CumulusMX C:\CumulusMX\CumulusMX.exe -debug</tt>, the "-debug" is ''optional'', it starts the logging in debugging mode so the log created in MXDiags folder has more information. There are other optional parameters all listed later. |
|||
#*In that shortcut define the path where the executable is located as the path to start in. |
|||
#* '''Remember, if you have not done the <tt>''netsh http add urlacl url=http://*:8998/ user=\users''</tt> command mentioned above, you must run as administrator.''' |
|||
#* Add any of the parameters that can be used with the executable, as listed later, such as specifying a different port for the admin interface , or starting with debugging. |
|||
#*Choose whether to start as minimised or as a command window |
|||
#*You can also choose text colour (foreground) and background colour, you can choose where the window appears (so if you have two monitors you can choose which one it appears on), and how big that window is. There is a forum post by water01 about this. |
|||
#*Now you can click the shortcut to start the engine |
|||
#OR place the shortcut as defined above in the start up folder for the user account so MX automatically starts when you connect/log in (see a later section for how to find that start up folder). |
|||
# OR declare a task in the scheduler to start MX; in the '''Actions''' tab fill in fields as follows (the other tabs should be obvious): |
|||
#**'''Action''' <tt>Start a program</tt> from drop-down |
|||
#**'''Program/script''' <tt>cmd.exe</tt> (this is standard Windows environment to run something) |
|||
#**'''Add arguments''' <tt>/C start Start_MX \CumulusMX\CumulusMX.exe -debug -port=nnnn</tt> (the "/C" means this task will close once it has started the task, the "Start_MX" is how the task will be labelled as it is running, the next argument "\CumulusMX\CumulusMX.exe" actually starts the executable and it does not need a drive prefix as that is in next box. |
|||
#**Note in this example I have included next two optional parameters that can be used after the .exe call in that same box, here '''-debug''' (only include if you want full debugging logging) and '''-port=nnnn''' where nnnn is the port to be used for admin interface (only include if want to change from default 8998), |
|||
#** all optional parameters are listed later |
|||
#**'''Start in''' <tt>\CumulusMX</tt> (include a drive specifier if necessary) |
|||
== Migrating from legacy Cumulus 1 to MX== |
|||
==== Each time you want to run Cumulus MX on Windows: ==== |
|||
If you have created any legacy cumulus template files, then in each template, you will need to do some editing. Everywhere a web tag appears with an output modifiers that is used to specify a date and/or time format, has to be edited before that template will work for MX. |
|||
#First '''start the engine''' in one of the 3 ways from last sub-section |
|||
# Next '''start the admin interface''', it does not need to run all the time, but only when you need it (when you first use MX you will need it to access the settings where you tell MX what type of station you have and what units you want to use, and set various timing options), it normally runs on port 8998 (to vary that there is a '''-port''' parameter that is followed by required port and that port parameter has to be entered every time you start MX if you are not using the default port). More information on admin interface [[MX Administrative Interface|in separate article]]. |
|||
Here are the main reasons: |
|||
Try '''start /min C:\Cumulus\CumulusMX.exe''' to run MX as a minimised package (although in Windows you can change the properties of the shortcut you use to start minimised). |
|||
* the reserved characters are different in C1 and MX (affecting use of literals like "on" and "at" that appear in many English time-stamps) |
|||
* the Delphi in legacy Cumulus is case insensitive, so for example "H" and "h" have the same meaning |
|||
* MX is case sensitive, and symbols mostly have different meanings when one symbol is used to when that symbol is used with others, so for example "H" and "h" have different meanings, and if not used with other symbols will need to be preceded with a "%" to have same meaning as they have in combination with other symbols |
|||
* In the legacy cumulus, a symbol like "d" has the same meaning for any tag |
|||
* MX is inconsistent, a symbol like "d" changes its meaning depending on the tag it is used with (e.g. the script conditional ''''<#metdateyesterday format=d>' == '<#yesterday format=d)>'''' will never be equal as the LHS returns a full date and the right hand side returns day of month only) |
|||
* the symbols used for representing such modifiers as minutes, month, am/pm, are different between C1 and MX. |
|||
* MX introduces the concept of escaping characters (a '''\''' placed before a character can be either a control sequence or an instruction to display the character) |
|||
* In the legacy Cumulus, a space is a gap between characters |
|||
* In MX, a space must be within a literal, as a space before a symbol has the same effect as "%", (it changes the interpretation of a modifier character). |
|||
'''Confused even more now?''' I'm not surprised, but maybe some examples will help. |
|||
==== Stopping Cumulus MX on Windows pc ==== |
|||
=== Examples === |
|||
The recommended way is to click into the command window in which MX is running, ''hold down Control key'' and press '''C'''. It is normal for there to be a short wait, then a message "Cumulus Terminating" and then after another short wait, it will say "Cumulus Stopped" and immediately after that the command window will close. |
|||
*Examples related to case selection |
|||
Some people, click in the task bar and select close, or click the '''X''' button on top right of command window. Although these are not official advice, they do seem to work. |
|||
*#[[File:badge v1.png]] In Delphi, "nn" means "minutes" for Cumulus 1, [[File:Badge vMx.png]]but "minutes" is "mm" for .NET or MONO in Cumulus MX. |
|||
*# The hour in 24-hour format with leading zero, in non case sensitive Delphi (Cumulus 1) 'HH' or 'hh' would be treated as same, but in .NET or MONO it must be "HH" (Cumulus MX). |
|||
*# The hour in 24-hour format without leading zero, in non case sensitive Delphi (Cumulus 1) 'H' or 'h' would be treated as same, but in .NET or MONO it must be "%H" (Cumulus MX). |
|||
*# For 12-hour specifiers, please see the table, as this is far more complicated. |
|||
*[[File:Badge vMx.png]]You might be put off by references within .NET and MONO (Cumulus MX) to single/standard characters and custom modifiers, the following 3 examples may add clarity: |
|||
*#For example, ''<#MonthTempHD format="d">'' is a single character format modifier, therefore the 'd' acts as a standard modifier, and causes for a date of 22 July 2014 for the highest temperature in the month to be returned in the standard short date format e.g. '22/07/2014' (exact contents for any one date vary by locale). |
|||
*#Similarly, ''<#MonthTempHD format="M">'' is a single character format modifier and therefore the 'M' acts as a standard modifier and causes the date for the highest temperature in the month to be returned in the standard day and month format e.g. '22 July' (exact contents for any one date vary by locale). |
|||
*#Whilst ''<#metdate format="d M">'' is not a single character format modifier and therefore both the 'd' and the 'M' are interpreted as custom modifiers and cause the current date to be returned as a digit(s) for the day and a digit(s) month (in a without leading zeroes format) e.g. '6 7' would be returned for 6 July. |
|||
*#Alternatively, ''<#MonthTempHD format="%d">'' is NOT a single character format modifier, therefore the 'd' acts as a custom modifier, and causes a date of 22 July 2014 for the highest temperature in the month to be returned as the day of the month only '22' in all locales. |
|||
*#Similarly, ''<#MonthTempHD format="%M">'' is NOT a single character format modifier and therefore the 'M' acts as a custom modifier and causes the same date for the highest temperature in the month to be returned as the month number '7'. |
|||
In both Cumulus 1 and MX if you want a space character within your output, the output specifiers must be enclosed in double quotes. If that space character is next to a non modifier (e.g. around word "at") then the single quote needing to surround the at should be widened to include the spaces in MX, but Cumulus 1 does not care if single quotes excluded spaces. However, with MX, single quotes enclose multiple characters, but there is an alternative way to deal with some single verbatim characters to cover next. |
|||
There are packages that can be programmed to send a control C to a running task, and to not continue until the task window has closed. Remember to also program in a subsequent delay in that package, to make sure the package waits for MX to close, or do a check that MX has released all the files it might need to update. |
|||
So let us compare these two alternative ways that MONO and .NET escape any characters that are not being used as format specifiers. |
|||
''You should not'' issue a '''TASKKILL''' instruction, as that will prevent MX correctly writing out to all the files it should update on exit. Consequently, it will not restart correctly and may actually lose settings and data. |
|||
* In [[File:badge v1.png]]Delphi you can put the 'verbatim' characters inside single quotes (Cumulus 1); this is often used to (in English) include words like ' on ' and ' at ' in the formatted output. |
|||
*in [[File:Badge vMx.png]].NET or MONO you can still use single quotes (as mentioned above extended to include adjacent spaces), |
|||
** but alternatively you can escape each verbatim character with a backslash as prefix (Cumulus MX). |
|||
* 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. |
|||
== Past history for this page== |
|||
= Cumulus flavours = |
|||
This page is a complete redesign of how to present information that was previously on the [[Webtags]] page, so look there for past content by selecting "history" tab. |
|||
This is a new section added, just to put the whole Cumulus software project into a full historical context. |
|||
Trying to make the old design made for the original Cumulus software, work for MX which is now very different, made the old page unwieldy. |
|||
==Cumulus 1 == |
|||
*Cumulus 1 was created in 2003 when Steve Loft moved to Wanlockhead and bought himself a weather station. Initial releases were very much tailored to his needs, and instead of supporting a variety of Weather Station makes, it supported just one. The actual make supported varied during some original builds so it would match the make he was using. |
|||
*Subsequently, he made his software available to anybody, making it compatible with every make of weather station that was lent to him, and enhanced functionality to suit not only his requirements buy also what other users asked for. |
|||
*Cumulus 1 had extensive help screens built into the package, it had an installation package, and produced a main screen when it was running that summarised the weather and gave access to all the settings and editors. This made Cumulus 1 very user friendly in an age when personal desktop computers were the device for everyone to want. |
|||
*The functionality of Cumulus grew and grew, there were a few bugs, and a few mistakes, but generally Cumulus software had a high reliability, and grew in popularity. |
|||
* Cumulus got a major boost to its popularity when weather station sellers introduced web sites and provided functionality for customers to add their own reviews. Such reviews started to suggest that instead of using the software provided with a weather station, people should try Cumulus software as it would give them more functionality and more flexibility. |
|||
*Increased popularity meant an increase in demand for more functionality. Steve Loft had to introduce a register of enhancement requests (he lost it when he moved Sandaysoft to a different hosting provider) to track all the suggestions. It is easy to guess that Steve Loft, who had a full time job and did Cumulus as a hobby, probably had mixed emotions. I'm sure there was pride because people were praising his "baby", but he could not keep up with the growing list of suggestions, and he must have felt at times that all his time outside work was being spent using the developement environment working on a single one of his planned software projects. |
|||
*Steve must have really enjoyed the popularity of his software and the interaction with Cumulus Users, because it seemed his responses to posts on the support forum were made almost 24/7/365. (In total Steve made 26,702 posts on the forum, and probably 2/3 of those were responding to users of his software). |
|||
*In August 2009, Derek Jamieson, created this Cumulus Wiki, and Steve frequently suggested people should look there for a solution instead of asking him by email or by posting on the forum. However, Cumulus was still growing in popularity, and the posts asking for help on the forum just got more and more numerous. |
|||
*The development environment software that Steve was using for Cumulus 1 became more and more expensive to subscribe to, and Cumulus 1 became "donation ware" rather than "freeware". Although the total value donated was not made public, it is unlikely it covered the costs incurred on the software needed to create the environment in which Cumulus was being written. |
|||
*Cumulus 2 (see below) was therefore born, as a replacement for the original Cumulus using one of the new (cheap) development environments for C# that were becoming available. |
|||
*Cumulus 1 development was halted for a while by the focus on Cumulus 2 that would run on multiple operating systems. |
|||
*Cumulus 1 development restarted when Cumulus 2 development (see below) was aborted. |
|||
*Subsequently the expensive development environment for Cumulus 1 was made obsolete and ceased to be available, so all development of the original Cumulus had to stop. |
|||
*The Windows operating systems were changing, Steve was spending less time at his PC, and more time on his tablet, so he needed to start a new flavour of Cumulus (and you can read about Cumulus 3 below). |
|||
* The last Chapter for the original Cumulus is that Steve Loft decided not to release source code for Cumulus 1, so nobody else can develop Cumulus 1 any further. |
|||
*Consequently, Cumulus 1 functionality can not be changed, and without knowledge of how it was written, there is no ongoing support, just the experience of those who have used it, or are still using it. |
|||
*Fortunately, Steve Loft documented Cumulus 1 very well in the Cumulus support forum, and by his contributions to this Cumulus Wiki. |
|||
== |
== Forum reference == |
||
Steve Loft published a table showing comparison between output date modifiers for Cumulus 1 and MX at [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=17888 Cumulus MX forum]. The table there was based on the table that appeared in this Wiki when only the original Cumulus existed, so it was designed to help people migrate to his MX beta, it was not intended as a definitive list of what modifiers were available for MX (Steve instructed people to look them up on some Microsoft sites). |
|||
This is intentionally a brief section, it does not cover all that was available in Cumulus 2, but just how it influenced MX. |
|||
The subsequent comments in the forum suggested his layout got people confused. Most of that confusion came in two circumstances: |
|||
*Steve Loft produced a Cumulus 2 where he tried to start again in September 2009. It was written in C# (which is the language used for MX), and it is fair to say that Steve did not find that new programming language easy, and in March 2010 he was really struggling to make Cumulus 2 work how he desired. |
|||
*When someone wanted to use one date or time modifier on its own |
|||
* Cumulus 2 did prove that a number of concepts (like separating "engine" from "admin interface") could work, and it was a useful learning curve for when Steve decided to write Cumulus 3 (see below). |
|||
*When someone who had been using Cumulus 1 swapped to MX and wanted to replace a combination of output modifier characters that was not explicitly shown in his table. |
|||
*One change that had been requested by several Cumulus 1 users was for better international viewing of web pages, with less dependence on time zones. To achieve this, one suggestion was that Cumulus should work in GMT (more widely replaced now by UTC, which is not technically identical with GMT). Cumulus 2 therefore read and logged all readings by UTC. Unfortunately, converting from local time used by weather stations, and most computer devices, never worked as smoothly as Steve Loft hoped, so this is one idea that was not adopted for Cumulus 3. |
|||
* Furthermore, Cumulus 2 never succeeded in getting some of the basic functionality like driving web pages to work reliably, so it never offered much of the more useful functionality of Cumulus 1. |
|||
*But it was a good testing ground for new functionality and enhancements and regardless of whether they could be made to work fully in Cumulus 2, some were highlighting what Cumulus 1 lacked. |
|||
*In August 2010, the new features being tested in Cumulus 2 were added to Cumulus 1, and Cumulus 2 was discontinued. |
|||
That all comes from the fact that when a MX modifier consists of a single character it can mean something different to when it appears with other characters. |
|||
== Cumulus 3 == |
|||
In Cumulus 1, "m" or "M" had two meanings depending whether it was combined with "H" or "h" (when it represented minutes), or on its own or with any other code (when it represented month). But for Cumulus 1, there is no other case where it matters what context a modifier is put in by the use of other modifiers, and no other modifier takes more than one meaning. |
|||
*Steve Loft wrote and developed Cumulus 1, 2, and finally MX, while he was in Scotland, he did move a few times, but most development happened on Sanday, hence '''Sandaysoft''' became his name for his creations, he did experiment with some non-weather software, but Cumulus stayed his main hobby. |
|||
*In 2015, Cumulus 3 (also initially known as MX, and 'MX' is what was adopted once it was made available to users), was experimental and it had limited functionality, much less than was available in Cumulus 1. This made MX innovative, but unfriendly. |
|||
*Consequently, at that time, most Cumulus users were using Cumulus 1, and just those eager to take part in beta testing (perhaps because they wanted to move to Linux operating system) used MX. |
|||
*Steve Loft started development of MX while he was still in full-time employment, but as retirement approached he worked fewer days per week. Consequently, he was faced with the question as to whether to spend his time on MX development, or to focus on spending time with his wife, Beth, exploring places. |
|||
*When he fully retired, a life on the road beckoned, and they started travelling. Work on MX decreased, and work on Cumulus 1 was no longer possible, as he was limited to what his laptop and internet connection at stops could cope with. |
|||
*Various people offered to help him with MX if he was willing to make his source code available. Initially, Steve was keen to protect his intellectual property. He did not want anyone else to interfere with his creation. |
|||
*When he and his wife found a new home in France, there was no longer any doubt, the priorities changed in favour of a focus on his new life. Having decided to make the source code for MX available (he no longer had the development environment for editing Cumulus 1, and he had aborted Cumulus 2), Steve was able to forget about further development of MX. Indeed the [[Software|source code]] he released included various feature that were developed prior to the last MX release he made available. |
|||
*Steve Loft was closing down his Sandaysoft.com host, so the software source, and release code, had to find a new home, as did this Wiki. SaratogaWX (Ken True) has taken over (see [[CumulusWiki:About|Cumulus Wiki: About]], and agreed to also the host source code files as they were at time of handover. |
|||
*Some information was copied from the support forum to the new Wiki host, as at the time of Wiki transfer it was unclear whether the forum would remain available. |
|||
*Sandaysoft.com also hosted the support forum. Freddie (Niall Hosiene) took over the hosting of the forum the month after Ken True took over Wiki. |
|||
*The various people who had offered to help develop MX now were able to see the source code and decide whether they really did want to get involved. |
|||
*One programmer launched Cumulus 4, a new approach. Work continued on this for a while, but as far as I know it never made it into a working system, and I believe like Cumulus 2, it is abandoned. |
|||
*Other programmers looked at the source and thought we can make MX useful by adding the missing functionality, both what Steve added in the source but never got into a public release; and the functionality that makes Cumulus 1 so popular but is missing in MX and makes it difficult for those who are using MX. |
|||
In MX it is much more complicated, to take a few examples "D", "H", "M" represent different items on their own to what they represent when combined with other characters. That other character can be as simple as using a space or a "%" to modify the meaning of the character. |
|||
== The MX future == |
|||
Looking at the tables, now included above, you can see "G" is used on its own because it represents a full date-time specifier. "D" is similarly used on its own represents the long date format. If we only want the day of month number we must use "%d" to avoid the meaning of short date format that "d" on its own represents. |
|||
* Mark Crossley was one of those who tried updating the MX source and producing a new release. |
|||
* In 2019, he made a successful first new release, and then focussed on adding some of the missing functionality. By 2020, he was not just adding in his own version of features that had been in Cumulus 1, he was also making MX talk to new weather station designs and deal with new sensors. |
|||
* '''During 2020 much extra functionality has been added to MX''', and MX is now able to persuade [[Moving from Cumulus 1 to MX|Cumulus 1 users]] that it might be the right time to make the swap to MX. |
|||
*Cumulus 1 was designed to work with weather stations that were available when it was written, the technology used by stations, and the models available, have both been changing since then. |
|||
*The ongoing development is adding lots more functionality into MX, it can do a lot more with the the numbers it reads from weather stations, and it can be updated when weather station features change. |
|||
*Therefore, the advice to newcomers is to use Cumulus MX, sometimes called Cumulus 3, because there was a Cumulus 2 (that was abandoned) and sometime ago there was a start on a Cumulus 4. |
|||
*Similarly, the advice to established Cumulus 1 users is you should now consider a move to MX as you are now missing out on many features available only in MX. |
|||
If we want the typical Cumulus date-stamp of day of month number and month, then we have two choices, because both "d M" and "M" will work. This illustrates how "M" has a different meaning on its own and with another modifier. |
|||
Hopefully, the way that information is now presented on this page makes any use of parameters for web tags much easier now. |
|||
It would be wrong not to repeat what Mark has said here - '''MX is still not bug free, there is a lot more to correct as well as all the enhancements to cope with new weather station hardware'''. |
|||
Revision as of 22:42, 13 December 2021
![]()
This Wiki page applies to both flavours of Cumulus currently available.
Introduction
This page is about parameters used for modifying Cumulus web tags.
A Cumulus Template File is the name given by Steve Loft to any files that contain web tags. Each of those files need to be processed before they actually include values:
- MX avoids using these template files, the code itself internally generates most of the data files that are sent externally.
- The legacy Cumulus 1 software, and MX releases up to release 3.9.7 - build 3107, used lots of template files (see Customised templates.
For Cumulus MX, there is still one Cumulus template file, the web tags that supply values to the various tables in the Default Web Site are stored in websitedataT.json file. Most of those web tags use the default output format, but a few use some of the #Output modification parameters listed below. To customise the default web site, you might want to edit websitedataT.json, by using information found on this page.
To set context, let us learn the terminology with cross-references to where those features are explained further.
What is a web tag?
Put simply, a web tag is included in a Cumulus template file to indicate where Cumulus should insert values when it processes that template and produces an output file.
The output file can be:
- a web page,
- a JavaScript Object Notation (.json) file
- a JavaScript file,
- a PHP script file, or
- a eXtensible Mark-up Language (XML) file.
General Format for Web Tags
In the position in the template file where Cumulus is to insert the relevant data, place a web tag in the general format specified here:
<#tag_name [optional input selection parameters] [optional output modification parameters]>
Case sensitivity for tag names
The tag_name in the general format above is case sensitive, so please type the tag name exactly as shown in the tag name columns in the tables on the tag names page.
What is a web tag parameter?
Now we get to the terminology for what this Wiki page will document.
The parameters shown in the general format above are of two kinds:
- Input modifying
- Output modifying
You can include both optional input modification, and optional output modification parameters
- As the general format above shows, you 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.
Case sensitivity for parameters
The optional input modification parameters always use lower case, so please type them exactly as shown in the section below.
The content of optional output parameters are only case insensitive when used in Cumulus 1.
For Cumulus 2 and later, so this includes MX, the output parameters are case sensitive and also dependent on what other output formatters are being used if any, so please read the sections on output parameters and study the examples in the tables carefully.
Input modification Parameters
Most web tags do not require any input parameters. Luckily, where they are needed, it is quite simple to use them, see table below.
- 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 select the value you want to see.
- The web tags that can use input modification parameters will depend on which Cumulus release you are using
| Tag names | Values Available | Input Modification Parameters | Introduced | Examples | Description |
|---|---|---|---|---|---|
| Tag names listed at Table of Recent History tag names available (see Recent history page for explanation) | 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.
|
Cumulus 1.9.3 beta build 1033 (remain available in MX) | Examples for outside temperature:
|
All values supplied for parameters must be whole numbers.
|
| 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 (remain available in MX) | <#ByMonthDewPointH mon=3> is highest monthly dew point for any March and <#ByMonthDewPointHT mon=3> is the related time and date.
<#ByMonthTempH mon=3> gives highest temperature in any March, <#ByMonthTempHT mon=3> gives the date and time for that highest temperature |
Only one input parameter applies:
Use without an input parameter applies 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. |
| Only <#SunshineHoursMonth> and Only <#SunshineHoursYear> | Values available for current month/year, and for past month/year | Listed web tags take: r=-ww (note minus sign and up to 2 digits)
Omit input modification parameter to get value for current month/year |
MX release 3.12.0 | Monthly examples:
Yearly examples:
|
Returns the sunshine hours total in selected period
(You need a sensor to be monitoring this throughout selected period) |
Output modification parameters
This page does not tell you which web tags fall into each of these 3 types:
- A few web tags always need an output format specifier
- Some web tags ignore any output format specifier as they have a fixed output format
- The majority of web tags have a default output if there is no output format modifier, but accept an output format parameter, so you can change what they output.
To make life more complicated, the availability of output format parameters for particular web tags is dependent on which Cumulus release you are running. There is a general discussion about applicability, but that needs updating as it does not specify dependencies for individual web tags.
If you are using MX:
- if your locale specifies that integer and decimal parts of real numbers are separated by a comma, there is an output parameter to replace that decimal comma by a decimal point for any script that does not recognise decimal commas
- there are two output modifiers for changing number of decimal places
- there are multiple output modifiers for changing date and/or time format
If you are using the legacy Cumulus (or a very early MX release), please skip to #Two Output (format modifier) parameters for decimal places as the changing decimal comma into decimal point parameter is not available to you.
Each of these will be explained in turn.
Output Modification Parameter for changing any decimal comma into a decimal point
General format: <#tag_name rc=y>
This only applies:
- if the web tag name represents a real number with integer and decimal parts
- if you are using MX
- From beta release 3.0.0, build 3047 (3 February 2019), up to and including release 3.5.3, only implemented on a few new web tags (#MoonPercent, #MoonPercentAbs, #MoonAge)
- From release 3.6.6 onwards (1 June 2020), it was extended to other web tags that output real numbers.
- From release 3.10.5 onwards (29 March 2021), the use of <#tag_name rc=n> became also possible, to ensure decimal comma shown when locale specifies it
This output modification format parameter can be used 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).
| Parameter | Explanation | Example |
|---|---|---|
| rc=n | This is the default, so does not need to be specified. The output from the web tag will use either decimal comma or decimal point as specified by the locale in which MX is running
For more information about how the computer determines whether decimal commas is your default, see #Locale section later. |
Both <#tempYH> and <#tempYH rc=n> will return yesterday's highest temperature using what is specified by locale to separate integer and decimal parts |
| rc=y | 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. | <#tempYH rc=y> will return yesterday's highest temperature as integer part then full stop then decimal part, regardless of local |
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).
Controlling the number of decimal places
Internally, Cumulus stores numbers in binary. You cannot represent base 10 decimal places exactly in base 2.
Therefore, Cumulus stores to a precision that would generally give about 24 significant figures when expressed in base 10.
Cumulus is written to assign particular numbers of decimal places to any outputs it makes, and in any logging of current, or extreme values (for day or longer periods). It determines these precisions, by reference to the units chosen for outputs.
From release 3.12.0, you can set the default number of decimal places to output for all derivatives of temperature, pressure, etc. by advanced settings. Those settings can force output as integers, stopping these modification parameters from working.
As handling of each web tag is coded individually, the number of decimal places output by default in any web tag might vary slightly from the above default. As Cumulus has been developed, people have commented that these defaults do not reflect the precision of their instrumentation (weather stations used with Cumulus tend not to have the accuracy of those used by meteorologists, or are not recalibrated as often).
This section (and its subsections) only applies to tag names that output real numbers (with integer and decimal parts). You can't change anything that is output as an integer, or is text with these parameters, nor can you change the decimal places for any time element.
Consequently, gradually Cumulus has allowed more and more of its output to take an output format modifier that allows people to control number of decimal places shown.
Two Output (format modifier) parameters for decimal places
From release 3.10.5 (which did a big rewrite of web tag handling), you can modify real number output for individual tag names, using output modification parameters in either of the following formats:
- <#tag_name dp=i> and
- <#tag_name tc=y>
These can be applied to any tag names that represent real numbers (with integer and decimal parts).
Rounding to a specific number of decimal places
dp=i is used for both Cumulus 1 and MX.
- The value i following the attribute dp is an integer, it represents how many decimal places you want for the output you see.
This functionality was trialled in the original Cumulus, but has been properly implemented in MX.
If you are using the legacy Cumulus (1.9.4), only <#latitude dp=i> and <#longitude dp=i> were able to be output with "i" denoting number of decimal places, e.g. <#latitude dp=5> gives "59.24250".
If you are not using latest MX release, you may find this is not available for particular web tag names
- From beta releases (3.0.0) onwards, <#latitude dp=i> and <#longitude dp=i> were able to be output with "i" decimal places
- But this output modification parameter could not be applied to any other tags in the MX beta.
- MX when it came out of beta, added this output modification parameter usage in the moon tags <#MoonPercent> and <#MoonPercentAbs>).
- Specifically, <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234"
Truncation of unwanted decimal places
This output format modifier is only available in MX.
tc=y is the truncation parameter, the attribute tc takes the value 'y' to remove decimal places by truncation. e.g. <#MoonAge tc=y>.
Whilst many people want Cumulus to round output as done by the previous parameters, there are circumstances when rounding down (or truncation) gives the result desired.
- If you are using an early release of MX, you will need to research whether this is available for particular tag names
- Later releases of MX implement this for any tag that by default outputs decimal places.
Note, truncation by MX converts real numbers to integers. There is no option to truncate to one decimal place, Airports are expected to report air field level (QFE), and sea level (QNH), pressures truncated to one decimal place rather than rounded.
Multiple Output Format Modifier parameters for times and dates
These are highly complicated, and so have been left until after the simpler ones!
To start with a simple example, suppose you want date/time in ISO 8601 format:
- This means, something like 2019-02-28 06:59:05.
- Take the tag name (from tables on Webtags page)
- Next check in #Which tag names take date/time output formatting modifiers to see if that tag accepts both time and date modifiers
- If our tag name does accept both date and time modifiers, simply modify the web tag as shown here
<#tag_name format="yyyy-MM-dd HH:mm:ss">where tag_name is set from step 1, but all the rest is typed as shown. - To explain each element in that format value, look in #Year formats, #Month formats, #Day formats, #Use of spaces, #Time formats.
Should you want a different date/time format, then the sub-sections just referenced should help you to select a different arrangement, although there are some more options in #Date formats.
Which tag names take date/time output formatting modifiers
There are nearly a thousand different tag names.
There are a few time-related tag names labelled as being fixed format, that means any time/date output modifiers you might try would be ignored.
Some tag names, although it can be hard to tell which, report durations. You can use time modifiers to change how these are reported. Examples include <#daylength format=H:mm:ss> and <#MonthDailyRainHD format=H:mm>.
Time modifiers can also be used to change the way that clock times are reported, you might only want the hour, or you might (if resolution is available) want to also see seconds. The webtags page has columns headed "Time" to clearly identify all tag names that report clock times.
There are some tag names (e.g. moon rise) that relate to an event that does not happen each Earth day, so those tags have to be able to report "--:--", and you cannot modify their output.
There are some tags (e.g. highest temperature range in month/year), for which Cumulus has been coded to report "--" for value, and "--:--" for time, on the first day of that period (because there is only a partial day to consider you might not yet have experienced a true maximum and a true minimum), so modifying the time output can only be done on subsequent days.
It is not practical to indicate which time/date modifiers are accepted on a tag by tag basis. It would involve a lot of repetition. Instead, the following table, explains much more simply, which web tags will accept time and/or date output modifiers:
| Cross-reference to table on web tag names page | Tag names that accept only time output modifiers | Tag names that accept only date output modifiers | Tag names that accept both time and date output modifiers |
|---|---|---|---|
| Any tag names that don't report times nor dates | None | None | None |
| Webtags#No_Commas | None | None | None |
| Webtags#Date_.26_Time, Webtags#Day/Night/Sun/Moon | Only <#timehhmmss>, <#minute>, <#hour>, <#sunrise>, <#sunset>, <#dawn>, <#dusk> | Only <#LatestErrorDate>, <#date> (but no others) | Only <#LastDataReadT>, <#time>, <#metdate>, <#metdateyesterday>, <#update>, <#LastDataReadT> |
| Webtags#Today, Webtags#Yesterday | Any tag name in "Time" column of linked table | None | None |
| Webtags#Monthly, Webtags#Yearly | Any tag name in "Time" column of linked table in first column | Any tag name in "Date" column of linked table in first column | None of the tag names. For explanation see the ^ below this table |
| Webtags#All_Time, Webtags#Monthly_All_Time_Records | None (all tag names combine both time and date) | None (all tag names combine both time and date) | Any tag name in "Date/Time" column of linked table |
| Webtags#Davis | None | <#StormRainStart> only | None |
^ For the monthly and yearly web tags, the date and time are in separate tag names. It is not possible to get both time and date out of either tag name.
Note: There are some monthly/yearly web tags (e.g. wettest day) where a date tag is available (i.e. <#MonthDailyRainHD>), but there is no time tag. As explained before, in that wettest day example <#MonthDailyRainHD format=H:mm> returns the duration in hours and minutes since rollover for which rain continued to increase on that date, not the clock time. For rainfall, only <#LastRainTip> can have output modifiers added to report a clock time.
Locales
The default format for many tag names reporting date and/or time is dependent on the locale you are using for running Cumulus (1 or MX).
The effect of some output format modifiers is also dependent on locale.
For MX running on most operating systems (and therefore using Mono), type locale to see the default locale that will be adopted when mono-complete is installed as MX will, by default, take locale setting from Mono. When you start MX, you can ask it to use a different locale to that picked up by Mono, by adding the parameter "-lang locale-code", see examples at MX_on_Linux#Parameter_for_changing_Locale. For example, the Australian English language with UTF-8 encoding locale is defined as: en_AU.UTF-8.
The available locales on your computer in Linux are listed by locale -a. For example, the Russian locale would be selected as the one your computer uses for the current session only by using LANG=ru_RU.utf8 either typed into a terminal session before you start MX, or used as a parameter (preceded by "-") as you start MX interactively.
For permanently changing the locale used by your system, the instructions vary considerably according to the kernel used in your operating system, so you need to look up the instructions for yourself. However, if you have a graphical user interface, such as the full Raspberry Pi Operating System provides, you might have a configuration command in terminal mode and a configuration app accessed (within Preferences) from the "Raspberry" key on the official keyboard. For the Raspberry Pi, please read Raspberry Pi computer page for more details.
For Microsoft Windows Operating Systems, a Language is defined within the "Region" page of the Settings app. That should be sufficient for the legacy software that uses Delphi.
However for MX date and time formats within Windows Operating System, you must use the older Control Panel (go to "Clock and Region" screen, choose "Change date, time or number formats", choose "Language preferences") because it is only there that you can adjust all the defaults used by .NET.
Time zones
Before I explain what time/date output modifiers can do, something they can't do.
All web tag outputs are in local time, except <#timeUTC>.
Although Cumulus 2 internally stored all date/times in UTC, no flavour of Cumulus is currently able to output the time-stamp for any weather extreme in UTC, if your current time is not in UTC.
However, for MX only, you can use a script to convert a time to UTC. This is not the place to tell you how to write the script, but taking time of highest pressure today as an example, you would use <#TpressTH format=Hh:mm> and <#TpressTH format=zzz>, the first gives hours and minutes in your local time, and the second gives the offset that needs to be applied to that time to convert it to UTC.
Time resolution
For the legacy software, there may be no point in asking for seconds, as Cumulus 1 did some actions at one minute intervals.
If Cumulus obtained archive data, as part of the catch-up process it can do when it restarts, any time-stamps for that period can only be the time of a particular archive record, so that might be every half an hour, but not aligned precisely with hour changes.
Dependency on Cumulus flavour
You cannot,in general, use the same date/time formatting for both the original (legacy) Cumulus and MX.
All the tables explaining what is available, attempt to show what is used in each flavour for each type of output, both by including separate columns for each flavour, and by giving examples in each flavour.
For the legacy software
I deal with this first, just because it is simple!
From version 1.9.1, most web-tags that report any form of time or date will accept an optional 'output format' parameter (we have already seen whether this can only affect time, only affect date, or both).
The legacy Cumulus uses Delphi to interpret the output modifiers:
- For most modifiers, a particular character produces the same output regardless whether the output modification specifier is in capitals or lower-case
- There is an exception, the case you use for any am/pm output format modifiers determines the case that is output.
- In general, the context of a modifier does not affect the output it produces
- Again, there is an exception, "m" or "M" has two different meanings (minutes or month) depending on context.
The complications with MX
Cumulus MX works internally with dates specified in either a day before month before year format, or ISO 8601 date format where year comes first (yyyy-MM-dd) depending on context. Compatibility with the legacy software has so far meant while the *.ini Files have adopted the year first approach, the *.txt Files have stuck to date formats as used in the legacy definitions.
For Cumulus MX output formatting, the date and time modifiers are complicated by the fact that the same character can have 4 different meanings depending on its case (capital letter or lower-case letter), and depending on whether it is on its own (standard format) or with another modifer (custom format). Sounds confusing? Well it is complicated.
Consider context first:
- <#tag_name format=x>
- If the x in the above general syntax is a single character, it represents a standard format code
- The standard characters for dates and times are defined at standard-date-and-time-format-strings
- <#tag_name format=xyz>
- If the xyz in the above general syntax is replaced by two or more characters, it becomes a custom format code (combinations of characters, or single characters prefixed by %)
- The custom characters for dates and times are defined at custom-date-and-time-format-strings
Consider case next:
- Cumulus MX (when running on Windows) uses the .NET software which is provided as standard by Microsoft Windows.
- ".NET" was originally operating system independent, later only Microsoft Windows specific components were included, but since November 2020 ".Net" is used for an operating system independent version that originally Microsoft issued under another name!
- (actually it is possible to install and run "Mono" in Windows Operating Systems).
- If Cumulus MX is running on any Linux distribution (including Raspberry Pi Operating Systems) or Mac OS X, or any other device that uses an UNIX derived operating system, then MX uses Mono software for same purposes. (MONO is a operating system independent version of .NET, although they are developed independently, they have common origins).
Use of spaces
There are multiple symbols for specifying dates and times, and you might want spaces to appear between symbols in that output format.
You need to add quotation marks to the output format specifier if spaces are present.
The first complication is that the parser that interprets time/date characters has two ways of interpreting a space character, depending on what immediately follows. In the tables, below, I have used a "%" in various places. In any of those places, a space is not a gap between characters, but an alternative to "%". I discuss this later in #Migrating from legacy Cumulus 1 to MX section.
For a space character to be interpreted as a gap between symbols, the symbol that follows the space must include at least two characters. The syntax <#tag_name format="x y z"> works if the y and z in it are representing multi-character symbols. To explain this, an example is <#TpressTH format="h:mm tt"> as both h:mm and tt are multi-character symbols, we have inserted a space after the minutes.
If we have single character specifiers, then a space has to be enclosed in single quotes to mark it as a literal, not a modification of the subsequent single character. To explain this, a simple example is <#MonthPressHD format=" d' 'M">, here the month number is a single character "M", so to insert the space we have to treat it as a literal by enclosing the space character in single quotes and the whole specifier in double quotes.
Literals are discussed fully in the #Including literals in format parameters sub-section later. If we want to include other characters not to be interpreted by the date time parameter parser, and spaces, then both double and single quotes must be used, and the spaces must be within the single quotes. An example, that shows all the options that MX allows, with literals is <#TpressH format="\a't 'h:mm' ' tt' <small>on 'd/M/yyyy' </small>'"> .
Finally, the use of literals can cause you a problem if you want to use a date/time specification in a script because the script wants literal delimiters outside any web tags, so that delimiters remain when the web tag itself has been processed into a string by Cumulus. This means the type of quotes (single or double) used outside the web tag, cannot be used within the web tag. The complicated sounding (but actually simple solution) is to avoid placing literals, and/or spaces, within any output format specifier, instead put single quotes round the whole content. What you thought of putting as literals within any web tag is instead typed outside with separate web tags for the part of the specification before and after each literal. An example to make this clearer is $MXDateTime = '<#date format=yyyy-MM-dd>' . 'T' . '<#time format=hh:mm:ss>';, which is written in PHP Hypertext preprocessor format, the literal 'T' has been inserted between two separate web tags.
Year formats
These are the simplest output format modifiers. We choose from 2 options, and because both involve more than one character their context does not matter. Although the legacy Cumulus will accept upper case as meaning same as lower case, it is simplest if we just show the lower case options needed for MX:
| Specifier | Displays | Example |
|---|---|---|
| yy | Displays the year as a two-digit number (00-99). | 19 produced by <#LastDataReadT format=yy> |
| yyyy | Displays the year as a four-digit number (2000-9999). | 2009 produced by <#LastDataReadT format=yyyy> |
Month formats
All locales offer both numerical and alphabetical formats for representing months.
- In the following table "MMM" is shown as producing short month name.
- What language is used, and what characters appear, depend on what is set up for your language in your settings (by default or by you changing your settings)
- In British English (UK) locale this will be the appropriate 3 letter abbreviation that starts with "Jan" and runs to "Dec"
- It appears that language settings in many locales (not "en-gb"), add a full stop to any abbreviations
and in that case the 3-letter "MMM" is turned into a 4-letter output (e.g. Australia settings default would output from "Jan." to "Dec.")
- MX has been coded to remove that full stop in various places (like in standard log file naming and NOAA report naming), but at the time this section was edited, "MMM" still reports the full stop in a web tag output if your locale uses it
- In the following table "MMMM" is shown as producing the full name for a month
- The output you get will depend on the language defined in your locale
- In English locales, the output will be in the range "January" - "December"
Day formats
All locales offer both numerical and alphabetical formats for representing a day.
The table below relates just to the day part of any date specifications.
| Displays | Example | ||
|---|---|---|---|
| d (single character) | %d | Displays the day as a number without a leading zero (1-31).
|
27 produced by: |
| dd (2 characters long) | dd | Displays the day as a number with a leading zero (01-31). | 07 produced by <#metdate format="dd"> |
| ddd (3 characters long) | ddd | Displays the day as an abbreviation (in UK English will output Sun-Sat) using the strings appropriate to the Locale.
As for month above, the short day names that are generated depend on your locale, so you might see additional punctuation defined for abbreviated names in some locales. |
'Wed' produced by <#metdate format="ddd"> (English locale) |
| dddd (4 characters long) | dddd | Displays the day as a full name (Sunday-Saturday) using the strings appropriate to the Locale. | 'Friday' produced by <#metdate format="dddd"> (English locale) |
Date formats
The #Year formats, #Month formats, and #Day formats listed above can be combined to make up a date output modifier, but there are some other modifiers available that can produce whole dates.
#Locales will define a Short Date Format and a Long Date Format. You will see references to those in the table below explaining available output format modifiers, for example the single character output format modifier (G or c) listed at the start of the table below.
If you are in the USA, Cumulus will not use your month first date internally or in any files in the data sub-folder, but you can see your preferred format asan output from web tags, as you can can combine the month specifier, with the day specifier, in that order, to get an output where the month appears first (see example in table below).
Please could an American contributor please check if the "M" modifier works for their locale as shown and update the table below.
Time formats
Here context matters, so both standard (single character) and custom (two or more characters) formats are shown in the following table. As explained earlier, time formats can be used with durations and clock times.
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. If you want to include what is shown in square brackets you don't type the square brackets e.g. <#LastDataReadT format="h:nn am/pm">
Some Extra Information
Having covered the basics of both date and time modifiers above, it is time to talk about incorporating other information in an output modifying date/time format specification.
Basically, we can include literal characters, and we can include HyperText Manipulation Language tags, in our specifiers.
Finally, there will be a section on migrating from the legacy Cumulus to MX and how to modify the web tags in your templates to keep them working.
Including literals in format parameters
#Use of spaces explained how double quotes were needed for date/time output specifiers containing spaces. It briefly talked about including literals, and we will expand on that now.
Consequently, you cannot include double quote characters in any other position (see here for work-around).
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. In MX, such single quotation marks should include the spaces round the additional literal text.
- 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.
Example of valid syntax: <#TapptempH format="'at 'h:nn' 'am/pm '<small>on' d/m/yyyy'</small>'">.- See next sub-section for more information on incorporating HTML if you are using MX.
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!
Using HTML tags within format parameters (available in MX only)
Example using a class to change the look of part of the output
<#TapptempH format="dd' 'MMM' 'yyyy'<span class=\'xx\'> at 'HH:mm'</span>'">
the output from this will look like 04 Dec 2018 at 10:12
Note where the quotes are, and where you need to use '\' escape characters.
Example using HTML tags
<#RecentTS d=2 format="h:mm' 'tt'<small>on' d/M/yyyy'</small>'">
This puts the date in a smaller font than the time
Migrating from legacy Cumulus 1 to MX
If you have created any legacy cumulus template files, then in each template, you will need to do some editing. Everywhere a web tag appears with an output modifiers that is used to specify a date and/or time format, has to be edited before that template will work for MX.
Here are the main reasons:
- the reserved characters are different in C1 and MX (affecting use of literals like "on" and "at" that appear in many English time-stamps)
- the Delphi in legacy Cumulus is case insensitive, so for example "H" and "h" have the same meaning
- MX is case sensitive, and symbols mostly have different meanings when one symbol is used to when that symbol is used with others, so for example "H" and "h" have different meanings, and if not used with other symbols will need to be preceded with a "%" to have same meaning as they have in combination with other symbols
- In the legacy cumulus, a symbol like "d" has the same meaning for any tag
- MX is inconsistent, a symbol like "d" changes its meaning depending on the tag it is used with (e.g. the script conditional '<#metdateyesterday format=d>' == '<#yesterday format=d)>' will never be equal as the LHS returns a full date and the right hand side returns day of month only)
- the symbols used for representing such modifiers as minutes, month, am/pm, are different between C1 and MX.
- MX introduces the concept of escaping characters (a \ placed before a character can be either a control sequence or an instruction to display the character)
- In the legacy Cumulus, a space is a gap between characters
- In MX, a space must be within a literal, as a space before a symbol has the same effect as "%", (it changes the interpretation of a modifier character).
Confused even more now? I'm not surprised, but maybe some examples will help.
Examples
- Examples related to case selection
In Delphi, "nn" means "minutes" for Cumulus 1,
but "minutes" is "mm" for .NET or MONO in Cumulus MX.- The hour in 24-hour format with leading zero, in non case sensitive Delphi (Cumulus 1) 'HH' or 'hh' would be treated as same, but in .NET or MONO it must be "HH" (Cumulus MX).
- The hour in 24-hour format without leading zero, in non case sensitive Delphi (Cumulus 1) 'H' or 'h' would be treated as same, but in .NET or MONO it must be "%H" (Cumulus MX).
- For 12-hour specifiers, please see the table, as this is far more complicated.
You might be put off by references within .NET and MONO (Cumulus MX) to single/standard characters and custom modifiers, the following 3 examples may add clarity:
- For example, <#MonthTempHD format="d"> is a single character format modifier, therefore the 'd' acts as a standard modifier, and causes for a date of 22 July 2014 for the highest temperature in the month to be returned in the standard short date format e.g. '22/07/2014' (exact contents for any one date vary by locale).
- Similarly, <#MonthTempHD format="M"> is a single character format modifier and therefore the 'M' acts as a standard modifier and causes the date for the highest temperature in the month to be returned in the standard day and month format e.g. '22 July' (exact contents for any one date vary by locale).
- Whilst <#metdate format="d M"> is not a single character format modifier and therefore both the 'd' and the 'M' are interpreted as custom modifiers and cause the current date to be returned as a digit(s) for the day and a digit(s) month (in a without leading zeroes format) e.g. '6 7' would be returned for 6 July.
- Alternatively, <#MonthTempHD format="%d"> is NOT a single character format modifier, therefore the 'd' acts as a custom modifier, and causes a date of 22 July 2014 for the highest temperature in the month to be returned as the day of the month only '22' in all locales.
- Similarly, <#MonthTempHD format="%M"> is NOT a single character format modifier and therefore the 'M' acts as a custom modifier and causes the same date for the highest temperature in the month to be returned as the month number '7'.
In both Cumulus 1 and MX if you want a space character within your output, the output specifiers must be enclosed in double quotes. If that space character is next to a non modifier (e.g. around word "at") then the single quote needing to surround the at should be widened to include the spaces in MX, but Cumulus 1 does not care if single quotes excluded spaces. However, with MX, single quotes enclose multiple characters, but there is an alternative way to deal with some single verbatim characters to cover next.
So let us compare these two alternative ways that MONO and .NET escape any characters that are not being used as format specifiers.
- In
Delphi you can put the 'verbatim' characters inside single quotes (Cumulus 1); this is often used to (in English) include words like ' on ' and ' at ' in the formatted output. - in
.NET or MONO you can still use single quotes (as mentioned above extended to include adjacent spaces),
- but alternatively you can escape each verbatim character with a backslash as prefix (Cumulus MX).
- 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.
Past history for this page
This page is a complete redesign of how to present information that was previously on the Webtags page, so look there for past content by selecting "history" tab.
Trying to make the old design made for the original Cumulus software, work for MX which is now very different, made the old page unwieldy.
Forum reference
Steve Loft published a table showing comparison between output date modifiers for Cumulus 1 and MX at Cumulus MX forum. The table there was based on the table that appeared in this Wiki when only the original Cumulus existed, so it was designed to help people migrate to his MX beta, it was not intended as a definitive list of what modifiers were available for MX (Steve instructed people to look them up on some Microsoft sites).
The subsequent comments in the forum suggested his layout got people confused. Most of that confusion came in two circumstances:
- When someone wanted to use one date or time modifier on its own
- When someone who had been using Cumulus 1 swapped to MX and wanted to replace a combination of output modifier characters that was not explicitly shown in his table.
That all comes from the fact that when a MX modifier consists of a single character it can mean something different to when it appears with other characters.
In Cumulus 1, "m" or "M" had two meanings depending whether it was combined with "H" or "h" (when it represented minutes), or on its own or with any other code (when it represented month). But for Cumulus 1, there is no other case where it matters what context a modifier is put in by the use of other modifiers, and no other modifier takes more than one meaning.
In MX it is much more complicated, to take a few examples "D", "H", "M" represent different items on their own to what they represent when combined with other characters. That other character can be as simple as using a space or a "%" to modify the meaning of the character.
Looking at the tables, now included above, you can see "G" is used on its own because it represents a full date-time specifier. "D" is similarly used on its own represents the long date format. If we only want the day of month number we must use "%d" to avoid the meaning of short date format that "d" on its own represents.
If we want the typical Cumulus date-stamp of day of month number and month, then we have two choices, because both "d M" and "M" will work. This illustrates how "M" has a different meaning on its own and with another modifier.
Hopefully, the way that information is now presented on this page makes any use of parameters for web tags much easier now.