Webtags (preserving history): Difference between revisions

m
→‎Today: split into two table
m (→‎Today: split into two table)
Line 1,542: Line 1,542:
==Today==
==Today==


Many of these web tags are used on the supplied '''todayT.htm''' template, and the supplied '''todayyest.html''' page within the MX admin interface.
Cumulus MX provides more web tags than the original (now legacy) Cumulus software. Please see individual entries for what is available in the flavour you are using. Where known, the actual release that introduces a particular web tag is indicated, but if you are using an old release please [[Webtags#GENERAL_TIP|here]] for how to check which web tags are available.


For web tags that report values that refer to a particular time of day, there is a corresponding web tag that can give the time of day, shown in same row of table below.  
===Weather Diary===
 
Meteorologists report snowfall, and snow days, on a calendar day basis (i.e. midnight to midnight), and Cumulus software enables this by allowing you to declare the '''SnowDepthHour''' time (in [[Cumulus.ini#Section:_Station]], default is 9 a.m. for Cumulus 1, and default is midnight for MX).
 
However, Cumulus software also allows you to choose one of 3 meteorological days:
# starting at 9:00 am, based on winter time, so switching to 10:00 during Daylight Saving (summer) time, or
# starting at 9:00 am, all year round, or
# aligned with calendar days.
 
For options 1, and 2, with the MX default, there is a mismatch between the times for the web tags in the two tables below. The mismatch will also cause problems in you use any End of Day actions, such as using web tags for a custom database table update or for [[Cumulus.ini#MQTT|MQTT messages]].
 
One approach is to use a script to read the [[Weather Diary]], so you know that your output is for the right day.
 
This first table lists all the web tags available for reporting what is recorded in the weather diary. Just to be clear, the web tags shown below, will report data for previous day if the current time is before the snow depth hour setting, and report data for the current day if the current time matches the snow depth hour or is later.
{| class="wikitable" border="1"
|-
!style="width:150px" | Web tag_name
!style="width:650px" | Function
|-
|<#snowdepth>
|Meteorologists report snow depth in cm, so this is default unit for Cumulus.
 
If there is no entry in Weather Diary for the day explained above, reports zero.
 
{{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.
|-
|<#snowlying>
|{{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
 
[[File:Badge vMx.png]] Available from version 3.1.1 - build 3054.  If there is no entry in Weather Diary for the day explained above, , this web tag returns Null. Otherwise reports 1 if tick in diary, 0 is unticked.
|-
|<#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 no entry in Weather Diary for the day explained above, , this web tag returns Null. Otherwise reports 1 if tick in diary, 0 is unticked.
|}
 
===Today.ini===
 
This second table takes most of its information from the data log for today, many of these web tags are used on the supplied '''todayT.htm''' template in the "/web" folder.  If you are using MX, the today and yesterday page in the [[MX_Administrative_Interface]] shows similar information by using the [[Cumulus_MX_Local_API#Today.2FYesterday_Data|local application programming interface]].
 
For web tags that report values that refer to a particular time of day, there is a corresponding web tag that can give the time of day, shown in same row of table below. For those that cover whole day so far, the final column contains "n/a".


Please note none of the time web tags can be modified by output parameters to give a date, but they can be changed from the default time format that is 'H:mm' (24 hour clock notation without leading zero for hour) for Cumulus 1 and MX. If you are using output modifiers to change how the time is reported, be careful to use ones that work for the flavour of Cumulus you are using (H and h are same for Cumulus 1, but not for MX; nn and mm are same for Cumulus 1, but not for MX).
Please note none of the time web tags can be modified by output parameters to give a date, but they can be changed from the default time format that is 'H:mm' (24 hour clock notation without leading zero for hour) for Cumulus 1 and MX. If you are using output modifiers to change how the time is reported, be careful to use ones that work for the flavour of Cumulus you are using (H and h are same for Cumulus 1, but not for MX; nn and mm are same for Cumulus 1, but not for MX).
Line 1,564: Line 1,607:
|-
|-
|<#avgtemp>
|<#avgtemp>
|The [[Average_temperature|average]] temperature so far today (calculated from all temperature readings processed by Cumulus)
|The [[Average_temperature|average]] temperature so far today (calculated from all temperature readings processed by Cumulus, [[Today.ini|today.ini]] stores a cumulative aggregate and counts the number of values processed, so a division gives this output)
|n/a
|n/a
|-
|-
Line 1,637: Line 1,680:
|<#RG11RainToday>
|<#RG11RainToday>
|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
|-
|<#snowdepth>
|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}} 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>
|{{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
[[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
| n/a
|-
|-
5,838

edits