Webtags (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
no edit summary
mNo edit summary
(12 intermediate revisions by 2 users not shown)
Line 2: Line 2:
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 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 two sections on this page: [#Input Modification Parameters and Output Modification Parameters]] and  [[#The tag name]].
The new links to material that has been moved off this page can be found approximately where the material used to be within three sections on this page: [[#Input Modification Parameters and Output Modification Parameters]], [[#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.
[[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.
Line 23: Line 19:
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.
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>
</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? ==
==What is a web tag? ==


Line 143: Line 143:


For just a taste, there you can discover:
For just a taste, there you can discover:
* A score of [[Webtags/Parameters#Input_modification_Parameters|input modification parameters
* 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)
** 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 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:
Line 149: Line 149:
** 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.
** 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
* 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 [[Webtags/Parameters#Multiple_Output_Format_Modifier_parameters_for_times_and_dates|here]]
* 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|Multiple_Output_Format_Modifier_parameters_for_times_and_dates]]


== Why does MX talk about tokens? ==
== Why does MX talk about tokens? ==
Line 769: Line 769:


[[File:Badge vMx.png]] Unless otherwise indicated these web tags become available from release 3.9.5.
[[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"
{| class="wikitable" border="1"
Line 778: Line 774:
!style="width:150px" |Web tag_name
!style="width:150px" |Web tag_name
!style="width:600px" |Function
!style="width:600px" |Function
|-
| <#CO2>
| The actual CO<small>2</small>concentration in ppm
|-
|-
| <#CO2-pm2p5>
| <#CO2-pm2p5>
| Air Quality expressed in terms of particulate matter of 2.5 micrometres or less
| Air Quality expressed in terms of particulate matter of 2.5 μm/m<small>3</small> or less
|-
|-
| <#CO2-pm2p5-24h>
| <#CO2-pm2p5-24h>
| Air Quality expressed in terms of particulate matter of 2.5 μm, or less, Last 24 hours average
| Air Quality expressed in terms of particulate matter of 2.5 μm/m<small>3</small>, or less, 24 hours moving average
 
WILL SOMEBODY WHO KNOWS UPDATE THIS ENTRY AND OTHERS
|-
|-
| <#CO2-pm10>
| <#CO2-pm10>
| Air Quality expressed in terms of particulate matter of 10 μm, or less
| 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>
| <#CO2-pm10-24h>
| Air Quality expressed in terms of particulate matter of 10 μm, or less, Last 24 hours average  
| Air Quality expressed in terms of particulate matter of 10 μm/m<small>3</small>, or less, 24 hours moving average  
 
WILL SOMEBODY WHO KNOWS UPDATE THIS ENTRY AND OTHERS
|-
|-
| <#CO2-temp>
| <#CO2-temp>
| Temperature as reported by Air Quality monitor
| 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>
| <#CO2-hum>
Line 832: Line 829:
|-
|-
|<#AirQuality1>
|<#AirQuality1>
| Air quality index (24 hour) 1
| Air quality in μm/m<small>3</small> or less
|-
|-
|<#AirQuality2>
|<#AirQuality2>
| Air quality index (24 hour) 2
| Air quality in μm/m<small>3</small> or less
|-
|-
|colspan="2"|... and so on up to <#AirQuality4>
|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>
|<#LeakSensor1>
Line 864: Line 869:
==Recent History==
==Recent History==


While Cumulus is left running, from version 1.9.3 (beta build 1033 release 10 April 2012), every minute a set of current spot values is stored.  This '''high resolution data''' is kept for seven days, with the oldest set being discarded each time a new set is added.
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 is one tag name listed in the table below for each weather derivative available at the release you are running.  You pick the time in minutes ago using an input modification parameter choosing from those listed at [[Webtags/Parameters#Input Modification Parameters for Recent History]]. You can specify 1 to 10 079 minutes ago, and (to save dealing with large numbers) you can specify this using a combination of input parameters representing integer days, integer hours, and integer minutes.
===Using input/output modification parameters with recent history tag names===


===What happens when I need to stop and restart Cumulus?===
'''All tag names listed below, require the mandatory input modification parameters specified in this table.'''
 
This depends on the release you are running.  
The optional output modification parameters available are as specified in this table, depending on tag name:
 
{| class="wikitable" border="1"
The graph images that Cumulus 1 generates, the data for the detailed charts that MX can plot, and various internal calculations that MX makes, and indeed the recent history web tags themselves, all access data for the recent past.  That data is available at one minute intervals, since you started Cumulus, because of this recent history functionality. But if those charts, or calculations, need to include a period before Cumulus was started, then they might be using archive data obtained from your weather station.
|-
 
!style="width:150px" | Tag names
====MX release 3.12.0 (beta build 3134) onwards====
!style="width:200px" | Mandatory Input Modification Parameters
 
!style="width:200px" | Optional Output Modification Parameters
The recent history is stored in a SQLite3 database table [[cumulusmx.db#Release 3.12.0 onwards|RecentData]] and therefore if you stop MX, the recent history data up to the time MX stopped has become persistent, and is available when MX starts again. Thus the charts, and internal calculations, mentioned above can make use of recent history data from the previous Cumulus session.
|-
 
| <#RecentTS> (see [[#Table of Recent History tag names available]]
When you do restart MX, if your weather station can store historic data, then its logger is read during the restart as archive data for the period since MX was last running until the time of restart, and obviously only available at the resolution of that historic data (be it every 10 minutes, or every 30 minutes or whatever).
| 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]]
If MX was stopped for a short period, then on restarting MX, the '''RecentData''' table will be updated by discarding any rows over 7 days old, and for the times during the '''short period''' adding that archive data at whatever station logging interval resolution is available.
|-
 
| All other tag names in [[#Available in 1.9.3, 1.9.4, and all MX releases]] and [[#Available in MX only]]
If Cumulus MX is offline for a prolonged period, (and when you first run 3.12.0, as the '''RecentData''' table does not yet exist) then all the data for the previous just over 10 thousand minutes will be at this lower station logging interval resolution.
| 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:
====Legacy release 1.9.3 to MX 3.11.4====
* 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.
The 'recent historical data' is based on an array stored by the Cumulus code, it is actually held in a [https://cumulus.hosiene.co.uk/viewtopic.php?p=100098#p100098 SQLite database], but the database is held '''in-memory''', not as an external database, so it only exists while Cumulus is running.  Therefore, if Cumulus stops, all the high resolution data is lost.
|}
 
When you do restart MX, if your weather station can store historic data, then its logger is read during the restart as archive data for the period from 7 days ago until the time of restart, and obviously only available at the station logging interval resolution of that historic data (be it every 10 minutes, or every 30 minutes or whatever).
 
===If the derivative you want is not available in your Cumulus release===
 
As Cumulus has developed, it has been able to calculate more [[Feels Like|weather derivatives]] and more recent history tag names have become available (sometimes recent history tag names have been added in a later release than the release that started calculated the derivative).
 
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.
 
===Warning when Daylight Saving Time starts or ends===


Note that Cumulus uses current time, read from the computer, for recent history records.
=== Table of Recent History tag names available ===


For version 1.9.3 to release 3.11.4, current time determines which array element is used for storing the set of values. 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.
One tag name is available since 1.9.3 to report the time associated with values you request.
 
Hence even if you use 10am for your rollover time in summer (so all your days, even when clock changes happen, are 24 hours long), 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.
 
One assumes the same applies from release 3.12.0, but it depends how MX has been coded, as a SQLite3 database uses row numbers as its primary key, and could technically therefore retain the missing hour.
 
=== Table of Recent History web tags available ===
 
 
[[#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"
{| class="wikitable" border="1"
|-
|-
Line 924: Line 909:
|Gives the timestamp of the data that will be returned for any other recent history tag that uses same '''d, h, and m''' parameters
|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
|<#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
|colspan="3" style="background:lightgray;"|Temperature & Humidity tags
Line 932: Line 926:
|-
|-
|<#RecentWindChill>
|<#RecentWindChill>
|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).
|Wind Chill  
| <#RecentWindChill d=48 m=1> reports the wind chill temperature 2 days ago
| <#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>
|<#RecentDewPoint>
Line 963: Line 941:
| 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)
| 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
|colspan="3" style="background:lightgray;"|Wind <br>(Note: Wind 'Speed', 'Gust' and 'Latest' have the usual Cumulus meanings see [[Wind measurement]])
|-
|-
|<#RecentWindSpeed>
|<#RecentWindSpeed>
Line 976: Line 954:
|-
|-
|<#RecentWindLatest>
|<#RecentWindLatest>
|Wind Latest. Note: Wind 'Speed', 'Gust' and 'Latest' have the usual Cumulus meanings
|Wind Latest.  
| 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)
| 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)
|-
|-
Line 1,010: Line 988:
|}
|}


=== Other weather derivatives ===
====Available in MX only====


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.
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)
 
{| 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
==== Canadian Humidity Index ====
!style="width:150px" | Introduced
 
!style="width:600px" | Function
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.
!style="width:600px" | Input Modification Parameters example
 
|-
Cumulus 1:
|colspan="4" style="background:lightgray;"|Indoor 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);
|colspan="4" style="background:lightgray;"|Outdoor Temperature & Humidity tags
 
|-
Cumulus MX:
|<#RecentWindChill>
 
| Legacy Cumulus version 1.8.5
svp = 6.112 * Math.exp((17.62 * <#RecentOutsideTemp h=3) / (243.12 + parseFloat(<#RecentOutsideTemp h=3)));
|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).
H = (5/9 * (<#RecentHumidity h=3> /100 * svp - 10)) + <#RecentOutsideTemp h=3;
| <#RecentWindChill d=48 m=1> reports the wind chill temperature 2 days ago
 
|-
==== Apparent Temperature and Feels Like ====
|<#RecentFeelsLike>
 
| Available from version 3.6.11 (build 3087) onwards.
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:
| Feels Like Temperature
 
| <#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>))));
|-
var appTempDegC = parseFloat(<#RecentOutsideTemp h=3) + (0.33 * actualVaporPress) - (0.7 * <#RecentWindSpeed h=3>) - 4;
|<#RecentHumidex>
 
| Available from version 3.7.0 (build 3089) onwards.
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:
| Canadian Humidity Index (humidex) Dimensionless - no units
 
| <#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 ==
== System ==

Navigation menu