Webtags (preserving history): Difference between revisions

m
no edit summary
m (→‎Today.ini: Rewrite of text before table)
mNo edit summary
(15 intermediate revisions by 2 users not shown)
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.
 
The new links to material that has been moved off this page can be found approximately where the material used to be within twothree sections on this page: [[#Input Modification Parameters and Output Modification Parameters]] and , [[#The tag name]], and [[#Recent History]].
 
=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.
 
[[File:Badge v1.png]][[Category:Cumulus 1]] This page was created for Cumulus 1. Steve/Beth Loft provided some example [[Cumulus template file|web template files]], but expected Cumulus users to develop their [[Customised templates|own Cumulus template files]] making use of the web tags, listed below, that the software provided.
Continue reading this Wiki Page if you are using your own (customised) web pages, using legacy web pages, ''or'' want a definitive list of all available web tags.
</div>
 
{{TOCright}}
=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.
 
==What is a web tag? ==
 
 
For just a taste, there you can discover:
* A score of [[Webtags/Parameters#Input_modification_Parameters|input modification parameters]]
** For example, find which attribute is used with a value between 1 and 12, so the same tag name can give values for 12 different months)
* If your locale normally (in real numbers) uses an integer part, then a comma, and then the decimal part, you should be aware that some computer scripts, and some external servers where you might want to send data, insist on a decimal point, instead of a decimal comma:
** If you have the legacy Cumulus 1 installed, stay on this page and look at [[#No_Commas]], as you have to use the restricted alternative set of tag names.
* How to [[Webtags/Parameters#Two_Output_.28format_modifier.29_parameters_for_decimal_places|control number of decimal places]] in any real number output
* All about the complex subject of modifying the way a '''duration''', a ''date'', or a '''clock time''' is output by looking at [[Webtags/Parameters#Multiple_Output_Format_Modifier_parameters_for_times_and_dates|hereMultiple_Output_Format_Modifier_parameters_for_times_and_dates]]
 
== Why does MX talk about tokens? ==
 
[[File:Badge vMx.png]] Unless otherwise indicated these web tags become available from release 3.9.5.
 
<big>THE INFORMATION HERE IS TAKEN FROM RELEASE ANNOUNCEMENTS THAT DO NOT EXPLAIN WHAT THESE WEB TAGS REPORT
 
PLEASE WOULD SOMEBODY WHO UNDERSTANDS THIS TERMINOLOGY UPDATE THE FOLLOWING TABLE</big>
 
{| class="wikitable" border="1"
!style="width:150px" |Web tag_name
!style="width:600px" |Function
|-
| <#CO2>
| The actual CO<small>2</small>concentration in ppm
|-
| <#CO2-pm2p5>
| Air Quality expressed in terms of particulate matter of 2.5 micrometresμm/m<small>3</small> or less
|-
| <#CO2-pm2p5-24h>
| Air Quality expressed in terms of particulate matter of 2.5 μm/m<small>3</small>, or less, Last 24 hours moving average
 
WILL SOMEBODY WHO KNOWS UPDATE THIS ENTRY AND OTHERS
|-
| <#CO2-pm10>
| Air Quality expressed in terms of particulate matter of 10 μm/m<small>3</small>, or less (yes, this includes the 2.5 figure)
|-
| <#CO2-pm10-24h>
| Air Quality expressed in terms of particulate matter of 10 μm/m<small>3</small>, or less, Last 24 hours moving average
 
WILL SOMEBODY WHO KNOWS UPDATE THIS ENTRY AND OTHERS
|-
| <#CO2-temp>
| Temperature as reported by Air Quality monitor.
 
Note that this temperature has nothing to do with the temperature as reported by the main weather station. It reflects the temperature of the sensor and would be used in combination with the sensors measured humidity (see next) for correction of the measured PM (particulate matter) value. Determination of how to correct the PM value is highly dependent on the conditions and placement of the sensor. See the specification sheet for the sensor or create some multivariate regression line based on calibration measurements. This is also valid for PM sensors like the AirLink. The normal amateur usage of PM sensors is that the uncorrected values are published.
|-
| <#CO2-hum>
|-
|<#AirQuality1>
| Air quality indexin (24μm/m<small>3</small> hour)or 1less
|-
|<#AirQuality2>
| Air quality indexin (24μm/m<small>3</small> hour)or 2less
|-
|colspan="2"|... and so on up to <#AirQuality4>
|-
|<#AirQualityAvg1>
| 24 hr running average Air quality in μm/m<small>3</small> or less
|-
|<#AirQualityAvg2>
| 24 hr running average Air quality in μm/m<small>3</small> or less
|-
|colspan="2"|... and so on up to <#AirQualityAvg4>
|-
|<#LeakSensor1>
==Recent History==
 
Please refer to the [[Recent history]] page for full information about using the tags in the following two tables, as material once on this page has been moved there.
There are a set of web tags for 'recent historical data', based on an array stored by Cumulus giving data values from 1 minute ago, up to 1 week ago, in 1 minute intervals. As Cumulus runs it will add the latest values to the array with full resolution, and shift existing values along so those older than 7 days fall off.
*The input modification parameters available are listed at [[Webtags/Parameters#Input Modification Parameters for Recent History]].
**To save you looking up the details, these input parameters specify how many minutes ago is required. Instead of entering a very large number for minutes, you can include separate input parameters for days, hours, and minutes, ago.
**Examples appear in the table below, with explanations
 
===Using input/output modification parameters with recent history tag names===
Following the table giving the tag names actually available, there is a section on how to derive a few more weather derivatives using a combination of the tag names shown.
 
'''All tag names listed below, require the mandatory input modification parameters specified in this table.'''
The optional output modification parameters available are as specified in this table, depending on tag name:
{| class="wikitable" border="1"
|-
!style="width:150px" | Tag names
!style="width:200px" | Mandatory Input Modification Parameters
!style="width:200px" | Optional Output Modification Parameters
|-
| <#RecentTS> (see [[#Table of Recent History tag names available]]
| Mandatory parameters as table at [[Webtags/Parameters#Input_modification_Parameters]]
| Optional parameters to modify the time format described in tables starting at [[Webtags/Parameters#Multiple_Output_Format_Modifier_parameters_for_times_and_dates]]
|-
| All other tag names in [[#Available in 1.9.3, 1.9.4, and all MX releases]] and [[#Available in MX only]]
| Mandatory parameters as table at [[Webtags/Parameters#Input_modification_Parameters]]
| Whether you can modify the way these values are output depends on release you are using:
* From release 3.10.5: Please see tables at [[Webtags/Parameters#Output_Modification_Parameter_for_changing_any_decimal_comma_into_a_decimal_point]] and [[Webtags/Parameters#Controlling_the_number_of_decimal_places]]
* For legacy Cumulus, and earlier MX releases, no output format modification parameters are available, instead see [[#No_Commas]] section on this page.
|}
 
=== Table of Recent History tag names available ===
===Warning when Daylight Saving Time starts or ends===
 
Note that Cumulus uses current time, read from the computer, to determine which array element it stores each value in.
 
Hence ''when clocks go back'' the value stored for winter time overwrites the value previously stored for same time during summer time for the relevant repeating hour.
 
Hence even if you use 10am for your rollover time in summer, you will not have access to a whole hour worth of data when the clocks change
* ''when the clocks go back'', one hour has been overwritten; or
* ''when the clocks go forward'', one hour in the array simply does not exist.
 
=== Table of Recent History web tags available ===
 
 
One tag name is available since 1.9.3 to report the time associated with values you request.
[[#No_Commas]] versions of the array are available for use in script. If you use MX, the tag names in this table can take a [[Webtags/Parameters#Output Modification Parameter for Removing Commas|rc=y]] parameter.
 
Although as [[Recent history]] page explains, the history is intended to cover every minute in last 7 days, some entries may be at less frequent intervals, and when clocks change some entries will be missing altogether.
{| class="wikitable" border="1"
|-
|Gives the timestamp of the data that will be returned for any other recent history tag that uses same '''d, h, and m''' parameters
|<#RecentTS h=3 m=1 format="HH:nn"> for cumulus 1; <#RecentTS h=3 m=1 format="HH:mm"> for cumulus MX
|}
 
====Available in 1.9.3, 1.9.4, and all MX releases====
 
{| class="wikitable" border="1"
|-
!style="width:150px" | Tag_name
!style="width:600px" | Function
!style="width:600px" | Input Modification Parameters example
|-
|colspan="3" style="background:lightgray;"|Temperature & Humidity tags
|-
|<#RecentWindChill>
|Wind Chill
|Wind Chill (if temperature is below 10°C or 50 °F, then the new Feels Like now available in MX (next item) will report this same value).
| <#RecentWindChill d=48 m=1> reports the wind chill temperature 2 days ago
|-
|<#RecentFeelsLike>
| [[File:Badge v1.png]] Not available in Cumulus 1.
 
[[File:Badge vMx.png]] Available from version 3.6.11 (b.3087) onwards.
 
Feels Like Temperature
|<#RecentFeelsLike h=12 m=1> reports the feel like temperature 12 hours ago
|-
|<#RecentHumidex>
| [[File:Badge v1.png|File]] Not available in Cumulus 1.
 
[[File:Badge vMx.png]] Available from version 3.7.0 (build 3089) onwards.
 
Canadian Humidity Index (humidex) Dimensionless - no units
|<#RecentHumidex h=3> reports humidex 3 hours ago
|-
|<#RecentDewPoint>
| d=n (where n runs 0 to 6) days ago; h=n (where n is any number of hours ago); m=n (where n is any number of minutes ago)
|-
|colspan="3" style="background:lightgray;"|Wind <br>(Note: Wind 'Speed', 'Gust' and 'Latest' have the usual Cumulus meanings see [[Wind measurement]])
|-
|<#RecentWindSpeed>
|-
|<#RecentWindLatest>
|Wind Latest.
|Wind Latest. Note: Wind 'Speed', 'Gust' and 'Latest' have the usual Cumulus meanings
| d=n (where n runs 0 to 6) days ago; h=n (where n is any number of hours ago); m=n (where n is any number of minutes ago)
|-
|}
 
====Available in MX only====
=== Other weather derivatives ===
 
Please note this section has NOT yet been updated for recent MX releases, it appears from [[cumulusmx.db|RecentData table in cumulusmx.db]] that the list here is not complete for MX. However, no release announcement has been found listing tag names not shown here (i.e. apparent temperature, indoor temperature and humidity, air quality)
Although Humidex, 'Apparent Temperature', 'Feels Like temperature' and others listed in Current Conditions section, are not available at all versions, they can be calculated in a script from recent 'outside temperature', 'wind speed', and 'relative humidity' values (using the same time selection for all). There are other derivatives that can be calculated similarly from a set of simultaneous values. Note that Cumulus 1 and MX do not always use identical formula, and although MX added Feels Like it has changed the formula a few times.
{| class="wikitable" border="1"
 
|-
The relevant formulae using JavaScript, adjust for other languages, for some of these are shown below:
!style="width:150px" | tag_name
 
!style="width:150px" | Introduced
==== Canadian Humidity Index ====
!style="width:600px" | Function
 
!style="width:600px" | Input Modification Parameters example
If you are in USA and use Fahrenheit instead of Celsius, you will need to omit the 5/9 term, but as the index is dimensionless no other conversion is needed. This example is for 3 hours ago, change the input parameters to suit your need.
|-
 
|colspan="4" style="background:lightgray;"|Indoor Temperature & Humidity tags
Cumulus 1:
|-
 
|colspan="4" style="background:lightgray;"|Outdoor Temperature & Humidity tags
H = <#RecentOutsideTemp h=3> + 5/9 * (6.1094 * Math.exp(5417.753 *(1/273.16 - 1/ (273.16 + <#RecentDewPoint h=3> )))-10);
|-
 
|<#RecentWindChill>
Cumulus MX:
| Legacy Cumulus version 1.8.5
 
|Wind Chill (if temperature is below 10°C or 50 °F, then the new Feels Like now available in MX (next item) will report this same value).
svp = 6.112 * Math.exp((17.62 * <#RecentOutsideTemp h=3) / (243.12 + parseFloat(<#RecentOutsideTemp h=3)));
| <#RecentWindChill d=48 m=1> reports the wind chill temperature 2 days ago
H = (5/9 * (<#RecentHumidity h=3> /100 * svp - 10)) + <#RecentOutsideTemp h=3;
|-
 
|<#RecentFeelsLike>
==== Apparent Temperature and Feels Like ====
| Available from version 3.6.11 (build 3087) onwards.
 
| Feels Like Temperature
Note this apparent temperature formula uses Celsius for temperature and '''metres per second''' for wind speed. You will need to do the appropriate conversions from the quoted recent history tags if you use different units. The Australian Apparent temperature formula is same for Cumulus 1 and MX:
| <#RecentFeelsLike h=12 m=1> reports the feel like temperature 12 hours ago
 
|-
var actualVaporPress = <#RecentHumidity h=3>/100) * 6.105 * Math.exp(17.27 * <#RecentOutsideTemp h=3>) / (237.7 + parseFloat(<#RecentOutsideTemp h=3>))));
|<#RecentHumidex>
var appTempDegC = parseFloat(<#RecentOutsideTemp h=3) + (0.33 * actualVaporPress) - (0.7 * <#RecentWindSpeed h=3>) - 4;
| Available from version 3.7.0 (build 3089) onwards.
 
| Canadian Humidity Index (humidex) Dimensionless - no units
Feels Like was implemented as a recent history web tag at version 3.6.11 (see [[#Feels_Like|Feels Like section below Current condition web tags]]) for the gradual introduction of feels like elsewhere. For earlier MX versions, and if you are using Cumulus 1, you can calculate it:
| <#RecentHumidex h=3> reports humidex 3 hours ago
 
|-
The formulas below use Celsius for temperature and '''km per hour''' for wind speed. Again, you will need to do the appropriate conversions from the quoted recent history tags if you use different units.
|colspan="4" style="background:lightgray;"|Air Quality tags
 
|}
Calculation from recent history tags is much more complicated because there are 3 different calculations: Feels Like reports exactly same as wind chill for temperatures '''below''' 10°C or 50°F so the WC here should equal <#RecentWindChill h=3>:
<pre>if(<#RecentWindSpeed h=3> < 4.828) WC = <#RecentOutsideTemp h=3>;
else{
wind_pow = Math.pow(<#RecentWindSpeed h=3>, 0.16);
WC = (13.12 + 0.1625 * <#RecentOutsideTemp h=3>) - (11.37 * wind_pow) + (0.3965 * <#RecentOutsideTemp h=3> * wind_pow);// Brackets used to ensure "+" is interpreted as addition not concatenation
} </pre>
 
For temperatures '''above''' 20°C or 68°F Feels Like uses a different way to calculate apparent temperature that it uses at these higher temperatures (this formula only used for 3.6.10 onwards):
<pre>var actualVaporPress = <#RecentHumidity h=3>/100) * 6.112* Math.exp((17.62 * <#RecentOutsideTemp h=3>)/(243.12 + <#RecentOutsideTemp h=3>)) / 10.0; // Not same as at build 3084
/* uses kilometres per hour for wind speed */
/* What Cumulus MX will use to calculate apparent temperature for feels like is changed very slightly */
if(<#RecentWindSpeed h=3> > 72) <#RecentWindSpeed h=3> =72;
AT= (1.04 * <#RecentOutsideTemp h=3>) + (2 * actualVaporPress) - (0.1805553 * <#RecentWindSpeed h=3>) - 2.7;</pre>
 
For in-between temperatures it uses a more complicated merge of the two formulas for AT and WC as defined above:
<pre>app_temp_mult = (<#RecentOutsideTemp h=3> - 10) / 10;
wind_chill_mult = 1 - app_temp_mult;
 
FL= AT * app_temp_mult + WC * wind_chill_mult;</pre>
 
== System ==