Webtags (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
→‎Yearly: match what done in month tags
m (→‎Yearly: match what done in month tags)
(27 intermediate revisions by 3 users not shown)
Line 16: Line 16:


=== Using web tags in scripts ===
=== Using web tags in scripts ===
[[File:badge v1.png]]The web page references appearing below apply to Cumulus 1, not Cumulus MX.
*You can also use the tags within script, this might be a PHP script, or JavaScript either embedded in HTML, or in external files, to transfer the values represented by the tags to the server for further processing.
*You can also use the tags within script, this might be a PHP script, or JavaScript either embedded in HTML, or in external files, to transfer the values represented by the tags to the server for further processing.
*As JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, but your computer may be set to use that representation in standard tags, there are special versions of many tags to use in script - see [[#No_Commas|tags with commas removed]] section.
*As JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, but your computer may be set to use that representation in standard tags, there are special versions of many tags to use in script - see [[#No_Commas|tags with commas removed]] section.
Line 26: Line 27:


=== Differences for Webtags in MX builds ===
=== Differences for Webtags in MX builds ===
[[File:Badge vMx.png]] The web tags listed below are those available in the latest official (finalised version) release of Cumulus 1.9.x. However, Cumulus MX provides equivalent tags, with only minor differences.


The web tags listed below are those available in the latest official (finalised version) release of Cumulus 1.9.x. However, Cumulus MX provides equivalent tags, with only minor differences.
One difference is that Alarm tags are not yet in use.


=== Beta Builds of Cumulus ===
=== Beta Builds of Cumulus ===
Line 63: Line 65:
*#Whilst ''<#metdate format="d M">'' is not a single character format modifier and therefore both the 'd' and the 'M' are interpreted as custom modifiers and cause the current date to be returned as a digit(s) for the day and a digit(s) month (in a without leading zeroes format) e.g. '6 7' would be returned for 6 July.
*#Whilst ''<#metdate format="d M">'' is not a single character format modifier and therefore both the 'd' and the 'M' are interpreted as custom modifiers and cause the current date to be returned as a digit(s) for the day and a digit(s) month (in a without leading zeroes format) e.g. '6 7' would be returned for 6 July.
*The other change with the "format" parameter is the different way that .Net escapes characters that are not being used as format specifiers. In Delphi you can put the 'verbatim' characters inside single quotes (Cumulus 1); in .Net you can still use single quotes, but alternatively you can escape each verbatim character with a backslash as prefix (Cumulus MX).  
*The other change with the "format" parameter is the different way that .Net escapes characters that are not being used as format specifiers. In Delphi you can put the 'verbatim' characters inside single quotes (Cumulus 1); in .Net you can still use single quotes, but alternatively you can escape each verbatim character with a backslash as prefix (Cumulus MX).  
For official full details see [http://sandaysoft.com/forum/viewtopic.php?f=27&t=12908 Cumulus MX forum], the following table is revised for simplicity. (I've abridged the table here so I do not need to say any more about standard characters and custom modifiers just for looking at date / time format).
For official full details see [https://cumulus.hosiene.co.uk/viewtopic.php?f=27&t=12908 Cumulus MX forum], the following table is revised for simplicity. (I've abridged the table here and included '%' where necessary to avoid single character versus custom complications).


== List of allowed modifiers ==
== List of allowed modifiers ==
Note for Cumulus 1 - where lower case shown, because Delphi is case insensitive, upper case could be used instead (exceptions: a/p, ampm, am/pm, Am/Pm, AM/PM, A/P, AMPM etc display as input)
Note for Cumulus 1 - where lower (or upper, for easier comparison with MX) case shown, because Delphi is case insensitive, upper (or lower) case (in some cases, indicated by use of italics in brackets) could be used instead (exceptions: a/p, ampm, am/pm, Am/Pm, AM/PM, A/P, AMPM etc display as input)
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 107: Line 109:
*Cumulus MX: Note that including a ' ' (space) or '%' before the M makes it a custom modifier e.g. '7' is returned for July as any initial zero is suppressed. ('M' on its own returns both Month and Day according to local format e.g. 22 July).
*Cumulus MX: Note that including a ' ' (space) or '%' before the M makes it a custom modifier e.g. '7' is returned for July as any initial zero is suppressed. ('M' on its own returns both Month and Day according to local format e.g. 22 July).
|-
|-
|mm
|MM (or ''mm'')
|MM
|MM
|Displays the month as a number with a leading zero (01-12).  
|Displays the month as a number with a leading zero (01-12).  
*Cumulus 1.x.y:If the 'm' specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
*Cumulus 1.x.y:If the 'm' specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
|-
|-
|mmm
|MMM (or ''mmm'')
|MMM
|MMM
|Displays the month as an abbreviation (Jan-Dec) using the strings appropriate to the Locale.
|Displays the month as an abbreviation (Jan-Dec) using the strings appropriate to the Locale.
|-
|-
|mmmm
|MMMM (or ''mmmm'')
|MMMM
|MMMM
|Displays the month as a full name (January-December) using the strings appropriate to the Locale.
|Displays the month as a full name (January-December) using the strings appropriate to the Locale.
Line 128: Line 130:
|Displays the year as a four-digit number (0000-9999).
|Displays the year as a four-digit number (0000-9999).
|-
|-
|(only available in combination with am/pm)
|('''h''' in combination with ''am/pm'')
|h
|h
|Displays the hour (12 hour clock) without a leading zero (1-12).
|Displays the hour (12 hour clock) without a leading zero (1-12).
Line 136: Line 138:
|Displays the hour using 24 hour clock without a leading zero (0-23).
|Displays the hour using 24 hour clock without a leading zero (0-23).
|-
|-
|(only available in combination with am/pm)
|('''hh''' in combination with ''am/pm'')
|hh
|hh
|Displays the hour (12 hour clock) with a leading zero (01-12).
|Displays the hour (12 hour clock) with a leading zero (01-12).
|-
|-
|hh
|HH (or ''hh'')
|HH
|HH
|Displays the hour using 24 hour clock with a leading zero (00-23).
|Displays the hour using 24 hour clock with a leading zero (00-23).
Line 182: Line 184:
|am/pm
|am/pm
|tt
|tt
|Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon.
|Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour from midnight until 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.
The am/pm specifier for Cumulus 1 can use lower, upper, or mixed case, and the result is displayed accordingly.
Line 188: Line 190:
|a/p
|a/p
|t
|t
|Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
|Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
|-
|-
|ampm
|ampm
|(see above for 12 hour formats)
|(see above for 12 hour formats)
|Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the Windows AM string for any hour before noon, and the contents of the Windows PM string for any hour after noon.
|Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the Windows AM string for midnight until any hour before noon, and the contents of the Windows PM string for noon or any hour after noon before midnight.
|-
|-
|/
|/
Line 311: Line 313:
|<#DaysSince30Dec1899>  
|<#DaysSince30Dec1899>  
|Day count (gives whole and fractional part) Example: 41250.6523310301
|Day count (gives whole and fractional part) Example: 41250.6523310301
|-
|<#recordsbegandate>
|Date when records began (appears twice on "recordsT.htm" provided, and used to calculate next tag, but ignored for all other Cumulus processing)
|-
|-
|<#DaysSinceRecordsBegan>
|<#DaysSinceRecordsBegan>
Line 368: Line 373:
|-
|-
|<#IsFreezing>
|<#IsFreezing>
|Is outside temperature is at or below 0°C/32°F. 0=Above freezing, 1=Below freezing
|If outside temperature is at or below 0°C/32°F. 0=Above freezing, 1=Below freezing
|-
|-
|colspan="2" style="background:lightgray;"|Rainfall
|colspan="2" style="background:lightgray;"|Rainfall
Line 865: Line 870:
|-
|-
|<#MonthHumH>
|<#MonthHumH>
|This months highest humidty
|This months highest humidity
|<#MonthHumHT>
|<#MonthHumHT>
|<#MonthHumHD>
|<#MonthHumHD>
|-
|-
|<#MonthHumL>
|<#MonthHumL>
|This months lowest humidty
|This months lowest humidity
|<#MonthHumLT>
|<#MonthHumLT>
|<#MonthHumLD>
|<#MonthHumLD>
Line 1,001: Line 1,006:
|<#YearMinTempH>
|<#YearMinTempH>
|This years highest daily minimum temperature
|This years highest daily minimum temperature
|n/a
|<#YearMinTempHD format=HH:MM>
|<#YearMinTempHD>
|<#YearMinTempHD>
|-
|-
|<#YearMaxTempL>
|<#YearMaxTempL>
|This years lowest daily maximum temperature
|This years lowest daily maximum temperature
|n/a
|<#YearMaxTempHD format=HH:MM>
|<#YearMaxTempLD>
|<#YearMaxTempLD>
|-
|-
|<#YearHumH>
|<#YearHumH>
|This years high humidty
|This years high humidity
|<#YearHumHT>
|<#YearHumHT>
|<#YearHumHD>
|<#YearHumHD>
|-
|-
|<#YearHumL>
|<#YearHumL>
|This years low humidty
|This years low humidity
|<#YearHumLT>
|<#YearHumLT>
|<#YearHumLD>
|<#YearHumLD>
Line 1,205: Line 1,210:
==Recent History==
==Recent History==


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. [[#No_Commas]] versions of the array are available for use in script.
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. (Note that Cumulus uses current time read from the computer to determine which array element used. 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). 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. [[#No_Commas]] versions of the array are available for use in script.


You specify which value you want from the array by using parameters on the web tags for number of days ago, hours ago, and minutes ago. For example, <#RecentOutsideTemp m=1> will give the temperature one minute ago, <#RecentOutsideTemp h=1> will give the temperature one hour ago (as will <#RecentOutsideTemp m=60>), and <#RecentOutsideTemp d=1> will give the temperature one day ago. <#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago. All values supplied for parameters must be whole numbers. If you don't supply any parameters, the result is undefined.  
You specify which value you want from the array by using parameters on the web tags for number of days ago, hours ago, and minutes ago. For example, <#RecentOutsideTemp m=1> will give the temperature one minute ago, <#RecentOutsideTemp h=1> will give the temperature one hour ago (as will <#RecentOutsideTemp m=60>), and <#RecentOutsideTemp d=1> will give the temperature one day ago. <#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago. All values supplied for parameters must be whole numbers. If you don't supply any parameters, the result is undefined. (Again note that parameters specify time-stamped array element to retrieve based on counting back from current local time so the result for any period when clocks change may not be quite what you anticipated).


Although 'Apparent Temperature' is not included as a tag, it can be [[FAQ#What_formula_does_Cumulus_use_for_Apparent_Temperature.3F | calculated]] in a script from recent 'outside temperature', 'wind speed', and 'relative humidity' values (using the same time selection for all).
Although 'Apparent Temperature' is not included as a tag, it can be [[FAQ#What_formula_does_Cumulus_use_for_Apparent_Temperature.3F | calculated]] in a script from recent 'outside temperature', 'wind speed', and 'relative humidity' values (using the same time selection for all).
Line 1,394: Line 1,399:
|-
|-
|<#LatestError>
|<#LatestError>
|Displays the last error from the Cumulus error log. The value is cleared when you click the error light in Cumulus.<br />
|Displays the last error from the Cumulus error log. (The value is cleared when you click the error light in Cumulus 1).<br />
Note: This tag displays ''all'' errors, even if they do not cause the error light to flash in Cumulus.
Note: This tag displays ''all'' errors, even if they do not cause the error light to flash in Cumulus 1.
|-
|-
|<#LatestErrorDate>
|<#LatestErrorDate>
Line 1,407: Line 1,412:
|-
|-
|<#version>
|<#version>
|The version of Cumulus in use
|The version of Cumulus in use e.g. '1.9.4'
|-
|-
|<#build>
|<#build>
|The build of Cumulus in use
|The build of Cumulus in use e.g. '10991'
|-
|-
|<#realtimeinterval>
|<#realtimeinterval>
|The realtime update interval in seconds  
|The realtime update interval in seconds (integer)
|-
|-
|<#interval>
|<#interval>
|The web site update interval in minutes
|The web site update interval in minutes (integer)
|-
|-
|<#rollovertime>
|<#rollovertime>
Line 1,428: Line 1,433:
|-
|-
|<#stationtype>
|<#stationtype>
|The weather station [http://wiki.sandaysoft.com/a/Cumulus.ini#Section:_Station model] description (you choose what text appears for this on 'Display' settings screen within Configuration menu - the field is at the bottom left of that screen).
|The weather station [https://cumuluswiki.wxforum.net/a/Cumulus.ini#Section:_Station model] description (you choose what text appears for this on 'Display' settings screen within Configuration menu - the field is at the bottom left of that screen).
|-
|-
|<#latitude>
|<#latitude>
|The station [http://en.wikipedia.org/wiki/Latitude latitude].
|The station [http://en.wikipedia.org/wiki/Latitude latitude] (as you entered during setup).
Supports an optional 'dp' parameter, if supplied, instead of the usual web-encoded text format with degrees/minutes/seconds, the result is in decimal degrees to the specified number of decimal places. E.g<br />
Supports an optional 'dp' parameter, if supplied, instead of the usual web-encoded text format with degrees/minutes/seconds, the result is in decimal degrees to the specified number of decimal places. E.g<br />
<#latitude> gives "N&amp;nbsp;59& deg;&amp;nbsp;14&amp;#39;&amp;nbsp;33&amp;quot;" for N 59 14 33<br />
<#latitude> gives "N&nbsp;59& deg;&amp;nbsp;14&amp;#39;&amp;nbsp;33&amp;quot;" for N 59 14 33<br />
<#latitude dp=5> gives "59.24250"
<#latitude dp=5> gives "59.24250"


Line 1,439: Line 1,444:
|-
|-
|<#longitude>
|<#longitude>
|The station [http://en.wikipedia.org/wiki/Longitude longitude]. Supports an optional 'dp' and 'rc' parameters as per the latitude tag.
|The station [http://en.wikipedia.org/wiki/Longitude longitude] (as you entered during setup). Supports an optional 'dp' and 'rc' parameters as per the latitude tag.
|-
|-
|<#altitude>
|<#altitude>
|The station [http://en.wikipedia.org/wiki/Altitude altitude]
|The station [http://en.wikipedia.org/wiki/Altitude altitude] value (webtag outputs web encoded format containing figure, '&amp;nbsp;' and units) in either feet or metres just as you entered during setup (so it is more complex to extract number for script arithmetric); e.g. '123&amp;nbsp;m'
|-
|-
|<#location>
|<#location>
|The station location
|The station location (as you entered during setup)
|-
|-
|<#longlocation>
|<#longlocation>
|Longer description of the station location
|Longer description of the station location (as you entered during setup)
|-
|-
|<#forum>
|<#forum>
Line 1,463: Line 1,468:
|-
|-
|<#snowdepth>
|<#snowdepth>
|Today's snow depth as entered manually in the Weather Diary. Normally in Centimeters.Output is purely as a numerical figure I.E 10
|Today's snow depth as entered manually in the Weather Diary (not available in Cumulus MX), see Cumulus 'Help'. Meteorologists express it in Centimeters, but Cumulus 1 does not care what units you use. Output is purely as a numerical integer (e.g. 10).
Configure in [[Cumulus.ini]] the hour when the snowdepth is updated e.g. ''SnowDepthHour=9'' means yesterday's figure applies until 9am.
Configure in [[Cumulus.ini]] the hour when the snowdepth is updated e.g. ''SnowDepthHour=9'' means yesterday's figure applies until 9am.
|-
|-
Line 1,470: Line 1,475:
|-
|-
|<#currcondenc>
|<#currcondenc>
|The same as <#currcond> but also has characters above code 159 encoded as HTML entities
|The same as <#currcond> but also has all characters above (decimal base)code 159 encoded as HTML entities
|-
|-
|<#chillhours>
|<#chillhours>
|The number of 'chill hours' so far this season.
|The number of [[Heat/cold_degree_days_and_Chill_hours#Chill_Hours_and.2For_Air_Frost|'chill hours']] so far this season (threshold temperature and start date are configurable).
|-
|-
|<#ConsecutiveRainDays>
|<#ConsecutiveRainDays>
|The number of days up to (but not including) today where it has rained every day. The threshold amount of rain required to determine a rain day is configurable via the RainDayThreshold setting in cumulus.ini, the units for the threshold are the same as your rain units
|The number of days up to (but not including) today where it has rained every day. The threshold amount of rain required to determine a rain day is configurable via the RainDayThreshold setting in cumulus.ini, the units for the threshold are the same as your rain units, meteorologists exclude dew (and other times when single tip of recorder).
|-
|-
|<#ConsecutiveDryDays>
|<#ConsecutiveDryDays>
Line 1,542: Line 1,547:
|-
|-
|<#MoonAge>
|<#MoonAge>
|Current '''approximate''' age of the Moon in days (0-29)
|Current '''approximate''' age of the Moon in days (0-29.53)
 
MX b3047 adds the 'dp' and 'rc' parameters Supports an optional 'dp' parameter, if supplied the result is returned to the specified number of decimal places. E.g <#MoonAge> gives "11" <#MoonAge dp=3> gives "11.234"
If the "dp" parameter is supplied, then also supplying "rc=y" in addition will cause any decimal comma to be converted to a decimal point.
|-
|-
|<#moonrise>
|<#moonrise>
Line 1,552: Line 1,560:
|<#MoonPercent>
|<#MoonPercent>
|Current percentage of moon visible (negative value indicates 'waning')
|Current percentage of moon visible (negative value indicates 'waning')
MX b3047 adds the 'dp' and 'rc' parameters as <#MoonAge> above
|-
|-
|<#MoonPercentAbs>
|<#MoonPercentAbs>
|Current percentage of moon visible (always positive)
|Current percentage of moon visible (always positive)
MX b3047 adds the 'dp' and 'rc' parameters as <#MoonAge> above
|-
|-
|<#SunshineHours>
|<#SunshineHours>
Line 1,571: Line 1,583:
==Alarms==
==Alarms==


There are a set of tags for the Cumulus alarm states. They give a value of '1' if an alarm parameter has been selected (Main Cumulus screen, Edit menu) and the alarm condition is still currently met; otherwise '0'.
[[File:badge v1.png]]There are a set of tags available in Cumulus 1 for various alarm states.  
 
They give a value of '1' if an alarm parameter has been selected (Main Cumulus screen, Edit menu) and the alarm condition is still currently met; otherwise '0'.
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,619: Line 1,633:
==Records==
==Records==


There are a set of tags for the Cumulus record states. They give a value of '1' if the record has been exceeded; otherwise '0'.
There are a set of tags for the Cumulus record states. They give a value of '1' if the record has been exceeded; otherwise '0'. For daily records (e.g. temperature range), the record cannot be set until the end of the day when rollover starts. The tag is cleared in Cumulus 1 once the record has been viewed (via main screen or web tag).


'''Please remember these are for Cumulus 1.9.x, Cumulus MX only supports the first two.'''
'''Please remember these are for Cumulus 1.9.x, Cumulus MX works in a different way both in terms of how tags are set (see various topics in support forum) and how they are cleared (essentially the end of rollover clears records, so daily records are only shown for the few microseconds while rollover is being processed).'''
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,633: Line 1,647:
|Indicates when any tracked extreme is changed.
|Indicates when any tracked extreme is changed.
*In Cumulus 1.x.x: 1 if 'new record' light is flashing, 0 if not
*In Cumulus 1.x.x: 1 if 'new record' light is flashing, 0 if not
*In Cumulus MX: 1 for 24 hours from when new record set, 0 otherwise
*In Cumulus MX: 1 from when new record is set until next rollover is completed, 0 otherwise
|-
|-
|<#TempRecordSet>
|<#TempRecordSet>
Line 1,774: Line 1,788:
|Soil temperature 2
|Soil temperature 2
|-
|-
|colspan="2"|... and so on up to <#SoilTemp4>
|colspan="2"|... and so on up to <#SoilTemp16>
|-
|-
|<#SoilMoisture1>
|<#SoilMoisture1>
Line 1,782: Line 1,796:
|Soil moisture 2
|Soil moisture 2
|-
|-
|colspan="2"|... and so on up to <#SoilMoisture4>
|colspan="2"|... and so on up to <#SoilMoisture16>
|-
|-
|<#LeafTemp1>
|<#LeafTemp1>
Line 1,795: Line 1,809:
|<#LeafWetness2>
|<#LeafWetness2>
|Leaf wetness 2  
|Leaf wetness 2  
|-
|<#AirQuality1>
|Air quality (currently only GW1000 stations)
|-
|colspan="2"|... and so on up to <#AirQuality4>
|-
|<#LeakSensor1>
|Leak sensor - 0 or 1 (currently only GW1000 stations)
|-
|colspan="2"|... and so on up to <#LeakSensor4>
|-
|<#LightningDistance>
|Distance to last strike (same units as wind run - miles/km/nm)
(currently only GW1000 stations)
|-
|<#LightningTime>
|Time of last strike (format customisable)
(currently only GW1000 stations)
|-
|<#LightningStrikesToday>
|Number of strikes since midnight
(currently only GW1000 stations)
|}
|}


Line 1,898: Line 1,934:
|1 if the station has lost contact with its remote sensors "Fine Offset only"  
|1 if the station has lost contact with its remote sensors "Fine Offset only"  
0 if contact has been established
0 if contact has been established
|}
===Ecowitt GW1000===
There are a set of tags for the Ecowitt WiFi gateway GW1000:
{| class="wikitable" border="1"
|-
!style="width:150px" |webtag
!style="width:600px" |Function
|-
|<#GW1000FirmwareVersion>
|GW1000 firmware version string
|}
|}


5,838

edits

Navigation menu