Webtags (preserving history): Difference between revisions

m
Assorted simplifications of complex page
m (Assorted simplifications of complex page)
Line 12: Line 12:
</div>
</div>


=Essential background reading=


=Introduction=
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]].


This page was written in August 2009, to list the tags for the (legacy) Cumulus 1 software.
<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>


Initially, there were going to be further pages to explain individual web tags, e.g. [[Forecast_webtag]]; but that idea was never completed.
==General Format for Web Tags==


This page was updated to cover MX, when it came out of beta (3.0.0), and <div style="background: LemonChiffon;padding:5px; margin:2px;">this page currently covers legacy 1.9.4, and MX up to '''3.12.0'''</div>
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>


==What is a web tag? ==
===Applicability to Cumulus 1 and to MX===


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.
Various approaches are trialled in the list for indicating which flavours a web tag exists for. The [[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.


==Template files can create many types of file==
There is some more information on [[Webtag Applicability|Web tag Applicability page]].


The output file can be:
===Input Modification Parameters and Output Modification Parameters===
* a [[Customised_templates#HTML_5_-_a_very_quick_guide_to_structure|web page]],
* a  [[Php_webtags#Option_3:_JavaScript_Object_Notation|JavaScript Object Notation (.json) file]]
* a [[Feels_Like#HTML_code_to_translate_web_tags_to_JavaScript_variables_.28as_modified_for_additional_parameters.29|JavaScript file]],
* a [[PHP]] script file, or
*a [[Xml_webtags|eXtensible Mark-up Language (XML)]] file.


==General Format for Web Tags==
MX has introduced many more of these, so they are no longer listed on this page.


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>
Now to find out what is allowed for the '''input selection parameters''' and '''output modification parameters''', refer to [[Webtags/Parameters|web tag parameters]] page.


To find out what is allowed for '''tag_name''', see the various tables later on this 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)


To find out what is allowed for the '''input selection parameters''' and '''output modification parameters''', refer to [[Webtags/Parameters|web tag parameters]] page.
===Web tag names===


==What this page covers ==
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.


{{TOCright}}
====General Tip====
#At the last count, a 3.5.x version of MX produces ''nine and a half million'' '''web tags'''! 
# 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 the optional input parameters that allow 717 tag names to define 9½ million values!
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...
*Adding all possible different output parameters generates the billions of different outputs!
<code>ListWebTags=1</code>


Consequently, this article describes:
Then start Cumulus and it will create a file called WebTags.txt in the same folder as where the executable is found. That file will list all the tags your build of Cumulus can currently 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.
*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'''


==What is covered on another page==
An example of the output for an early MX version is at the end of this page (the actual output does not include commas, and has just one item per line, it has been compressed for inclusion in this article).


The parameters you can use with web tags are explained on the [[Webtags/Parameters|parameters page]], there you can discover:
To stop Cumulus continuing to produce new versions of that file change the line to say ...
*A score of input parameters that modify some of those tags (meaning some web tags can represent 12 different months for example)
<code> ListWebTags=0</code>
*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)


{{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.


The tables below are not able to indicate which of the billions of combinations possible are valid or invalid for particular tag names nor for particular release versions..
[[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.


==Applicability by flavour, and by release version and build==
====Web tags mentioning (outside) temperature====


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.
'''For Oregon Scientific weather stations using USB connections''' (e.g. WMR-200) that can have multiple temperature sensors, it is posible to configure which sensor the main 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:
# Stop Cumulus in the normal way
# Use a text editor to edit the file called ''Cumulus.ini''
# Scroll down to the line that contains '''[Station]'''
# Create a blank line below it by pressing ''Return''
# In that new line, type the command shown in the code box below, type the attribute and equals sign exactly as shown without spaces (regardless of your exact model), but for the value replace ''N'' with the relevant number from the following list:
#* To use the main sensor, replace N with '''0''' (or don't bother with this procedure, as that is default)
#* To use Extra Temp 1 sensor, replace N with '''1'''
#* To use Extra Temp 2 sensor, replace N with '''2'''
#* and so on, up to a possible maximum (check with your weather station, but Cumulus can accept up to 12)
# Save the file, and exit
# Restart Cumulus in the normal way
<code>WMR200TempChannel=N</code>


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.
Various approaches are trialled in the list for indicating which flavours a web tag exists for.  The [[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.


There is some more information on [[Webtag Applicability|Web tag Applicability page]].
'''For other weather stations''', the main sensor is 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.


== Why does MX talk about tokens? ==
== Why does MX talk about tokens? ==
Line 82: Line 84:
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.


=GENERAL TIP=


The web tags available in the 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...
==Scary statistics==
{{TOCright}}
# The 3.5.0 release of MX defines 9½ million values that can be represented using '''web tags'''!
# At 3.5.0, there are only 717 options for the '''tag_name''' in the general format given above.
# How come this discrepancy?
# That discrepancy is purely because some of those 717 tag names can be associated with input parameters, (and for Oregon Scientific stations,you can select which temperature is reported from  that affect what value is selected to be output by the web tag
# These millions of web tags can actually produce billions of different outputs!
# How come this second discrepancy?
# Well adding all possible different output parameters generates the billions of different ways to output the millions of values!
The statistics quoted above keep increasing as MX is developed, the last time I checked, there were another forty or so tag names, and lots more parameters, so the alternatives are probably well over ten million now.


ListWebTags=1
== Brief history of this page==


Then start Cumulus and it will create a file called WebTags.txt in the same folder as where the executable is found. That file will list all the tags your build of Cumulus can currently 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.  
This page was created in August 2009, to list the tags for the (legacy) Cumulus 1 software. Initially, there were going to be further pages to explain individual web tags, e.g. [[Forecast_webtag]]; but that idea was never completed. 
 
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.
 
 
 
.


An example of the output for an early MX version is at the end of this page (the actual output does not include commas, and has just one item per line, it has been compressed for inclusion in this article).
==Still got questions?==


To stop Cumulus continuing to produce new versions of that file change the line to say ...
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.


ListWebTags=0
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.


{{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 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.




Line 198: Line 225:
{{Template:WorkInProgressBanner}}
{{Template:WorkInProgressBanner}}


Here follow tables indicating what web tags 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 ==
== System ==
Line 609: Line 636:
|<#temp>
|<#temp>
|The outside (air) temperature
|The outside (air) temperature
For Oregon Scientific models like WMR-200 with USB connection, please refer to [[#Web tags mentioning (outside) temperature]] because any of the [[#Extra Sensors: Davis models and Oregon Scientific WMR928, WR100/200|extra sensors]] can be reported in '''<#temp>''', and consequently also have web tags reporting daily extremes and longer period extreme records.
|-
|-
|<#intemp>
|<#intemp>
Line 862: Line 891:
These web tags hold current values for additional sensors supported by Cumulus 1 and MX.  
These web tags hold current values for additional sensors supported by Cumulus 1 and MX.  


 
For Oregon Scientific model like WMR-200 with USB connection, please refer to [[#Web tags mentioning (outside) temperature]] because any of the extra temperature tags below can be redirected to '''<#temp>''', and consequently also have web tags reporting daily extremes and longer period extreme records.
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,081: Line 1,110:
| Relative Humidity as reported by Air Quality monitor
| Relative Humidity as reported by Air Quality monitor
|}
|}
=====Extra Sensors: Ecowitt WH34 soil and water sensor=====
Cumulus MX can support the Ecowitt WH34 (other model types exist and are reported here as if WH34) soil and water temperature sensors.
They are reported as "User Temperture 1" to "User Temperature 8", as listed in the table within next sub-section.


=====Extra Sensors: Ecowitt Air quality, leak sensors, lighting detector, and extra temperature sensors=====
=====Extra Sensors: Ecowitt Air quality, leak sensors, lighting detector, and extra temperature sensors=====
 
{{Version badge 1}} Not available in Cumulus 1.


[[File:Badge vMx.png]] Please see release announcements for when individual web tags became available
[[File:Badge vMx.png]] Please see release announcements for when individual web tags became available


This section applies only to those using Ecowitt GW1000 (Froggit DS1500) an interface unit that picks up various external sensors and sends the data via an application programming interface to MX which then generates the following web tags:
This sub-section applies only to those using Ecowitt GW1000 (also Froggit DS1500, and other equivalents, see [[Supported Devices]]) an interface unit that picks up various external sensors and sends the data via an application programming interface to MX which then generates the following web tags:
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,095: Line 1,130:
|-
|-
|<#GW1000FirmwareVersion>
|<#GW1000FirmwareVersion>
|{{Version badge 1}} Not available in Cumulus 1.
|GW1000 firmware version string
 
[[File:Badge vMx.png]]GW1000 firmware version string
|}
|}


Line 1,117: Line 1,150:
|-
|-
|<#LightningDistance>
|<#LightningDistance>
 
|Distance to last strike (same units as wind run - miles/km/nm) (Returns 0.0 if you don't have a sensor, GW1000 api returns max value you can put in a byte - 0xFF which translates to 158.4 miles = 255 km if have sensor but no strike detected yet, so MX translates that to '----')
|{{Version badge 1}} Not available in Cumulus 1.
 
[[File:Badge vMx.png]] see release announcements for version availability
 
Distance to last strike (same units as wind run - miles/km/nm) (Returns 0.0 if you don't have a sensor, GW1000 api returns max value you can put in a byte - 0xFF which translates to 158.4 miles = 255 km if have sensor but no strike detected yet, so MX translates that to '----')
|-
|-
|<#LightningTime>
|<#LightningTime>
 
|Date and Time of last strike (default without output parameters is locale's short time format e.g. 18:02 or 6:02 pm, without date, but tag accepts both date and time output parameters). Returns '----' if you don't have sensor or there has not been a strike since the sensor was installed. (GW1000 api returns FFFF FFFF seconds after midnight on 01 Jan 1970, which translates to 07/02/2106 06:28:15, so MX translates that to '----')
|{{Version badge 1}} Not available in Cumulus 1.
 
[[File:Badge vMx.png]] see release announcements for version availability
 
Date and Time of last strike (default without output parameters is locale's short time format e.g. 18:02 or 6:02 pm, without date, but tag accepts both date and time output parameters). Returns '----' if you don't have sensor or there has not been a strike since the sensor was installed. (GW1000 api returns FFFF FFFF seconds after midnight on 01 Jan 1970, which translates to 07/02/2106 06:28:15, so MX translates that to '----')
|-
|-
|<#LightningStrikesToday>
|<#LightningStrikesToday>
 
|Number of strikes since midnight, default 0
|{{Version badge 1}} Not available in Cumulus 1.
 
[[File:Badge vMx.png]] see release announcements for version availability
 
Number of strikes since midnight, default 0
|-
|-
|<#UserTemp1>  
|<#UserTemp1>  
 
|User Temperature 1
|{{Version badge 1}} Not available in Cumulus 1.
 
[[File:Badge vMx.png]] see release announcements for version availability
 
User Temperature 1
support for the Ecowitt WH34 (other model types exist and are reported here as if WH34) soil and water temperature sensors
|-
|-
|colspan="2"|... and so on up to <#UserTemp8> = User temperature 8
|colspan="2"|... and so on up to <#UserTemp8> = User temperature 8
5,838

edits