Webtags (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
→‎Today: Snow explanation rewritten to emphasise C1 and MX differences
m (→‎Today: Snow explanation rewritten to emphasise C1 and MX differences)
(10 intermediate revisions by 2 users not shown)
Line 29: Line 29:
=What this article covers =
=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?
#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 these optional parameters that allow 717 tag names to define 9½ million values!
*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!
*Adding all possible different output parameters generates the billions of different outputs!


Consequently, this article describes:
Consequently, this article describes:
*Over 7 hundred web tags
*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'''
*A score of input parameters that modify some of those 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
*The components that make up output parameters (a guide to how you modify the output format)
** some control number of decimal places
** some control number of decimal places
** one controls whether decimal comma appears
** one controls whether decimal comma (if used) is replaced by decimal point (useful for some script languages)
**the majority modify almost all web tags that report a time and/or date
**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
*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 you.
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..


==Applicability by version and build==
==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 to tell you precisely how you use web tags at any version.
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 possible the tables below do not list all 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.  
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.  
[[File:Badge v1.png]]This badge is used to highlight text that applies to Cumulus 1.  
Line 255: Line 259:
===Inconsistency in use of "T"===
===Inconsistency in use of "T"===


*Some web tags for '''today''' include a "T" as a suffix, some do not.  
*The newer web tags for '''today''' include a "T" as a suffix, the older ones do not.
*"T" is used in combination with the web tag name for a value, so a similar name is used for the time-stamp tags
**The lack of a "T" in some today tags causes some confusion with all-time record tags as they have a similar naming structure to these older today 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 prefix sometimes and  
**the T is a suffix sometimes  
**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.
**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===
===Choosing script variable names derived from tag names===
Line 371: Line 377:


For web tags it is much more complicated, simply because it is not just month we may be representing, and we might require only one specifier (being careful whether we use a standard or custom modifier) or we might want to specify a combination of modifiers (and we might want to add a space character or other literals). It is difficult to summarise, but here are some potential issues:
For web tags it is much more complicated, simply because it is not just month we may be representing, and we might require only one specifier (being careful whether we use a standard or custom modifier) or we might want to specify a combination of modifiers (and we might want to add a space character or other literals). It is difficult to summarise, but here are some potential issues:
* the reserved characters change between C1 and MX (affecting use of literals like "on" and "at" which are commonly required)
* 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
* 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)
* in MX space in some cases may need to be within the single quotes containing other literals (as space can modify the interpretation of a modifier 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.
'''Confused even more now?''' I'm not surprised, but maybe some examples will help before we actually list the available modifiers.
Line 454: Line 461:
|ddddd
|ddddd
|d (as single character format)
|d (as single character format)
|Displays the date using the format given by the Short Date format.  [[File:Badge vMx.png]]The MX parameter cannot be combined with any other parameters.
|{{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">
|e.g. '22/03/2019' (British Locale) produced by {{Version badge 1}}<#metdate format=dddd>
[[File:Badge vMx.png]]<#metdateyesterday format=d> ''but not''  <#yesterday=d> which would return just '22'
|-
|-
|dddddd
|dddddd
Line 578: Line 586:
|-
|-
|(not available)
|(not available)
|0zzz
| zzz
|Displays the offset of any time from UTC in hours and minutes
|Displays the offset of any time from UTC in hours and minutes
| e.g.-07:00
| e.g.-07:00
|-
|-
Line 770: Line 778:
**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.
**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''':
See https://cumulus.hosiene.co.uk/viewtopic.php?p=145050#p145050 for post example
<pre><#time format="yyyy-MM-dd hh:mm:ss">,<#temp rc=y>,<#hum>,<#dew rc=y>,<#RecentFeelsLike rc=y d=1></pre>
 
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. I have not included an example of how to process it, but if you know how to process HTML forms using POST you should be able to implement this Cumulus api approach. If your experience does not cover HTML form handling, then you are unlikely to use this api.


=The Web Tags for Cumulus =
=The Web Tags for Cumulus =
Line 1,745: Line 1,750:
|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
|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
| 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>
|<#snowdepth>
|If there is an entry in the Weather Diary for Today, returns the value set there. Returns 0 otherwise.
|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.  
{{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.
 
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054 when weather diary editor was added to MX
{{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]] 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>
|<#snowlying>
|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, your web page can use a script to check if <#snowdepth> is non zero, as that means snow is lying
{{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
[[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.
| 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
|colspan="3" style="background:lightgray;"|Pressure
Line 2,933: Line 2,943:
!style="width:600px" |Function
!style="width:600px" |Function
|-
|-
!<#DavisTotalPacketsReceived>
|<#DavisTotalPacketsReceived>
|1.9.2 onwards and MX
|1.9.2 onwards and MX
|Total number of data packets received.
|Total number of data packets received.
|-
|-
!<#DavisTotalPacketsMissed>
|<#DavisTotalPacketsMissed>
|1.9.2 onwards and MX
|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.
|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>
|<#DavisMaxInARow>
|1.9.2 onwards and MX
|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.
|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>
|<#DavisNumCRCerrors>
|1.9.2 onwards and MX
|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.
|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>
|<#DavisNumberOfResynchs>
|1.9.2 onwards and MX
|1.9.2 onwards and MX
|Number of times the console resynchronised with the transmitter
|Number of times the console resynchronised with the transmitter
|-
|-
!<#DavisFirmwareVersion>
|<#DavisFirmwareVersion>
|1.9.2 onwards and MX
|1.9.2 onwards and MX
|The console firmware version
|The console firmware version
|-
|-
!<#THWindex>
|<#THWindex>
|1.9.x
|1.9.x
|A derived temperature using Temperature/Humidity/Wind values read from Davis DLL in Cumulus 1.9.x.
|A derived temperature using Temperature/Humidity/Wind values read from Davis DLL in Cumulus 1.9.x.
Line 2,963: Line 2,973:
*Available from 1.9.2 Build 1009 (Aug 2011).
*Available from 1.9.2 Build 1009 (Aug 2011).
|-
|-
!<#THSWindex>
|<#THSWindex>
|(1.9.x and) MX
|(1.9.x and) MX
|A heat stress indicator using Temperature/Humidity/Solar/Wind values.
|A heat stress indicator using Temperature/Humidity/Solar/Wind values.
Line 2,975: Line 2,985:
#Cumulus MX reads "LOOP2" packets, and the correct value for this tag can be read there and displayed on 'Now' template.
#Cumulus MX reads "LOOP2" packets, and the correct value for this tag can be read there and displayed on 'Now' template.
|-
|-
!<#battery>
|<#battery>
|1.x.x and MX
|1.x.x and MX
|The console battery condition in volts. eg "4.82v"
|The console battery condition in volts. eg "4.82v"
|-
|-
!<#txbattery>
|<#txbattery>
<#txbattery channel=1>
<#txbattery channel=1>
|1.8.9 onwards and MX
|1.8.9 onwards and MX
Line 2,985: Line 2,995:
'''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
'''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>
|<#StormRain>
|1.x.x and MX
|1.x.x and MX
|The console 'storm rain' current amount (build 1090 onwards for Cumulus 1; 3021 onwards for MX)
|The console 'storm rain' current amount (build 1090 onwards for Cumulus 1; 3021 onwards for MX)
|-
|-
!<#StormRainStart>
|<#StormRainStart>
|1.x.x and MX
|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.
|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.
Line 3,012: Line 3,022:
|WLL RSSI of Transmitter #1  (replace 1 by any other transmitter number up to 8)
|WLL RSSI of Transmitter #1  (replace 1 by any other transmitter number up to 8)
|}
|}
=== 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===
===Fine Offset===
5,838

edits

Navigation menu