Webtags (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
Minor resequencing of page, and improvement to "today" explanation
m (Minor resequencing of page, and improvement to "today" explanation)
Line 1: Line 1:
[[Category:Terminology]]
[[Category:Terminology]]
Please be aware some content originally on this page has been moved to other pages.  Old posts on the support forum that used to link directly to the specific material, will instead bring you to this start of the page. Please see [[#Moved content]] for the new links to those items.
=Essential Background Reading=
If you have not used this Wiki page before, or are unsure about using "web tags", there are some concepts that you do need to understand in the sub-sections that follow.


<div style="background: LemonChiffon;padding:5px; margin:2px;">
<div style="background: LemonChiffon;padding:5px; margin:2px;">
Line 12: Line 17:
</div>
</div>


=Essential background reading=
==What is a web tag? ==


Although you could go straight to [[#The Web Tags for Cumulus]] later on this page, if you have not used this Wiki page before, there are some concepts to explain, and you need to be told that some content originally on this page has been moved to other pages.  Your attention is particualrly drawn to [[#Web tags mentioning (outside) temperature]].
Weather values are always changing, so Cumulus needs a way for you to tell Cumuluss to enter the current value for a particular derivative, when it is [[Customised_templates#What_is_meant_by_.27Cumulus_processes_templates.27|processing templates]].
 
<div style="background: LemonChiffon;padding:5px; margin:2px;">This page currently covers web tag names for legacy 1.9.4, and for MX up to release '''3.12.0'''</div>


==General Format for Web Tags==
==General Format for Web Tags==


In the position in any template file where Cumulus is to insert the relevant data, place a web tag in the '''general format''' specified here:  <pre><#tag_name [optional input selection parameters] [optional output modification parameters]></pre>
In the position, in any template file, SQL, or Custom HTTP, where Cumulus is to insert the relevant data, place a web tag in the '''general format''' specified here:  <code><#tag_name [optional input selection parameters] [optional output modification parameters]></code>


{{TOCright}}
===The optional parameters===


===Applicability to Cumulus 1 and to MX===
The terminology "optional" is used because some tag names do not accept any parameters, but there are some tag names where a parameter is mandatory. Therefore, check the [[Webtags/Parameters|web tag parameters]] page to learn whether a web tag name you find here requires a mandatory parameter, or to find out which parameters are optionally available.


Various approaches are trialled in the list for indicating which flavours a web tag exists forThe [[Webtags#Davis|Davis]] section has a column that indicates the applicability.  Other sections with more web tags use pink section headings to identify their applicability to the flavours.  Finally, there are some individual entries where '''C1''' and '''MX''' symbols are used to indicate applicability.
The tables of tag names that appear later on this page will seldom give any information about which parameters are mandatory or optionalThere are tables on the other page referenced above that help you to understand what parameters the various tag names accept, explain each of the parameters available, and give examples.


There is some more information on [[Webtag Applicability|Web tag Applicability page]].
There is a basic guide to what these parameters can do, and another link to the new page at [[#Input Modification Parameters and Output Modification Parameter]] later on this page.


===Input Modification Parameters and Output Modification Parameters===
===The tag names===


MX has introduced many more of these, so they are no longer listed on this page.
All the "tag_names" that are available in the release range shown below are listed in [[#The Web Tags for Cumulus]] later on this page:
<div style="background: LemonChiffon;padding:5px; margin:2px;">This page currently covers '''tag names''' for legacy 1.9.4, and for MX up to release '''3.12.0'''</div>{{TOCright}}


Now to find out what is allowed for the '''input selection parameters''' and '''output modification parameters''', refer to [[Webtags/Parameters|web tag parameters]] page.
For tag names available in the release you are using, see the next sub-section.


For just a taste, there you can discover:
If you are using a Oregon Scientific weather station, then you should read [[#Web tags mentioning (outside) temperature]] in the optional reading section.
* A score of input parameters that modify some of those tags (for example, by using one input parameter attribute with a value between 1 and 12, the same web tag names can give values for 12 different months)
* The components that make up output parameters (a guide to how you modify the output format)
** how to control number of decimal places
** how to control whether decimal comma (if used) is replaced by decimal point (useful for some script languages)
** the majority modify the output from almost all web tags that report a time and/or date (there are so many ways to represent times and dates this multiples up the available output considerably)
 
===Web tag names===
 
To find out what is allowed for '''tag_name''', see the various tables [[#The Web Tags for Cumulus]] later on this page.  Don't forget to check [[Webtags/Parameters|web tag parameters]] page to learn whether a web tag name you find here requires a mandatory parameter, or to find out which parameters are optionally available as the tables below are not able to indicate which of the billions of combinations possible (see [[#Scary statistics]]) are valid or invalid for particular tag names.


====General Tip====
====General Tip====


The web tag names available in the release/version/build you are using, can be listed (in Cumulus 1 or Cumulus MX) by adding the following line to [[Cumulus.ini#Section:_Station|Cumulus.ini]] in the [station] section...
The tag names available in the release/version/build you are using, can be listed (in Cumulus 1 or Cumulus MX) by adding the following line to [[Cumulus.ini#Section:_Station|Cumulus.ini]] in the [station] section...
<code>ListWebTags=1</code>
<code>ListWebTags=1</code>


Line 59: Line 54:
<code> ListWebTags=0</code>
<code> ListWebTags=0</code>


{{Version badge 1}}If you are using Cumulus 1, each build of that contains a build specific version of Cumulus Help, and within that help is a list of web tags with basic information on what each tag_name returns.
[[File:Badge v1.png]] If you are using Cumulus 1, each build of that contains a build specific version of Cumulus Help, and within that help is a list of web tags with basic information on what each tag_name returns.


[[File:Badge vMx.png]] MX bug: The inclusion of a web tag in the list produced by this instruction, does not mean that web tag is actually populated with valid information. See https://cumulus.hosiene.co.uk/viewtopic.php?p=153096#p153096 for an example.
[[File:Badge vMx.png]] MX bug: The inclusion of a web tag in the list produced by this instruction, does not mean that web tag is actually populated with valid information. See https://cumulus.hosiene.co.uk/viewtopic.php?p=153096#p153096 for an example.


====Web tags mentioning (outside) temperature====
===The functionality that can use web tags===
 
In the legacy Cumulus software, the only functionality that could use this was [[#Template files can create many types of file|the Cumulus template file]] used to provide data to a web server. That is why Steve Loft, the author of that software named them web tags.
MX has extended the use of these web tags, they can now be inserted into a [[MX_Administrative_Interface#MySQL_settings|SQL commands]], Custom HTTP, [[#The web tag application programming interface|application programming interface]], as well as [[#Template files can create many types of file|template files]].
 
The output file can be:
* 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.
 
=Optional Background Reading=
 
==Web tags mentioning (outside) temperature==


'''For Oregon Scientific weather stations using, either USB connections''' (e.g. WMR-200), or serial connections (e.g. WMR-928), that can have multiple temperature sensors, it is possible to configure which sensor the outdoor temperature (for which daily and longer period extreme records are maintained) is read from, by following this set of instructions originally supplied by Steve Loft:
'''For Oregon Scientific weather stations using, either USB connections''' (e.g. WMR-200), or serial connections (e.g. WMR-928), that can have multiple temperature sensors, it is possible to configure which sensor the outdoor temperature (for which daily and longer period extreme records are maintained) is read from, by following this set of instructions originally supplied by Steve Loft:
Line 82: Line 92:




'''For other weather stations''', the main outdoor temperature sensor is used for what is reported for current value, daily extremes, and longer period extreme records.  This temperature is also used for calculation of derived values such as Australian Apparent Temperature, Canadian Humidity Index, and USA Heat Index.
'''For other weather stations''', the main outdoor temperature sensor is used for what is reported for current value, daily extremes, and longer period extreme records.  This temperature is also used for calculation of derived values such as Australian Apparent Temperature, Canadian Humidity Index, and USA Heat Index. generate. This list only contains the tag_names, it does not indicate what parameters they can take, nor does it include the brackets the tag name is surrounded by when you quote it in a template file for Cumulus to process.
 
==Input Modification Parameters and Output Modification Parameters==
 
MX has introduced many more of these, so they are no longer listed on this page.
 
Now to find out what is allowed for the '''input selection parameters''' and '''output modification parameters''', refer to [[Webtags/Parameters|web tag parameters]] page.
 
For just a taste, there you can discover:
* A score of input parameters that modify some of those tags (for example, by using one input parameter attribute with a value between 1 and 12, the same web tag names can give values for 12 different months)
* The components that make up output parameters (a guide to how you modify the output format)
** how to control number of decimal places
** how to control whether decimal comma (if used) is replaced by decimal point (useful for some script languages)
** the majority modify the output from almost all web tags that report a time and/or date (there are so many ways to represent times and dates this multiples up the available output considerably)


== Why does MX talk about tokens? ==
== Why does MX talk about tokens? ==


MX uses a '''token parser''' to read the web tags and replace them with the correct value, so if diagnostic output refers to tokens, it is saying the attempt to actually work out what content to return to replace the web tag with its tag name and parameters has encountered a problem.
MX uses a '''token parser''' to read the web tags and replace them with the correct value, so if diagnostic output refers to tokens, it is saying the attempt to actually work out what content to return to replace the web tag with its tag name and parameters has encountered a problem.


==Scary statistics==
==Scary statistics==
Line 105: Line 127:


When MX came out of beta (3.0.0), it has been developing rapidly, as the statistics above suggest, the number of web tag names and input/output modification parameters, to document became too much for one Wiki page, hence the moving of all documentation about modification parameters to a sub-page.  There are still a lot of web tag names to document on this page, and separation into a number of pages was considered, but it is easier to have just one page to refer in answers to questions raised in the forum.
When MX came out of beta (3.0.0), it has been developing rapidly, as the statistics above suggest, the number of web tag names and input/output modification parameters, to document became too much for one Wiki page, hence the moving of all documentation about modification parameters to a sub-page.  There are still a lot of web tag names to document on this page, and separation into a number of pages was considered, but it is easier to have just one page to refer in answers to questions raised in the forum.
==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 produces an output file. The concept of [[Customised_templates#What_is_meant_by_.27Cumulus_processes_templates.27|processing templates]] is explained in another article.
===Template files can create many types of file===
The output file can be:
* 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.
.


==Still got questions?==
==Still got questions?==
Line 127: Line 132:
Full support is available via the support forum at https://cumulus.hosiene.co.uk/viewforum.php?f=40 for the latest MX release. Given that some users may still be running an older MX release, where possible any web tag listed below for MX indicates at which release it first became available.
Full support is available via the support forum at https://cumulus.hosiene.co.uk/viewforum.php?f=40 for the latest MX release. Given that some users may still be running an older MX release, where possible any web tag listed below for MX indicates at which release it first became available.


There is limited support available for Cumulus 1.9.4, but on this page every attempt is made to indicate which version of the legacy software introduced any web tag listed below as being available in the legacy software.  
There is limited support available for Cumulus 1.9.4, but on this page every attempt is made to indicate which version of the legacy software introduced any web tag listed below.  
 


 
==The web tag application programming interface==
 
=The web tag application programming interface=


[[File:Badge vMx.png]] Available from version 3.7.0 (build 3089) released 28 July 2020. It was proposed in January 2015, see Steve Loft [https://cumulus.hosiene.co.uk/viewtopic.php?p=101496#p101496 plan to add a call where you supply a list of items (probably web tag names), and you get back the equivalent data].
[[File:Badge vMx.png]] Available from version 3.7.0 (build 3089) released 28 July 2020. It was proposed in January 2015, see Steve Loft [https://cumulus.hosiene.co.uk/viewtopic.php?p=101496#p101496 plan to add a call where you supply a list of items (probably web tag names), and you get back the equivalent data].


== Where to use ==
=== Where to use===


This is meant for services either on the same computer as Cumulus or on your local network. It is not secure, and should not be available, nor requested, via any external network or the internet.
This is meant for services either on the same computer as Cumulus or on your local network. It is not secure, and should not be available, nor requested, via any external network or the internet.
Line 150: Line 152:
Each admin interface web page uses api techniques for all the information it needs. Some api calls are repeated with AJAX requesting updates for the weather information on a frequent basis, but each page has another api request that is issued just once for the version and build being used.  To my mind, the design of '''CumulusMX/interface/todayyest.html''' is crazy.  The HTML appears to have a table structure, but that table structure is overwritten by each repeating api. So every time AJAX repeats that api call it returns in json format the whole table definition as well as table cell contents, despite that much of that json (all that HTML defining table header, table rows, table cells, etc.; and the units for each value) does not change and it is only some values and times buried within the json in the api that actually might change (and of those half of them, the yesterday values and times only change once a day).  In some code I wrote (but later abandoned) I made use of the api calls that support the '''CumulusMX/interface/todayyest.html''' web page to get the units I wanted on another interface page, but I only called it once as it returned a lot of other information (as just mentioned) that I did not need. I later found a better way, as in example below, which gives me just what I need and no more.
Each admin interface web page uses api techniques for all the information it needs. Some api calls are repeated with AJAX requesting updates for the weather information on a frequent basis, but each page has another api request that is issued just once for the version and build being used.  To my mind, the design of '''CumulusMX/interface/todayyest.html''' is crazy.  The HTML appears to have a table structure, but that table structure is overwritten by each repeating api. So every time AJAX repeats that api call it returns in json format the whole table definition as well as table cell contents, despite that much of that json (all that HTML defining table header, table rows, table cells, etc.; and the units for each value) does not change and it is only some values and times buried within the json in the api that actually might change (and of those half of them, the yesterday values and times only change once a day).  In some code I wrote (but later abandoned) I made use of the api calls that support the '''CumulusMX/interface/todayyest.html''' web page to get the units I wanted on another interface page, but I only called it once as it returned a lot of other information (as just mentioned) that I did not need. I later found a better way, as in example below, which gives me just what I need and no more.


== "GET" approach ==
=== "GET" approach ===


You may have used GET as an attribute when defining the action of a HTML form.  Equally you might in a script language access the query-string part of a Universal Resource Locator to get parameters for what the script is to supply to the web page.  Even if you don't understand the meaning of those technical terms, you probably have seen when using a browser (in the box where a URL is entered) that sometimes the URL seen there has a query-string. You will have seen a question mark (?) followed by one or [separated by ampersand (&)] more '''name=value''' parameters.
You may have used GET as an attribute when defining the action of a HTML form.  Equally you might in a script language access the query-string part of a Universal Resource Locator to get parameters for what the script is to supply to the web page.  Even if you don't understand the meaning of those technical terms, you probably have seen when using a browser (in the box where a URL is entered) that sometimes the URL seen there has a query-string. You will have seen a question mark (?) followed by one or [separated by ampersand (&)] more '''name=value''' parameters.
Line 156: Line 158:
The GET approach to using the Cumulus general api works in this way indicating the start of a query-string with a question mark and using ampersands to separate names. The difference is that a tag name (or list of tag names) is used instead of a name=value parameter (or list of name=value parameters).  However, when the Cumulus api returns the values they will be in attribute=value format.  Therefore if (like example below) you are coding in JavaScript, what is returned is a JavaScript Object and you extract the values by specifying the Object name and the Attribute name. If that technical terminology confuses you, look at the example.
The GET approach to using the Cumulus general api works in this way indicating the start of a query-string with a question mark and using ampersands to separate names. The difference is that a tag name (or list of tag names) is used instead of a name=value parameter (or list of name=value parameters).  However, when the Cumulus api returns the values they will be in attribute=value format.  Therefore if (like example below) you are coding in JavaScript, what is returned is a JavaScript Object and you extract the values by specifying the Object name and the Attribute name. If that technical terminology confuses you, look at the example.


===Selecting values using GET===
====Selecting values using GET====


Suppose you want to get the values for the following three web tags:
Suppose you want to get the values for the following three web tags:
Line 179: Line 181:
If you are using the api in a context where it does not matter if decimal commas or decimal points are in the api or for any tags that don't report in real numbers, simply omit the '''rc''' as first item, and just include tag names separated by ampersands.
If you are using the api in a context where it does not matter if decimal commas or decimal points are in the api or for any tags that don't report in real numbers, simply omit the '''rc''' as first item, and just include tag names separated by ampersands.


=== JavaScript example ===
==== JavaScript example ====


Some people might feel the admin interface could be improved on some of its pages by showing additional information. It is possible from MX 3.7.0 to obtain extra information.   
Some people might feel the admin interface could be improved on some of its pages by showing additional information. It is possible from MX 3.7.0 to obtain extra information.   
Line 210: Line 212:
*The console.log command simply outputs all the items in the list within the brackets into the browser console that in many browsers is displayed by selecting '''F12''' on the keyboard. I included this instead of the lengthy rest of my code that uses the units to do the various calculations correctly.
*The console.log command simply outputs all the items in the list within the brackets into the browser console that in many browsers is displayed by selecting '''F12''' on the keyboard. I included this instead of the lengthy rest of my code that uses the units to do the various calculations correctly.


== "POST" approach ==
=== "POST" approach ===


The word "Post" in a computer environment means that the Hypertext Transfer Protocol (HTTP) used by the internet is being asked to transfer information enclosed in the body of the request message. Put slightly less technically in this approach you produce a text file with the details of what tags you want and send it to the api server.  I suppose it is a bit like sending an email, its header (subject, author, date sent) is easy to view, but you need to open it to see what text is in the body.
The word "Post" in a computer environment means that the Hypertext Transfer Protocol (HTTP) used by the internet is being asked to transfer information enclosed in the body of the request message. Put slightly less technically in this approach you produce a text file with the details of what tags you want and send it to the api server.  I suppose it is a bit like sending an email, its header (subject, author, date sent) is easy to view, but you need to open it to see what text is in the body.
Line 233: Line 235:
Here follow tables indicating what web tag names are available to be used, tables group them by the basic purpose of the tags listed.
Here follow tables indicating what web tag names are available to be used, tables group them by the basic purpose of the tags listed.


== System ==
Special tags returning information about the Windows device hosting Cumulus 1.
[[File:Badge vMx.png]]''If you are running MX, then most tags do not work.''
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:150px" |Applicability
!style="width:600px" |Function
|-
|<#OsVersion>
|up to 1.9.4, and MX
|OS version, e.g. "Windows 7 x64 build 7600"
Please note this may not return the information you expect!
|-
|<#OsLanguage>
|Both leagacy and MX
|OS language, e.g. "English"
|-
|<#SystemUpTime>
|{{Version badge 1}}(not available on MX)
|How long the system has been up, e.g. "8 hours 21 minutes"
|-
|<#ProgramUpTime>
|all releases
|How long Cumulus has been running, e.g. "7 hours 55 minutes"
|-
|<#CpuName>
|{{Version badge 1}}(not available on MX)
|CPU type, e.g. "Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz"
|-
|<#CpuCount>
|{{Version badge 1}}(not available on MX)
|Number of processors, e.g. "4"
|-
|<#MemoryStatus>
|{{Version badge 1}}(not available on MX)
|Free and total system RAM, e.g. "4619/8191 MB (free/total)"
|-
|<#DisplayMode>
|{{Version badge 1}}(not available on MX)
|Screen display mode, e.g. "1680x1050, 32 bit"
|-
|<#AllocatedMemory>
|{{Version badge 1}}(not available on MX)
|Amount of memory allocated to Cumulus, e.g. "18.76 MB"
|-
|<#DiskSize>
|{{Version badge 1}}(not available on MX)
|Size of disk on which Cumulus is running, e.g. "931.51 GB"
|-
|<#DiskFree>
|{{Version badge 1}}(not available on MX)
|Free space on disk on which Cumulus is running, e.g. "515.36 GB"
|}
== Miscellaneous ==
All tags are available in all flavours, as far as I know, although ''their output might vary'', and which input/output parameters they permit might vary between Cumulus 1 and MX.
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:900px" | Function
|-
|<#LatestError>
|Displays the last error from the Cumulus 1 error log. (The value is cleared when you click the error light in Cumulus 1).<br />
Note: This tag displays ''all'' errors, even if they do not cause the error light to flash in Cumulus 1. Although this tag and the next 3 are in MX, none of them are actually used (as at April 2020).
|-
|<#LatestErrorDate>
|The date of the latest error logged to the error log window, using the system short date format. Gives dashes when latest error is reset
|-
|<#LatestErrorTime>
|The time of the latest error logged to the error log window, using the system short time format. Gives dashes when latest error is reset
|-
|<#ErrorLight>
|1 if the 'error' light is flashing, 0 if not
|-
|<#version>
|The version of Cumulus in use e.g. '1.9.4' or '3.4.1'
|-
|<#build>
|The build of Cumulus in use e.g. '10992' for latest Cumulus 1 patch
(Cumulus MX is under development so new builds are released frequently)
|-
|<#NewBuildAvailable>
|'''Only available from release 3.7.0''' onwards, it is checked on start-up and once a day thereafter at a random time
*Returns a boolean value
**0 - MX running the latest build available
**1 - MX is running an earlier build that the latest public release
|-
|<#NewBuildNumber>
|'''Only available from release 3.7.0''' onwards, it is checked on start-up and once a day thereafter at a random time
Displays the latest public release build number - eg. b3089
|-
|<#realtimeinterval>
|The real time update interval in seconds (integer)
|-
|<#interval>
|The web site update interval in minutes (integer)
|-
|<#rollovertime>
|The time that the logs rollover to the next day: will always return one of these: 'Midnight', '9 am' or '10 am'
This is the end of the meteorological day, so if during Daylight Saving Time rolover is at "10 am", then on the day DST ends it will return to "9 am" ensuring every meteorological day is exactly 24 hours long. If the time is "Midnight" (or during DST it is "9 am"), then days will be 23 or 25 hours long just on day clocks change, 24 hours otherwise.
|-
|<#update>
|The date and time of the last web site update. The default format of the output depends on your locale settings.
|-
|<#LastDataReadT>
|The date/time data was last read from the station. The default format of the output depends on your locale settings.
|-
|<#stationtype>
|The weather station [https://cumuluswiki.org/a/Cumulus.ini#Section:_Station model] description (you choose what text appears for this on 'Display' settings screen within Configuration menu - the field is at the bottom left of that screen).
|-
|<#latitude>
|The station [http://en.wikipedia.org/wiki/Latitude latitude] (as you entered during setup).
Supports an optional 'dp' parameter, if supplied, instead of the usual web-encoded text format with degrees/minutes/seconds, the result is in decimal degrees to the specified number of decimal places. E.g<br />
<#latitude> gives "N&nbsp;59& deg;&amp;nbsp;14&amp;#39;&amp;nbsp;33&amp;quot;" for N 59 14 33<br />
<#latitude dp=5> gives "59.24250"
If the "dp" parameter is supplied, then supplying "rc=y" in addition will cause any decimal comma to be converted to a decimal point.
|-
| <#latitudeJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded
|-
|<#longitude>
|The station [http://en.wikipedia.org/wiki/Longitude longitude]  (as you entered during setup). Supports an optional 'dp' and 'rc' parameters as per the latitude tag.
|-
| <#longitudeJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded
|-
|<#altitude>
|The station [http://en.wikipedia.org/wiki/Altitude altitude] value (web tag outputs web encoded format containing figure, '&amp;nbsp;' and units) in either feet or metres just as you entered during setup (so it is more complex to extract number for script arithmetic); e.g. '123&amp;nbsp;m'
|-
| <#altitudenoenc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded
|-
|<#location>
|The station location (as you entered during setup)
|-
| <#locationJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is plain text
|-
| <#locationenc>
|[[File:Badge vMx.png]] Available from version 3.10.3
HTML encoded version of previous web tag that is JavaScript encoded
|-
|<#longlocation>
|Longer description of the station location (as you entered during setup)
|-
| <#longlocationJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is plain text
|-
| <#longlocationenc>
|[[File:Badge vMx.png]] Available from version 3.10.3
HTML encoded version of previous web tag that is JavaScript encoded
|-
|<#forum>
|URL of the forum (as you entered during setup) encoded into a web page menu item by adding colons
For Cumulus 1, this defaults to a Sandaysoft URL that is no longer available, for MX this defaults to the current support forum  (web server site hosted by "Freddie")
|-
| <#forumurl>
|[[File:Badge vMx.png]] Available from version 3.10.0
Same as previous, but just URL, without any additional colons
|-
|<#webcam>
|URL of the webcam (as you entered during setup) encoded into a web page menu item by adding colons. Default is blank. Can be used to link to any other web page that you host (Cumulus does not verify that it is a web can, that is just a label, and the label can be changed on each standard web page individually)
|-
| <#webcamurl>
|[[File:Badge vMx.png]] Available from version 3.10.0
Same as previous, but just URL, without any additional colons
|-
|<#graphperiod>
|The number of hours displayed by the graphs, as set using '''Configuration''' menu, ''Display'' settings screen 'Detailed Chart Period'
|-
|<#dailygraphperiod>
|The number of days displayed by the graphs, as set using '''Configuration''' menu, ''Display'' settings screen 'Daily Chart Period' (available from build 1098)
|-
|<#LatestNOAAMonthlyReport>
|Gives file name of latest auto-saved NOAA monthly report
|-
|<#LatestNOAAYearlyReport>
|Gives file name of latest auto-saved NOAA yearly report
|-
|colspan="2" style="background:lightgray;"|Options
[[File:Badge vMx.png]] Available from version 3.10.0
|-
| <#Option_useApparent>
| Whether user prefers to see Apparent Temperature or Feels Like Temperature
|-
| <#Option_showSolar>
| Whether user wants to show Solar data or does not not have a solar sensor
|-
| <#Option_showUV>
| Whether user wants to show Ultra Violet data or does not not have a UV sensor
|}
==Units==
Apply to Cumulus 1 and MX, no optional input nor output parameters.
{| class="wikitable" border="1"
|-
!style="width:150px" | Web tag_name
!style="width:600px" | Function
|-
|<#tempunit>
|Unit of temperature being used (Set in Cumulus as [http://en.wikipedia.org/wiki/Centigrade Celsius] or [http://en.wikipedia.org/wiki/Fahrenheit Fahrenheit]) values "&amp;deg;C" or "&amp;deg;F"
|-
| <#tempunitnoenc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded (i.e. without '''&amp;''' and without '''&deg;''')
|-
|<#tempunitnodeg>
|The temperature units being used, without a degree symbol, i.e. "F" or "C"
|-
|<#pressunit>
|Unit of measure for pressure. Possible values: "mb", "hPa", "in"
|-
|<#rainunit>
|Unit of measure for rain fall. Possible values: "mm" or "inches"
|-
|<#windunit>
|Unit of measure for wind speed. Possible values: "m/s", "mph", "km/h", "kts"
|-
|<#windrununit>
|Unit of measure for wind run (distance). Possible values: "km", "miles", "km", "nm" (for wind speeds in m/s, mph, km/h, kts)
|-
|<#cloudbaseunit>
|The units used for cloudbase value. Possible values:  "ft" or "m"
|}
==Date & Time==
Both Cumulus 1 and MX support all of these, except where marked as MX only, most of these web tags can be used with output parameters.
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:600px" | Function
|-
|<#date>
|The current date - format depends on locale you use to run Cumulus
|-
|<#metdate>
|The current meteorological date. The default format depends on the locale you use to run Cumulus
*If you use midnight rollover, this returns same date as <#date> (above), but with a different default format.
*If using a 9am/10am rollover:
**After rollover time on current calendar date,  this is same as <#date>, but with a different default format.
**Between midnight and 9am/10am the <#metdate> will return the date associated with previous calendar day, but will still return current time 
{{Version badge 1}}Can be used with relevant format parameters to [[Customised templates|customise]] '''todayT.htm''' template page to display current meteorological day, to customise '''thismonthT.htm''' template page to display meteorological month, and to customise '''thisyearT.htm''' template page to display correct meteorological year. This will be particularly useful on first and last day of month/year when rollover happens at 9 (or 10) a.m. and the month (and maybe year) is different before and after rollover.
[[File:Badge vMx.png]] Earlier MX releases provide a similar web template set, so these can be customised in same way as for legacy Cumulus above (but note capital "M" must be used for any month formatting). From release 3.10.1 the supplied web pages are web server based, there are no web templates to customise, and the supplied '''.json files''' do not include any meteorological date functionality.
|-
|<#timeUTC>
|The current UTC date/time rather than local date/time.  Example result (actual format depends on locale settings): 18:30 on 30 December 2009. If you want the local date and time, use next tag (below).
|-
|<#time>
|The current time and date. Example result (actual format depends on locale settings): 18:30 on 30 December 2009.  If you simply wish the time, use next tag (below).
|-
|<#timehhmmss>
|The current time (without date). Example format: 18:30:27. You can use output format specifiers to change the way the time is output, but any date specifiers are ignored.
|-
|<#minute>
|The current time, just the minutes. Fixed format: 07 (cannot use output format modifiers)
|-
|<#hour>
|The current time, just the hour. Fixed format: 07 (cannot use output format modifiers)
|-
|<#day>
| The current day as a 2-digit number. Fixed format: 07  (cannot use output format modifiers)
|-
|<#dayname>
| The current day as a word.  For example, Monday  (actual format depends on locale settings)
|-
|<#shortdayname>
| The current day as a shortened word. Example format: Mon
|-
|<#month>
|The current month as a 2-digit number. Fixed format: 07 (cannot use output format modifiers)
|-
|<#monthname>
|The current month as a word. Example format: July
|-
|<#shortmonthname>
|The current month as a shortened word. Example format: Jul
|-
|<#year>
|The current year as a 4-digit number. Example format: 2009  (cannot use output format modifiers)
|-
|<#shortyear>
|The current year as a 2-digit number. Example format: 09 (cannot use output format modifiers)
|-
|<#rollovertime>
|The time that the logs rollover to the next day: 'Midnight', '9 am' or '10 am'
PHP code example for testing whether before or after rollover given in next entry.
|-
|<#metdateyesterday>
|The previous meteorological date.  The default format depends on the locale you use to run Cumulus
*If you use midnight rollover, this returns same date as <#date>, but with a different default format.
*If using a 9am/10am rollover:
**After rollover time on current calendar date,  this is same as <#yesterday> (below), but with a different default format.
**Between midnight and 9am/10am the date output by <#metdateyesterday> will be the calendar day before that returned by <#yesterday>, but the time returned is actual local time. 
Can be used with relevant format parameters to indicate correct day on yesterdayT.htm template page, and can be used to return latest day stored on [[dayfile.txt]] and NOAA report for latest month.
if you use PHP Hypertext preprocessor, you can output different text for before and after rollover, e.g.
<pre><?php
if('<#yesterday format=dddd>' == '<#metdateyesterday format=dddd>') echo '(calendar date and meteorological date same)';
else echo 'rollover still to happen, these results will be treated as belonging to <#metdate format=dddd>';?></pre>
|-
|<#yesterday>
|Yesterday's date.  The default format depends on the locale you use to run Cumulus
|-
|<#update>
|The date and time of the last web site update.  The default format depends on the locale you use to run Cumulus
|-
|<#timeJavaScript>
|{{Version badge 1}} Not available in Cumulus 1.
[[File:Badge vMx.png]]Available from version 3.5.2
The JavaScript '''Date''' object contains the number of miliseconds since 00:00:00.000 UTC on 1st January 1970, that date and time is known as the UNIX Epoch.  In JavaScript, you can use <tt>Math.floor(new Date().getTime()/1000.0)</tt> This getTime method returns the time in milliseconds.  The web tag returns an integer (currently with 13 digits) representing the number of milliseconds since the UNIX epoch when the web tag was processed. It can be used in a script where you wish to re-express other times output by Cumulus MX into UTC (Coordinated Universal Time).  Mac OS X uses 00:00:00.000 UTC on 1st January 2001 as the starting time and date for its millisecond count, so that is considerably lower.
Note that UTC is calculated using 9192631770 times a particular transition time for Caesium 133 as a basis for 1 second. GMT (Greenwich Mean Time) is calculated on the basis that 1 second is 1/86400 of the time taken for a whole (day) rotation of the Earth. UT1 (or solar time) is calculated from various space measurements. Periodically, leap seconds are added to UTC to realign it with UT1, but these leap seconds are not added to the count of milliseconds represented by this web tag.
Do be aware that some devices will use a 32 bit signed integer to represent this number, and that will stop working on 19 January 2038, the year 2038 problem for computing world.
|-
|<#timeUnix>
|{{Version badge 1}} Not available in Cumulus 1.
[[File:Badge vMx.png]]Available from version 3.7.0
Unix tracks the number of seconds since the UNIX epoch. So this web tag can be used when you do not want the millisecond accuracy of the previous web tag. Like previous web tag this relates to UTC, so see details for that tag to find out more. This is equivalent in PHP 5 and PHP 7 to '''time();''' (in PHP 8, a parameter is mandatory for time function, so the call changes).
|-
|<#LastDataReadT>
|The date/time data was last read from the station. Default format for this tag is like this example '''18:30 on 30 December 2009''', but output parameters for both date and time can modify this to include seconds in 1.9.x builds and most MX builds such as per this example  '<#LastDataReadT format="yyyy-MM-dd HH:mm:ss">'.
|-
|<#DaysSince30Dec1899>
|Day count (gives whole and fractional part) Example: 41250.6523310301
|-
|<#recordsbegandate>
|Date when records began (appears twice on "recordT.htm" provided in standard web page, and used to calculate next tag, but ignored for all other Cumulus processing). Any output parameters valid for a date can be used here, don't forget differences in modifiers for Cumulus 1 and MX. There is no time associated with this web tag.  The default format is like 30 December 2009, please note although this web tag reports the value associated with  [b]StartDate=dd/MM/yyyy[/b] (see [[Cumulus.ini#Section:_Station]]), the format there is short-date format and different to default format for this web tag.
|-
|<#DaysSinceRecordsBegan>
|Day count since Cumulus records started
|}


==Current Conditions==
==Current Conditions==
Line 1,341: Line 975:


FL= AT * app_temp_mult + WC * wind_chill_mult;</pre>
FL= AT * app_temp_mult + WC * wind_chill_mult;</pre>
== System ==
Special tags returning information about the Windows device hosting Cumulus 1.
[[File:Badge vMx.png]]''If you are running MX, then most tags do not work.''
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:150px" |Applicability
!style="width:600px" |Function
|-
|<#OsVersion>
|up to 1.9.4, and MX
|OS version, e.g. "Windows 7 x64 build 7600"
Please note this may not return the information you expect!
|-
|<#OsLanguage>
|Both leagacy and MX
|OS language, e.g. "English"
|-
|<#SystemUpTime>
|{{Version badge 1}}(not available on MX)
|How long the system has been up, e.g. "8 hours 21 minutes"
|-
|<#ProgramUpTime>
|all releases
|How long Cumulus has been running, e.g. "7 hours 55 minutes"
|-
|<#CpuName>
|{{Version badge 1}}(not available on MX)
|CPU type, e.g. "Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz"
|-
|<#CpuCount>
|{{Version badge 1}}(not available on MX)
|Number of processors, e.g. "4"
|-
|<#MemoryStatus>
|{{Version badge 1}}(not available on MX)
|Free and total system RAM, e.g. "4619/8191 MB (free/total)"
|-
|<#DisplayMode>
|{{Version badge 1}}(not available on MX)
|Screen display mode, e.g. "1680x1050, 32 bit"
|-
|<#AllocatedMemory>
|{{Version badge 1}}(not available on MX)
|Amount of memory allocated to Cumulus, e.g. "18.76 MB"
|-
|<#DiskSize>
|{{Version badge 1}}(not available on MX)
|Size of disk on which Cumulus is running, e.g. "931.51 GB"
|-
|<#DiskFree>
|{{Version badge 1}}(not available on MX)
|Free space on disk on which Cumulus is running, e.g. "515.36 GB"
|}
== Miscellaneous ==
All tags are available in all flavours, as far as I know, although ''their output might vary'', and which input/output parameters they permit might vary between Cumulus 1 and MX.
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:900px" | Function
|-
|<#LatestError>
|Displays the last error from the Cumulus 1 error log. (The value is cleared when you click the error light in Cumulus 1).<br />
Note: This tag displays ''all'' errors, even if they do not cause the error light to flash in Cumulus 1. Although this tag and the next 3 are in MX, none of them are actually used (as at April 2020).
|-
|<#LatestErrorDate>
|The date of the latest error logged to the error log window, using the system short date format. Gives dashes when latest error is reset
|-
|<#LatestErrorTime>
|The time of the latest error logged to the error log window, using the system short time format. Gives dashes when latest error is reset
|-
|<#ErrorLight>
|1 if the 'error' light is flashing, 0 if not
|-
|<#version>
|The version of Cumulus in use e.g. '1.9.4' or '3.4.1'
|-
|<#build>
|The build of Cumulus in use e.g. '10992' for latest Cumulus 1 patch
(Cumulus MX is under development so new builds are released frequently)
|-
|<#NewBuildAvailable>
|'''Only available from release 3.7.0''' onwards, it is checked on start-up and once a day thereafter at a random time
*Returns a boolean value
**0 - MX running the latest build available
**1 - MX is running an earlier build that the latest public release
|-
|<#NewBuildNumber>
|'''Only available from release 3.7.0''' onwards, it is checked on start-up and once a day thereafter at a random time
Displays the latest public release build number - eg. b3089
|-
|<#realtimeinterval>
|The real time update interval in seconds (integer)
|-
|<#interval>
|The web site update interval in minutes (integer)
|-
|<#rollovertime>
|The time that the logs rollover to the next day: will always return one of these: 'Midnight', '9 am' or '10 am'
This is the end of the meteorological day, so if during Daylight Saving Time rolover is at "10 am", then on the day DST ends it will return to "9 am" ensuring every meteorological day is exactly 24 hours long. If the time is "Midnight" (or during DST it is "9 am"), then days will be 23 or 25 hours long just on day clocks change, 24 hours otherwise.
|-
|<#update>
|The date and time of the last web site update. The default format of the output depends on your locale settings.
|-
|<#LastDataReadT>
|The date/time data was last read from the station. The default format of the output depends on your locale settings.
|-
|<#stationtype>
|The weather station [https://cumuluswiki.org/a/Cumulus.ini#Section:_Station model] description (you choose what text appears for this on 'Display' settings screen within Configuration menu - the field is at the bottom left of that screen).
|-
|<#latitude>
|The station [http://en.wikipedia.org/wiki/Latitude latitude] (as you entered during setup).
Supports an optional 'dp' parameter, if supplied, instead of the usual web-encoded text format with degrees/minutes/seconds, the result is in decimal degrees to the specified number of decimal places. E.g<br />
<#latitude> gives "N&nbsp;59& deg;&amp;nbsp;14&amp;#39;&amp;nbsp;33&amp;quot;" for N 59 14 33<br />
<#latitude dp=5> gives "59.24250"
If the "dp" parameter is supplied, then supplying "rc=y" in addition will cause any decimal comma to be converted to a decimal point.
|-
| <#latitudeJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded
|-
|<#longitude>
|The station [http://en.wikipedia.org/wiki/Longitude longitude]  (as you entered during setup). Supports an optional 'dp' and 'rc' parameters as per the latitude tag.
|-
| <#longitudeJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded
|-
|<#altitude>
|The station [http://en.wikipedia.org/wiki/Altitude altitude] value (web tag outputs web encoded format containing figure, '&amp;nbsp;' and units) in either feet or metres just as you entered during setup (so it is more complex to extract number for script arithmetic); e.g. '123&amp;nbsp;m'
|-
| <#altitudenoenc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded
|-
|<#location>
|The station location (as you entered during setup)
|-
| <#locationJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is plain text
|-
| <#locationenc>
|[[File:Badge vMx.png]] Available from version 3.10.3
HTML encoded version of previous web tag that is JavaScript encoded
|-
|<#longlocation>
|Longer description of the station location (as you entered during setup)
|-
| <#longlocationJsEnc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is plain text
|-
| <#longlocationenc>
|[[File:Badge vMx.png]] Available from version 3.10.3
HTML encoded version of previous web tag that is JavaScript encoded
|-
|<#forum>
|URL of the forum (as you entered during setup) encoded into a web page menu item by adding colons
For Cumulus 1, this defaults to a Sandaysoft URL that is no longer available, for MX this defaults to the current support forum  (web server site hosted by "Freddie")
|-
| <#forumurl>
|[[File:Badge vMx.png]] Available from version 3.10.0
Same as previous, but just URL, without any additional colons
|-
|<#webcam>
|URL of the webcam (as you entered during setup) encoded into a web page menu item by adding colons. Default is blank. Can be used to link to any other web page that you host (Cumulus does not verify that it is a web can, that is just a label, and the label can be changed on each standard web page individually)
|-
| <#webcamurl>
|[[File:Badge vMx.png]] Available from version 3.10.0
Same as previous, but just URL, without any additional colons
|-
|<#graphperiod>
|The number of hours displayed by the graphs, as set using '''Configuration''' menu, ''Display'' settings screen 'Detailed Chart Period'
|-
|<#dailygraphperiod>
|The number of days displayed by the graphs, as set using '''Configuration''' menu, ''Display'' settings screen 'Daily Chart Period' (available from build 1098)
|-
|<#LatestNOAAMonthlyReport>
|Gives file name of latest auto-saved NOAA monthly report
|-
|<#LatestNOAAYearlyReport>
|Gives file name of latest auto-saved NOAA yearly report
|-
|colspan="2" style="background:lightgray;"|Options
[[File:Badge vMx.png]] Available from version 3.10.0
|-
| <#Option_useApparent>
| Whether user prefers to see Apparent Temperature or Feels Like Temperature
|-
| <#Option_showSolar>
| Whether user wants to show Solar data or does not not have a solar sensor
|-
| <#Option_showUV>
| Whether user wants to show Ultra Violet data or does not not have a UV sensor
|}
==Units==
Apply to Cumulus 1 and MX, no optional input nor output parameters.
{| class="wikitable" border="1"
|-
!style="width:150px" | Web tag_name
!style="width:600px" | Function
|-
|<#tempunit>
|Unit of temperature being used (Set in Cumulus as [http://en.wikipedia.org/wiki/Centigrade Celsius] or [http://en.wikipedia.org/wiki/Fahrenheit Fahrenheit]) values "&amp;deg;C" or "&amp;deg;F"
|-
| <#tempunitnoenc>
|[[File:Badge vMx.png]] Available from version 3.11.0
JavaScript encoded of previous web tag that is HTML encoded (i.e. without '''&amp;''' and without '''&deg;''')
|-
|<#tempunitnodeg>
|The temperature units being used, without a degree symbol, i.e. "F" or "C"
|-
|<#pressunit>
|Unit of measure for pressure. Possible values: "mb", "hPa", "in"
|-
|<#rainunit>
|Unit of measure for rain fall. Possible values: "mm" or "inches"
|-
|<#windunit>
|Unit of measure for wind speed. Possible values: "m/s", "mph", "km/h", "kts"
|-
|<#windrununit>
|Unit of measure for wind run (distance). Possible values: "km", "miles", "km", "nm" (for wind speeds in m/s, mph, km/h, kts)
|-
|<#cloudbaseunit>
|The units used for cloudbase value. Possible values:  "ft" or "m"
|}
==Date & Time==
Both Cumulus 1 and MX support all of these, except where marked as MX only, most of these web tags can be used with output parameters.
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:600px" | Function
|-
|<#date>
|The current date - format depends on locale you use to run Cumulus
|-
|<#metdate>
|The current meteorological date. The default format depends on the locale you use to run Cumulus
*If you use midnight rollover, this returns same date as <#date> (above), but with a different default format.
*If using a 9am/10am rollover:
**After rollover time on current calendar date,  this is same as <#date>, but with a different default format.
**Between midnight and 9am/10am the <#metdate> will return the date associated with previous calendar day, but will still return current time 
{{Version badge 1}}Can be used with relevant format parameters to [[Customised templates|customise]] '''todayT.htm''' template page to display current meteorological day, to customise '''thismonthT.htm''' template page to display meteorological month, and to customise '''thisyearT.htm''' template page to display correct meteorological year. This will be particularly useful on first and last day of month/year when rollover happens at 9 (or 10) a.m. and the month (and maybe year) is different before and after rollover.
[[File:Badge vMx.png]] Earlier MX releases provide a similar web template set, so these can be customised in same way as for legacy Cumulus above (but note capital "M" must be used for any month formatting). From release 3.10.1 the supplied web pages are web server based, there are no web templates to customise, and the supplied '''.json files''' do not include any meteorological date functionality.
|-
|<#timeUTC>
|The current UTC date/time rather than local date/time.  Example result (actual format depends on locale settings): 18:30 on 30 December 2009. If you want the local date and time, use next tag (below).
|-
|<#time>
|The current time and date. Example result (actual format depends on locale settings): 18:30 on 30 December 2009.  If you simply wish the time, use next tag (below).
|-
|<#timehhmmss>
|The current time (without date). Example format: 18:30:27. You can use output format specifiers to change the way the time is output, but any date specifiers are ignored.
|-
|<#minute>
|The current time, just the minutes. Fixed format: 07 (cannot use output format modifiers)
|-
|<#hour>
|The current time, just the hour. Fixed format: 07 (cannot use output format modifiers)
|-
|<#day>
| The current day as a 2-digit number. Fixed format: 07  (cannot use output format modifiers)
|-
|<#dayname>
| The current day as a word.  For example, Monday  (actual format depends on locale settings)
|-
|<#shortdayname>
| The current day as a shortened word. Example format: Mon
|-
|<#month>
|The current month as a 2-digit number. Fixed format: 07 (cannot use output format modifiers)
|-
|<#monthname>
|The current month as a word. Example format: July
|-
|<#shortmonthname>
|The current month as a shortened word. Example format: Jul
|-
|<#year>
|The current year as a 4-digit number. Example format: 2009  (cannot use output format modifiers)
|-
|<#shortyear>
|The current year as a 2-digit number. Example format: 09 (cannot use output format modifiers)
|-
|<#rollovertime>
|The time that the logs rollover to the next day: 'Midnight', '9 am' or '10 am'
PHP code example for testing whether before or after rollover given in next entry.
|-
|<#metdateyesterday>
|The previous meteorological date.  The default format depends on the locale you use to run Cumulus
*If you use midnight rollover, this returns same date as <#date>, but with a different default format.
*If using a 9am/10am rollover:
**After rollover time on current calendar date,  this is same as <#yesterday> (below), but with a different default format.
**Between midnight and 9am/10am the date output by <#metdateyesterday> will be the calendar day before that returned by <#yesterday>, but the time returned is actual local time. 
Can be used with relevant format parameters to indicate correct day on yesterdayT.htm template page, and can be used to return latest day stored on [[dayfile.txt]] and NOAA report for latest month.
if you use PHP Hypertext preprocessor, you can output different text for before and after rollover, e.g.
<pre><?php
if('<#yesterday format=dddd>' == '<#metdateyesterday format=dddd>') echo '(calendar date and meteorological date same)';
else echo 'rollover still to happen, these results will be treated as belonging to <#metdate format=dddd>';?></pre>
|-
|<#yesterday>
|Yesterday's date.  The default format depends on the locale you use to run Cumulus
|-
|<#update>
|The date and time of the last web site update.  The default format depends on the locale you use to run Cumulus
|-
|<#timeJavaScript>
|{{Version badge 1}} Not available in Cumulus 1.
[[File:Badge vMx.png]]Available from version 3.5.2
The JavaScript '''Date''' object contains the number of miliseconds since 00:00:00.000 UTC on 1st January 1970, that date and time is known as the UNIX Epoch.  In JavaScript, you can use <tt>Math.floor(new Date().getTime()/1000.0)</tt> This getTime method returns the time in milliseconds.  The web tag returns an integer (currently with 13 digits) representing the number of milliseconds since the UNIX epoch when the web tag was processed. It can be used in a script where you wish to re-express other times output by Cumulus MX into UTC (Coordinated Universal Time).  Mac OS X uses 00:00:00.000 UTC on 1st January 2001 as the starting time and date for its millisecond count, so that is considerably lower.
Note that UTC is calculated using 9192631770 times a particular transition time for Caesium 133 as a basis for 1 second. GMT (Greenwich Mean Time) is calculated on the basis that 1 second is 1/86400 of the time taken for a whole (day) rotation of the Earth. UT1 (or solar time) is calculated from various space measurements. Periodically, leap seconds are added to UTC to realign it with UT1, but these leap seconds are not added to the count of milliseconds represented by this web tag.
Do be aware that some devices will use a 32 bit signed integer to represent this number, and that will stop working on 19 January 2038, the year 2038 problem for computing world.
|-
|<#timeUnix>
|{{Version badge 1}} Not available in Cumulus 1.
[[File:Badge vMx.png]]Available from version 3.7.0
Unix tracks the number of seconds since the UNIX epoch. So this web tag can be used when you do not want the millisecond accuracy of the previous web tag. Like previous web tag this relates to UTC, so see details for that tag to find out more. This is equivalent in PHP 5 and PHP 7 to '''time();''' (in PHP 8, a parameter is mandatory for time function, so the call changes).
|-
|<#LastDataReadT>
|The date/time data was last read from the station. Default format for this tag is like this example '''18:30 on 30 December 2009''', but output parameters for both date and time can modify this to include seconds in 1.9.x builds and most MX builds such as per this example  '<#LastDataReadT format="yyyy-MM-dd HH:mm:ss">'.
|-
|<#DaysSince30Dec1899>
|Day count (gives whole and fractional part) Example: 41250.6523310301
|-
|<#recordsbegandate>
|Date when records began (appears twice on "recordT.htm" provided in standard web page, and used to calculate next tag, but ignored for all other Cumulus processing). Any output parameters valid for a date can be used here, don't forget differences in modifiers for Cumulus 1 and MX. There is no time associated with this web tag.  The default format is like 30 December 2009, please note although this web tag reports the value associated with  [b]StartDate=dd/MM/yyyy[/b] (see [[Cumulus.ini#Section:_Station]]), the format there is short-date format and different to default format for this web tag.
|-
|<#DaysSinceRecordsBegan>
|Day count since Cumulus records started
|}


==Today==
==Today==


Cumulus MX provides more web tags than the original (now legacy) Cumulus software. Please see individual entries for what is available in the flavour you are using. Where known, the actual release that introduces a particular web tag is indicated, but if you are using an old release please [[Webtags#GENERAL_TIP|see here]] for how to check which web tags are available.
Cumulus allows some control over the time that "Today" begins:
* For the weather diary feature (originally called "The Log" if you have a very old release or look at old posts on the support forum), Cumulus classifies what you enter by a date. The hour of the day, when that date is first applied, is set in the configuration by the '''SnowDepthHour''' (called that as the only tag name available in the legacy Cumulus was for Snow Depth.
**  The default snow depth hour is 9 for the legacy Cumulus and 0 for MX.
* Readings from your weather station are assigned to the "Today" based on 3 options for [[Meteorological day]]
*# starting at 9:00 am, based on winter time, so switching to 10:00 during Daylight Saving (summer) time, or
*# starting at 9:00 am, all year round, or
*# aligned with calendar days, so today starts at midnight


===Weather Diary===
The practice for professional meteorologists varies between nations, some of the traditional practices listed below have been abandoned now most weather reading is by machines:
* Generally, Meteorologists report snowfall, and snow days, on a calendar day basis (i.e. midnight to midnight).
* Most frequently, the Lowest temperature for a day is that recorded prior to the start time for Highest temperature.
** This is because Meteorologists in the past took manual observations at one, or more, fixed times during each day (9 a.m. was the most common, and the closest lowest temperature was generally earlier that morning, while the closest highest temperature was generally the following afternoon)
* Sunshine hours were recorded from sunrise to sunset, so assigned to "Today" aligned with calendar day
* The way that total rainfall was reported varied:
** Some nations assigned used days that ended at 9 a.m. so rainfall was recorded against the end date
** Sometimes totals were recorded separately for 9 a.m to 3 p.m, with 3 p.m. to 9 a.m being assigned to next day (again these were manual observation times)
** In other cases, the total for 9 p.m to 9 a.m was recorded separately, and possibly assigned to the day after the total for 9 a.m. to 9 p.m.


Meteorologists report snowfall, and snow days, on a calendar day basis (i.e. midnight to midnight), and Cumulus software enables this by allowing you to declare the '''SnowDepthHour''' time (in [[Cumulus.ini#Section:_Station]], default is 9 a.m. for Cumulus 1, and default is midnight for MX).
Cumulus does not support most of these practices. The independence of the start time for weather diary and weather station related web tags means needs to be remembered when labelling web tags from the two tables below.  Steve Loft assumed that you would use 9 a.m. as start time for both, but not care when snow fell, as it often has in the UK, after Summer Time has begun, so weather station tags were by default reporting from 10 a.m. local time and snow as at 9 a.m.


However, Cumulus software also allows you to choose one of 3 meteorological days:
In MX, if you choose 9 a.m. (optionally 10 a.m. in summer) for rollover, so all the standard derivative are assigned to the date the meteorological day starts as Today, but the sunshine hours recorded against today will be from midnight on the said date.
# starting at 9:00 am, based on winter time, so switching to 10:00 during Daylight Saving (summer) time, or
# starting at 9:00 am, all year round, or
# aligned with calendar days.


For MX users who choose options 1, and 2, with the MX default for snow depth, there is a mismatch between the times for the web tags in the two tables below. The mismatch will also cause problems if you use any End of Day actions, such as using web tags for either a [[MX_Administrative_Interface#Another_daily_summary_table|custom database table update]], or for [[Cumulus.ini#MQTT|MQTT messages]]. For the original Cumulus 1 software, only one web tag is available, but by default this has a mismatch if you use midnight-midnight days; this was intentional as Steve Loft assumed you would record the snow depth at 9 a.m. rather than midnight even if your rollover is at midnight!
===Weather Diary===
 
An alternative approach is to use a script to read the [[Weather Diary]], so you know that your output is for the right day.


This first table lists all the web tags available for reporting what is recorded in the weather diary. Just to be clear, the web tags shown below, will report data for previous day if the current time is before the snow depth hour setting, and report data for the current day if the current time matches the snow depth hour or is later.
This first table lists all the web tags available for reporting what is recorded in the weather diary. Just to be clear, the web tags shown below, will report data for previous day if the current time is before the snow depth hour setting, and report data for the current day if the current time matches the snow depth hour or is later.
Line 1,387: Line 1,399:
===Today.ini===
===Today.ini===


This second table takes most of its information from the data log for today, many of these web tags are used on the supplied '''todayT.htm''' template in the "/web" folder.  If you are using MX, the today and yesterday page in the [[MX_Administrative_Interface]] shows similar information by using the [[Cumulus_MX_Local_API#Today.2FYesterday_Data|local application programming interface]].
As explained earlier, these tags relate to latest [[Meteorological day]], except for Sunshine Hours which relate to latest Calendar day.
 
Information for these tags is taken from [[today.ini]], hence the sub-section title, although Sunshine Hours can be taken from either [[yesterday.ini]] or "today.ini" depending on (respectively) whether before or after rollover time if that is not midnight.
 
Many of these web tags were used on the supplied '''todayT.htm''' template in the legacy "/web" folder.  If you are using MX, the today and yesterday page in the [[MX_Administrative_Interface]] shows similar information by using the [[Cumulus_MX_Local_API#Today.2FYesterday_Data|local application programming interface]].


For web tags that report values that refer to a particular time of day, there is a corresponding web tag that can give the time of day, shown in same row of table below. For those that cover whole day so far, the final column contains "n/a".
For web tags that report values that refer to a particular time of day, there is a corresponding web tag that can give the time of day, shown in same row of table below. For those that cover whole day so far, the final column contains "n/a".


Please note none of the time web tags can be modified by output parameters to give a date, but they can be changed from the default time format that is 'H:mm' (24 hour clock notation without leading zero for hour) for Cumulus 1 and MX. If you are using output modifiers to change how the time is reported, be careful to use ones that work for the flavour of Cumulus you are using (H and h are same for Cumulus 1, but not for MX; nn and mm are same for Cumulus 1, but not for MX).
Please note none of the time web tags can be modified by output parameters to give a date, but they can be changed from the default time format that is 'H:mm' (24 hour clock notation without leading zero for hour) for Cumulus 1 and MX.  
 
If you are using output modifiers to change how the time is reported, be careful to use ones that work for the flavour of Cumulus you are using ('H' and 'h' are same for Cumulus 1, but the two codes represent different formats for MX; MX insists on 'mm' being used for minutes, but the 'NN' and 'nn' used by Cumulus 1 could be replaced by 'mm' if they followed an hour specifier).
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
5,838

edits

Navigation menu