Webtags (preserving history): Difference between revisions

m
→‎Today: Snow explanation rewritten to emphasise C1 and MX differences
m (→‎Today: Snow explanation rewritten to emphasise C1 and MX differences)
(36 intermediate revisions by 2 users not shown)
=What this article covers =
 
#At the last count, a 3.5.x version of MX produces ''nine and a half million'' '''web tags'''! But the file mentioned in previous section contains just 717 items (later versions of MX raise this count by another forty tags or so). How come this discrepancy?
# Those millions of web tags can actually produce billions of different outputs!
#But the file mentioned in previous section contains just 717 items (at 3.5.0, later versions of MX raise this count by another forty tags or so).
#How come this discrepancy?
 
*Well each web tag has the general format <tt><#tag_name optional_input_parameter optional_output_parameter></tt> and it is adding thesethe optional input parameters that allow 717 tag names to define 9½ million values!
*Adding all possible different output parameters generates the billions of different outputs!
 
Consequently, this article describes:
*Over 7 hundred web tags -'''THIS ARTICLE MAY NOT CONTAIN ALL WEB TAGS AVAILABLE IN LATEST VERSION - It depends on someone updating this article if the developer does not have time to do so'''
*Over 7 hundred web tags
*A score of input parameters that modify some of those tags (meaning some web tags can represent 12 different months for example)
*The components that make up output parameters that(a modifyguide almostto allhow webyou tags that report amodify timethe and/oroutput dateformat)
** some control number of decimal places
*The way that some of those date modifiers are used for naming NOAA reports
** one controls 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)
*The way that some of those date modifiers are used for naming NOAA reports (a simple, but useful table)
 
 
The tables below are not able to indicate which of the billions of combinations possible are valid or invalid for youparticular tag names nor for particular release versions..
 
==Applicability by version and build==
 
The tip at the start of this article tells you how to check which tags are available in whatever build of Cumulus you are actually using. Given how often a new release alters either what web tags are available or what parameters can be used with particular web tags, it is not possible for the tables below todo tellnot youlist precisely how you useall web tags at any version, and the tables can't say which modifiers are available at your version.
 
Because Cumulus 2 is no longer available, it has been ignored in the tables below. It never really worked for web page generation, so if you happen to have installed Cumulus 2 from when it was available, you probably don't care which web tags it supports.
 
[[File:Badge v1.png]]This badge is used to highlight text that applies to Cumulus 1.
|}
 
If you migrate from Cumulus 1 (where case does not matter) to Cumulus MX (where case does matter), from version 3.3.0 onwards the NOAA default monthly name if it reads "NOAAMO'mmyy'.txt" (MX believes "mm" '''means minutes''', not month) is changed into "NOAAMO'MMyy'.txt" (which works on both Cumulus 1 and MX).
 
= Template Files =
===Inconsistency in use of "T"===
 
*SomeThe newer web tags for '''today''' include a "T" as a suffix, somethe older ones do not.
**The lack of a "T" isin usedsome intoday combinationtags withcauses thesome webconfusion tagwith nameall-time forrecord atags as value,they sohave a similar namenaming isstructure usedto forthese theolder time-stamptoday web tags.
**This is particularly confusing and is why you must look up today, and all-time, tags in the tables in this article.
*The time-stamp tags add a "T" to the corresponding web tag for the value, but in an inconsistent way:
**the T is a prefix sometimes and
**the T is a suffix sometimes
**This is particularly confusing and is why you must look up time-stamp tags in the tables in this article.
 
===Choosing script variable names derived from tag names===
*If Cumulus MX is running on Linux or Mac OS X, or any other device that uses UNIX derived operating system, then it uses '''Mono''' software for same purposes. (MONO is a operating system independent version of .NET, although they are developed independently, they have common origins). Please see the [[Cumulus MX]] article for more details of their differences and what will change in November 2020.
*The date and time format characters in Mono (and .NET) software framework are not exactly the same as the '''Delphi''' software framework ones that Cumulus 1 uses.
*For Cumulus MX there are standard format codes (single characters) and custom format codes (combinations of characters, or single characters prefixed by %)
*For Cumulus MX see [http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx this Microsoft site] for format selectors available.
**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]
*The differences come about because Delphi is case-insensitive, while .NET and MONO are case sensitive. Consequently, .NET (and MONO) can use upper and lower case for different items, but Delphi has to use different letters, ignoring case, for each item.
**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]
*In Cumulus MX 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 or not
**The case differences come about because Delphi is case-insensitive, while .NET and MONO are case sensitive. Consequently, .NET (and MONO) can use upper and lower case for different items, but Delphi has to use different letters, ignoring case, for each item.
 
==== When it causes problems ====
 
This can cause problems when somebody moves from using Cumulus 1 (C1) to using MX. They need to revisit any templates or scripts where they use output modifiers to specify a date and/or time format. We have already explored a very simple impact of this for [[Webtags#The_format_used_for_naming|NOAA report naming]]. There we were only concerned about how to represent a month.
 
For web tags it is much more complicated, notsimply onlybecause doit weis neednot tojust select the right case,month we alsomay havebe torepresenting, copeand withwe MXmight selectorsrequire havingonly differentone meaningsspecifier when(being theycareful arewhether onwe theiruse owna andstandard whenor theycustom appearmodifier) withor otherwe selectors,might finallywant whereto youspecify puta quotescombination withinof thesemodifiers format(and specifierswe variesmight betweenwant Cumulusto 1add anda MXspace partlycharacter becauseor theother reservedliterals). charactersIt changeis anddifficult partlyto becausesummarise, MXbut introduceshere theare conceptsome of escaping characters.potential issues:
* the reserved characters are different in C1 and MX (affecting use of literals like "on" and "at" that appear in many English time-stamps)
* 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)
* MX is inconsistent e.g. '''format=d''' gives a different result depending on the tag it is applied to (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)
* in MX space in some cases may need to be within the single quotes containing other literals (as in MX space can change the interpretation of a modifier character).
 
'''Confused even more now?''' I'm not surprised, but maybe some examples will help before we actually list the available modifiers.
==== 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 was originally here for just Cumulus 1.
For official full details see [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=17888 Cumulus MX forum], the following table is revised for simplicity. (I've given a different selection of combinations and included '%' where necessary to avoid single character versus custom complications). So "G" does not need a "%" because it is used on its own for a full date-time specifier. But "%d" is needed if only day number is required, but "d M" and "M" will both work to specify day number and month.
 
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 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" meant something different when it was combined with "H" or "h" (when it represented minutes), but in all other contexts 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 a space or a "%" which modify the meaning of the character. So my modification of the table below is with the intention of demonstrating what characters mean when they are on their own and what they represent in the context of being with other characters. Looking at the table 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 "d M" and "M" will both work because "M" has a different meaning on its own and with another modifier.
 
==== My Revised Table of Time and Date Output Modifiers ====
|-
|c
|G (as single character format)
|G
|Displays the date using the format given by the Short Date format, followed by the time using the format given by the Long Time format. The time is not displayed in Cumulus 1 if the date-time value indicates midnight precisely.
|'22/03/2019 09:47:25' produced by {{Version badge 1}}<#time format=c>[[File:Badge vMx.png]]<#time format=G>
|ddddd
|d (as single character format)
|{{Version badge 1}}Cumulus 1.x.y: Displays the date using the format given by the Short Date format. [[File:Badge vMx.png]]This MX parameter (when on its own) displays inconsistent behaviour as its effect depends on the tag name with which it is used (see examples).
|e.g. '22/03/2019' (British Locale) produced by {{Version badge 1}}<#metdate format="ddddd">[[File:Badge vMx.png]]<#metdate format="d"dddd>
[[File:Badge vMx.png]]<#metdateyesterday format=d> ''but not'' <#yesterday=d> which would return just '22'
|-
|dddddd
|D (as single character format)
|D
|Displays the date using the format given by the Long Date format. [[File:Badge vMx.png]]The MX parameter cannot be combined with any other parameters.
|e.g. '22 March 2020' (British Locale)
|-
|Displays the hour (12 hour clock) without a leading zero (1-12) [optionally in combination with AM/PM]. What "tt" produces depends on locale settings for your device, it might be capitals or it might be lower case (in Windows use Control Panel, not Settings app, to get to these regional additional settings).
{{Version badge 1}}For Cumulus 1 the formats for am/pm depend on the case in which you type the parameter as shown later in this table
 
[[File:Badge vMx.png]]Note that including a ' ' (space) or '%' before the "h" makes it a custom modifier, that is not needed if the " tt" follows, as multiple parameters are always custom modifiers
|-
|h:mm (or ''h:nn'') [''AM/PM'']
|H (or ''H'')
|%H
|Displays the hour using 24 hour clock without a leading zero (0-23). [[File:Badge vMx.png]]Note that including a ' ' (space) or '%' before the "H" makes it a iscustom onlymodifier, needed whenbecause H is on its own.
|7 produced by {{Version badge 1}}<#daylength format=H>
[[File:Badge vMx.png]]<#daylength format=%H>
|H:mm (or ''H:nn'')
|H:mm
|Displays the hour using 24 hour clock without a leading zero (0-23) followed by 2 digit minutes. [[File:Badge vMx.png]]Note that %, of previous example, is not needed when H is not on its own.
|'7:27' produced by <#LastDataReadT format="H:mm">
|-
|'07 am' produced by {{Version badge 1}} <#LastDataReadT format="hh am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="hh tt">
|-
|hh:mm (or ''hh:nn'' or 'HH:NN') [''am/pm'']
|hh:mm [''tt'']
|Displays the hour (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally in combination with am/pm].
{{Version badge 1}}For Cumulus 1, the 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 {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|s
|%s
|Displays the second without a leading zero (0-59). [[File:Badge vMx.png]] As other examples show, the % is only neededrecommended when "ms" is on its own, although I have not found any alternative meaning for "s" on its own.
| 9
|-
|z
|FFF
|Displays the millisecond without a leading zero (Cumulus 1: displays 0-999, Cumulus MX: displays either nothing, or displays 1-999)., Noteso thatdon't thewrite systemany clockcode inthat someassumes versionsthe of WindowsMX onlyoutput hasis precisionnumeric). to 15 ms.
 
Note that the system clock in non-current versions of Windows only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Windows.
|
|-
|Displays the millisecond with a leading zero (000-999). Note that the system clock in some versions of Windows only has precision to 15 ms, so requesting thousandths of a second may not return anything useful.
 
[[File:Badge vMx.png]]The 'fff' modifier in MX can actually be extended to 'ffffff' for output to a millionth of a second!
| 09:47:25.000' produced by {{Version badge 1}}<#time format=hh:nn:ss.zzz>[[File:Badge vMx.png]]<#time format=hh:mm:ss.fff>
|-
|(not available)
| zzz
|0zzz
|Displays the offset of any time from UTC in hours and minutes
| e.g.-07:00
|-
|-
|TT
|T (as single character format)
|T
|Displays the time using the Long Time format. [[File:Badge vMx.png]] Note that this is a full time specifier and "T" doesis noton needits aown "%"as althoughwe itare isusing ona itssingle owncharacter format.
|'09:47:56' (might not use colon in your locale) produced by {{Version badge 1}}<#LastDataReadT format=TT> [[File:Badge vMx.png]]<#LastDataReadT format=T>
|-
|{{Version badge 1}}Uses the 12-hour clock for the preceding h or H specifier, and displays 'am' for any hour from midnight until just before noon, and 'pm' for any hour from noon onwards. The am/pm specifier for Cumulus 1 can use lower, upper, or mixed case, and the result is displayed accordingly.
 
[[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 specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon.
{{Version badge 1} The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
 
[[File:Badge vMx.png]]Remember that 't' has to be combined with other specifiers (or preceded by space or '%') to display 'a' or 'p' as if it is alone it has a different (short format time) meaning - see above.
[[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".
| see previous example
|-
|:
|:
|Displays the time separator character given by the Time Separator. ItWith 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.
|':' for British locale
|-
|'xy'
|'xy' or ''\x\y''
|Characters enclosed in single quotation marks are displayed as such, and do not affect formatting. In MX each character to be displayed as it was typed can be prefixed by a backslash.
 
[[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!
|Hyphens are added in this PHP language example '<#LastDataReadT format=yyyy>'.'-'.'<#LastDataReadT format=MM>'.'-'.'<#LastDataReadT format="dd">'
|}
=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].
 
== 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.
 
The [[MX Administrative Interface]] uses some application programming interface (api) calls to obtain the data each web page in that interface needs, and another api to return the results of any edit made. If you wanted your '''CumulusMX/interface/todayyest.html''' web page to include something else (e.g. snow falling/lying/depth) you would edit that HTML page to have the extra sub-table you want (you cannot extend the existing rainfall table as that is dynamically created by existing api) and you would edit the associated JavaScript file '''CumulusMX/interface/js/todayyest.js''' to add a new api call seeking snowdepth, snowfalling, snowlying tags for today (unfortunately there are no tags for yesterday's snow) and to place the returned values into your new sub-table (probably using jQuery to make it easy). In a similar way, you could add anything where today and yesterday tags are available such as UV Index.
In earlier versions of Cumulus if you wanted to make use of values processed by Cumulus, you wrote a script file referencing the web tags you wanted to use. Now if you are running other software on your device that runs MX (or a computer or other device linked directly on your personal network), you can request web tags values on demand via an application programming interface (api hereafter).
 
In earlier versions of Cumulus if you wanted to make use of values processed by Cumulus, you wrote a script file referencing the web tags you wanted to use, and let Cumulus process that file at an interval set in the settings, then you had to write something to process the results at the relevant interval. Now if you are running other software on your device that runs MX (or a computer or other device linked directly on your personal network), you can request web tags values on demand via an application programming interface (api hereafter) and don't need to worry about any timing issues.
Obviously each api request creates a processing overhead on Cumulus so use this feature wisely.
 
TheObviously exampleseach belowapi focusrequest creates a processing overhead on obtainingCumulus so use this feature wisely (minimise the information you request and minimise the frequency of requesting it). You can use it for extra current information, but in practicethat usage you might need to repeat the call. Consequently, maybe it is more likely that the api will be used to request information that does not keep changing, such as what units are being used for temperature, rainfall, and wind speed.; Theor adminperhaps interface uses api techniques for all the information it needsdaily, but each page has an api request for the version and build being usedmonthly, that is another example of information that changesor seldomyearly, butsummary canfigures. be useful to other software running on your local network.
 
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 ==
 
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.
 
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===
The GET approach to using the 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 is used instead of a name=value parameter.
 
Suppose you want to get the values for the following three web tags:
 
The first parameter is '''rc''' to indicate that the tags that follow are to use decimal points not decimal commas, which is how many script languages expect to see values.
Remember that in thiscurrent version (and some earlier versions) of MX, the above three web tags are exactly same as:
# <#temp rc=y>
# <#hum rc=y>
# <#dew rc=y>
 
Since '''rc=y''' can be applied to several web tags that don't appear in [[Webtags#No_Commas]] table, this shows how the api can access values without commas for manyall otherthose web tags that report in real numbers and allow that output modifier.
 
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 ===
 
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.
I have a script that works with the standard log editor in the admin interface to calculate (and recalculate after any edit) the derived fields from the source fields. To make these calculations work for anyone, I need to find out what units the Cumulus MX user is using. Here is the code (with the api call written using jQuery):
 
I wanted to improve the log file editing pages, and that was partly by adding validation, and partly by changing the way the editing is done. For the standard log file editor I wanted to achieve even more, I added a script to calculate (and recalculate after any edit) the derived fields from the source fields. To make these calculations work for anyone, I needed to find out what units the Cumulus MX user is using. Before 3.7.0 release the snippet of script that obtained the units via various api calls was quite complex (I described above how the api returned lots of unwanted content), but with 3.7.0 my new api call was greatly simplified to what I show below. Please note my revised log file editing scripts did not make it into a public release, and it is only the units obtaining api that I am making available to public here.
 
Here is the code (with the api call written using jQuery):
<pre>/* Some new variables connected with new api call (MX 3.7.0) */
var tempLetter; // C or F
*The jQuery get request takes the api URL as first parameter and the function to deal with the returned result as third parameter
*The middle parameter is irrelevant in this context as only one object instance is returned, but if the qet was returning multiple results, "limit=1" would only return the first result
*The function takes as its sole parameter an Object (a JavaScript Object is a collection of properties), this is what is returned by the api, thean selected nameobject can be given any variable name
*In JavaScript if a variable is defined outside the function, then given a value inside the function, that value can be accessed by later code outside the function (in my case by code within the other functions for calculating each derived value)
*We are only interested in 3 of the '''property_name = property_value''' items in the Object.
*The object returned has 3 parameters each in '''attribute=value''' format
*WeThe JavaScript '''refinement''' syntax (starts with a dot) can be used to find the value infor any parameter bywe usingname. We assign the '''object.attribute'''variable syntaxalready defined to the object and assignits itrefinement to(that specifies the variableattribute alreadywe definedwant).
*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 ==
 
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.
 
You may have used POST as an attribute when defining the action of a HTML form. In that context the form is sent as the contents of a message to whatever web page is going to process the contents of that form.
 
The post approach has a few advantages over get:
*The parameters are not shown in theany query-string, so are not obvious to the person looking over your shoulder, nor do they appear in a history list of sites that the browser has visited.
*If you fill out a form online, the post approach will be used as the content needs to be kept secure. The get approach may be seen when you are navigating through a web site, and a selection is being remembered.
**The get approach may be seen when you are navigating through a web site, and a selection is being remembered.
*A URL with query-string is restricted in total length (the restriction is dependent on a number of other factors, but might be at something like 1000 characters in total), so GET comes with a restriction on how many parameters can be specified; POST can handle much longer requests.
*The POST approach can handle very long requests and return a lot of information.
 
**In contrast, a URL with query-string is restricted in total length (the restriction is dependent on a number of other factors, but might be at something like 1000 characters in total), so GET comes with a restriction on how many parameters can be specified.
here is an example text file with some web tags in it, let us store it in '''process.txt''':
<pre><#time format="yyyy-MM-dd hh:mm:ss">,<#temp rc=y>,<#hum>,<#dew rc=y>,<#RecentFeelsLike rc=y d=1></pre>
 
See https://cumulus.hosiene.co.uk/viewtopic.php?p=145050#p145050 for post example
The command '''http: //localhost:8998/api/tags/process.txt''' would send that text file to the api server, and you would get back the date and time in ISO format, the current temperature with decimal point, the current humidity, the current dew point with decimal point, and what the feels like temperature was one day ago at this time again with decimal point.
 
=The Web Tags for Cumulus =
|If you have an RG-11 rain sensor configured in "Tipping Bucket" mode, this gives today's rain total so far according to the sensor
| n/a
|-
|<#snowfalling>
|Returns 1 if there is an entry in the Weather Diary for Today and the Snow Falling check box is ticked. Returns 0 otherwise.
{{Version badge 1}} Not available in Cumulus 1.
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054.
|-
|<#snowdepth>
|Meteorologists report snow depth in cm, so this is default unit for Cumulus. If there is an entry in the Weather Diary for Today's date, and current time is between the '''SnowDepthHour''' time (in [[Cumulus.ini#Section:_Station]], default is 9 a.m. for Cumulus 1, and midnight for MX) and subsequent midnight, returns the value set there for depth. Returns 0 otherwise. If time before '''SnowDepthHour''', looks at previous day's date in Weather Diary and reports any non-zero value there, otherwise reports zero.
|If there is an entry in the Weather Diary for Today, returns the value set there. Returns 0 otherwise.
 
{{Version badge 1}} Available from very early builds, weather diary input amended from version 1.8.6 14th April 2009 to allow units to be specified. Input and output is as integer, enter in millimetres to represent 1 decimal place in centimetres. Meteorologists report this in cm.
{{Version badge 1}} Input and output is always as integer. Available from very early builds, weather diary input amended from version 1.8.6 14th April 2009 to allow units to be specified on diary edit screen. If you choose to enter as whole millimetres, you can use JavaScript (or another script language) on your web page to divide the web tag by 10 and get centimetres to 1 decimal place on output.
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054 when weather diary editor was added to MX
 
[[File:Badge vMx.png]] Input is to 2 decimal places. Available from version 3.1.1 - build 3054 when weather diary editor was added to MX. MX allows output in centimetres with decimal places without any script. You can't change the units shown in admin interface, but your value can be input as inches to 2 decimal places if you ignore "cm" that is displayed in that interface.
| n/a
|-
|<#snowlying>
|{{Version badge 1}}Although this tag is not available in Cumulus 1, your web page can use a script to check if <#snowdepth> is non zero, as that means snow is lying
|Returns 1 if there is an entry in the Weather Diary for Today and the Snow Lying check box is ticked. Returns 0 otherwise.
 
{{Version badge 1}}Although this tag is not available in Cumulus 1, you can check if <#snowdepth> is non zero for same answer
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054. If there is an entry in [[Weather Diary]] for Today's date, and (if '''SnowDepthHour''' time (in [[Cumulus.ini#Section:_Station]] is defined) current time is between the Snow update time (in [[Cumulus.ini]]) and midnight, then this web tag returns zero if snow lying check box not ticked or one if checkbox is ticked. If no Weather Diary entry found, this web tag returns Null.
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054
| n/a
|-
|<#snowfalling>
|{{Version badge 1}} Not available in Cumulus 1. There is no web page workaround, unless you write a script that reads [[Weather Diary]] and makes relevant information available on your web server.
 
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054. If there is an entry in [[Weather Diary]] for Today's date, and (in [[Cumulus.ini#Section:_Station]] is defined) current time is between the Snow update time (in [[Cumulus.ini]]) and midnight, then this web tag returns zero if snow falling check box not ticked or one if checkbox is ticked. If no Weather Diary entry found, this web tag returns Null.
| n/a
|-
|colspan="3" style="background:lightgray;"|Pressure
!style="width:600px" |Function
|-
!|<#DavisTotalPacketsReceived>
|1.9.2 onwards and MX
|Total number of data packets received.
|-
!|<#DavisTotalPacketsMissed>
|1.9.2 onwards and MX
|Number of missed data packets. From version 3.6.0 build 3076, optionally add "tx=n" parameter, where n=1-8 and equals the desired transmitter id.
|-
!|<#DavisMaxInARow>
|1.9.2 onwards and MX
|Longest streak of consecutive packets received. From version 3.6.0 build 3076, optionally add "tx=n" parameter, where n=1-8 and equals the desired transmitter id.
|-
!|<#DavisNumCRCerrors>
|1.9.2 onwards and MX
|Number of packets received with CRC errors. From version 3.6.0 build 3076, optionally add "tx=n" parameter, where n=1-8 and equals the desired transmitter id.
|-
!|<#DavisNumberOfResynchs>
|1.9.2 onwards and MX
|Number of times the console resynchronised with the transmitter
|-
!|<#DavisFirmwareVersion>
|1.9.2 onwards and MX
|The console firmware version
|-
!|<#THWindex>
|1.9.x
|A derived temperature using Temperature/Humidity/Wind values read from Davis DLL in Cumulus 1.9.x.
*Available from 1.9.2 Build 1009 (Aug 2011).
|-
!|<#THSWindex>
|(1.9.x and) MX
|A heat stress indicator using Temperature/Humidity/Solar/Wind values.
#Cumulus MX reads "LOOP2" packets, and the correct value for this tag can be read there and displayed on 'Now' template.
|-
!|<#battery>
|1.x.x and MX
|The console battery condition in volts. eg "4.82v"
|-
!|<#txbattery>
<#txbattery channel=1>
|1.8.9 onwards and MX
'''Cumulus 1.9.3 onwards Only:''' The optional 'channel' parameter returns the status for a particular transmitter, up to channel=8. The channel result is just the string "ok" or "LOW" for a low battery
|-
!|<#StormRain>
|1.x.x and MX
|The console 'storm rain' current amount (build 1090 onwards for Cumulus 1; 3021 onwards for MX)
|-
!|<#StormRainStart>
|1.x.x and MX
|The console reported '''date''' of the start of the 'storm' (the console does not report start time, but it appears a minimum of 2 tips within 3 hours will trigger a storm start, so using <#LastRainTipISO> in a script might help), but standard Cumulus [[Webtags#Time.2FDate_.27format.27_Parameter| date/time formatting]] can be applied to that date.
|<#DavisReceptionPercent tx=1>
|WLL transmitter reception percentage (replace 1 by any other transmitter number up to 8)
|-
|<#DavisTxRssi tx=0>
|WLL RSSI of the WiFi connection
|-
|<#DavisTxRssi tx=1>
|WLL RSSI of Transmitter #1 (replace 1 by any other transmitter number up to 8)
|WLL WiFi RSSI
|}
 
=== Davis AirLink ===
New from version 3.9.0. Not available for earlier MX, not available for Cumulus 1.
 
Note, that you can configure an Indoor or Outdoor (or both) AirLink, most people will use an outdoor. There are a similar set of tags for each device.
 
{| class="wikitable" border="1"
|-
!style="width:150px" |Web tag_name
!style="width:600px" |Function
|-
|colspan="2" style="background:lightgray;"|Particulate Matter
|-
|<#AirLinkPm1[InǀOut]>
|Current PM 1.0 count
|-
|<#AirLinkPm2p5[InǀOut]>
|Current PM 2.5 count
|-
|<#AirLinkPm2p5_1hr[InǀOut]>
|Last hour average PM 2.5 count
|-
|<#AirLinkPm2p5_3hr[InǀOut]>
|Last 3 hours average PM 2.5 count
|-
|<#AirLinkPm2p5_24hr[InǀOut]>
|Last 24 hours average PM 2.5 count
|-
|<#AirLinkPm2p5_Nowcast[InǀOut]>
|The 24 hour "nowcast" weighted average PM 2.5 count
|-
|<#AirLinkPm10[InǀOut]>
|Current PM 10 count
|-
|<#AirLinkPm10_1hr[InǀOut]>
|Last hour average PM 10 count
|-
|<#AirLinkPm10_3hr[InǀOut]>
|Last 3 hours average PM 10 count
|-
|<#AirLinkPm10_24hr[InǀOut]>
|Last 24 hours average PM 10 count
|-
|<#AirLinkPm10_Nowcast[InǀOut]>
|The 24 hour "nowcast" weighted average PM 10 count
|-
|colspan="2" style="background:lightgray;"|AQI Values
|-
|<#AirLinkAqiPm2p5[InǀOut]>
|Current PM 2.5 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm2p5_1hr[InǀOut]>
|Last hour average PM 2.5 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm2p5_3hr[InǀOut]>
|Last 3 hour average PM 2.5 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm2p5_24hr[InǀOut]>
|Last 24 hour average PM 2.5 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm2p5_Nowcast[InǀOut]>
|Last 24 hour "nowcast" weighted average PM 2.5 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm210[InǀOut]>
|Current PM 10 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm10_1hr[InǀOut]>
|Last hour average PM 10 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm10_3hr[InǀOut]>
|Last 3 hour average PM 10 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm10_24hr[InǀOut]>
|Last 24 hour average PM 10 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|<#AirLinkAqiPm10_Nowcast[InǀOut]>
|Last 24 hour "nowcast" weighted average PM 10 AQI value - allows use of the "dp=n" and "tc=y" parameters
|-
|colspan="2" style="background:lightgray;"|Stats Values
|-
|<#AirLinkPct_1hr[InǀOut]>
|Percentage of possible values that were included in the 1 hour averages
|-
|<#AirLinkPct_3hr[InǀOut]>
|Percentage of possible values that were included in the 3 hour averages
|-
|<#AirLinkPct_24hr[InǀOut]>
|Percentage of possible values that were included in the 24 hour averages
|-
|<#AirLinkPct_1hr[InǀOut]>
|Percentage of possible values that were included in the 24 hour weighted averages
|-
|colspan="2" style="background:lightgray;"|Sensor Info
|-
|<#AirLinkFirmwareVersion[InǀOut]>
|Shows the AirLink firmware version as a date string.
NOTE: This web tag requires a WeatherLink Pro subscription to work
|-
|<#AirLinkTemp[InǀOut]>
|The sensors internal temperatue value
|-
|<#AirLinkHum[InǀOut]>
|The sensors internal humidity value
|-
|<#AirLinkWifiRssi[InǀOut]>
|The sensors WiFi signal strength in dB - anything below -90 is considered very poor.
NOTE: This web tag requires a WeatherLink Pro subscription to work
|}
 
 
===Fine Offset===
5,838

edits