Webtags/Parameters: Difference between revisions

451 bytes removed ,  09:33, 2 October 2022
m
Line 38: Line 38:
=== Input modification Parameters ===
=== Input modification Parameters ===


'''Most web tags do not require any input parameters'''. Luckily, where they are needed, it is quite simple to use them, see table below.
The following Webtags (can) use input modification parameters:
#Tag names listed in the table at [[Full_list_of_Webtags#Recent_History|Recent History]]  (see also [[Recent history]] page)
#*Produces one value for each minute in last 7 days
#* '''d''' : specifies number of days ago
#* '''h''' : specifies number of hours ago
#* '''m''' : specifies number of minutes ago
#* You can use any combination of the three parameters
#* All values supplied for parameters must be whole numbers
#* If you don't supply any parameters, the result is an illegal web tag for CumulusMX
#Tag names listed in the table at [[Full_list_of_Webtags#Monthly_All_Time_Records|monthly all-time extreme records]]
#* Produces the extreme record values (and corresponding time-stamps) for any particular month in all years
#* Optional input parameter is '''mon=N''' where N is the index of the month (1 is January, and so on, to 12 is December)
#* If you don't supply an input parameter (or supply an invalid value like zero) the current month will be used
#* You can use both an input parameter and an output parameter for any tag name, separate these with a space
#* '''NOTE''': If you use <code><#RecentRainToday d=2></code> remember that rainfall accumulates during a day, so "d=2" returns an estimate of the rain between rollover 2 days ago and the same time as now 48 hours ago, it does not return the total rainfall 2 days ago!
# The Webtags [[Full_list_of_Webtags#Monthly|Only <#SunshineHoursMonth>]] and [[Full_list_of_Webtags#Yearly|Only <#SunshineHoursYear>]]
#* Produces values available for current month/year, and for a past month/year.
#* Omit input modification parameter to get value for current month/year. Alternatively include one of the following options:
#*# '''r=-ww''' (note minus sign and up to 2 digits) representing that number of months/years ago
#*# Monthly tags also take: '''m=N y=nnnn''' ('''N''' can be 1 to 12, ''nnnn'' is 4 digit year), these parameters specify exact month required
#*# Yearly tags also take: '''y=nnnn''', this parameter specifies exact year required


{| class="wikitable" border="1"
=== Examples for Recent History ===
|-
EXAMPLE FOR RECENT HISTORY
!style="width:15px" | Tag names
# <#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>)
!style="width:100px" | Values Available
# <#RecentOutsideTemp d=1> will give the temperature one day ago.
!style="width:200px" | Input Modification Parameters
# <#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago.
!style="width:60px" | Introduced
!style="width:500px" | Examples
!style="width:900px" | Description
|-
! scope="row"| Tag names listed at [[Webtags#Table of Recent History tag names available|'''Table of Recent History tag names available''']] (see [[Recent history]] page for explanation)
| One value for each minute in last 7 days
|
* '''d''' specifies number of days ago,
* '''h''' specifies number of hours ago,
* and '''m''' specifies number of minutes ago.
* You can use any combination of the three parameters.
* The same d, h, and m, parameters are used by Cumulus 1 and MX.
| Cumulus 1.9.3 beta build 1033 (remain available in MX)
| Examples for outside temperature:
* <#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>).
* <#RecentOutsideTemp d=1> will give the temperature one day ago.
* ''''''Please note:''' Some Cumulus users say that using <#RecentOutsideTemp  d=1 m=1> is more reliable at getting the temperature (or whatever tag name you have quoted) at a similar time the day before, the extra minute apparently gives better results when you might not be using Cumulus all the time, or your weather station might have some drift on when it supplies readings. See which works best for you.
* <#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 for Cumulus 1, and an illegal web tag for MX''.
* '''Beware: If you use <code><#RecentRainToday d=2></code> remember that rainfall can accumulate during a day, so "d=2" returns an estimate of the rain between rollover 2 days ago and the same time as now 48 hours ago, it does not return the total rainfall 2 days ago!
|-
! scope="row"| [[Webtags#Monthly_All_Time_Records|'''monthly all-time extreme records''']] tag names
| These tag names represent extreme record values (and corresponding time-stamps) for any particular month (1 =January, and so on, to 12 =December) in all years
| Optional input parameter is '''mon=N''' where N is the index of the month in which the extreme record occurs considering all years 
| Cumulus 1.9.3 beta build 1033 (remain available in MX)
| * <#ByMonthDewPointH mon=3> is highest monthly dew point for month of March considering all years, and <#ByMonthDewPointHT mon=3> is the related time and date.
* <#ByMonthTempH mon=3> gives highest temperature in any March, <#ByMonthTempHT mon=3> gives the date and time for that highest temperature
| * If you don't supply an input parameter (or supply an invalid value like zero) the current month will be used.
* The value of "N" supplied should be an integer between 1 and 12
* You can use both an input parameter and an output parameter for any tag name, separate these with a space


'''NOTE:''' Use without an input parameter in "MySQLConnect", "MQTT", or a template file, and then you don't need to rewrite the instruction when current month changes. If processed at rollover, the current month will change on first day of a month, and so not relate to month that has just finished.
'''NOTE:''' Some Cumulus users say that using <#RecentOutsideTemp  d=1 m=1> is more reliable at getting the temperature (or whatever tag name you have quoted) at a similar time the day before, the extra minute apparently gives better results when you might not be using Cumulus all the time, or your weather station might have some drift on when it supplies readings. See which works best for you.  
|-
'' REMARK HansR for review:'' This seems a strange explanation to me. It seems more having something to do with updating the Recent History database while being queried as the processes in CMX most likely are independent.
! scope="row"| [[Webtags#Monthly|Only <#SunshineHoursMonth>]] and [[webtags#Yearly|Only <#SunshineHoursYear>]]
| Values available for current month/year, and for past month/year
| Omit input modification parameter to get value for current month/year. Alternatively include one of the following options:
* '''r=-ww''' (note minus sign and up to 2 digits) representing that number of months/years ago
* Monthly tags also take: '''m=N y=nnnn''' ('''N''' can be 1 to 12, ''nnnn'' is 4 digit year), these parameters specify exact month required
* Yearly tags also take: '''y=nnnn''', this parameter specifies exact year required
| MX release 3.12.0
| Monthly examples:
* <#SunshineHoursMonth> gives total sunshine hours since 1 minute past midnight at start of current month
* <#SunshineHoursMonth y=2021 m=1> for the January 2021 total
* <#SunshineHoursMonth r=-1> for last month's total
* <#SunshineHoursMonth r=-12> for same month as current month, but one year ago
Yearly examples:
* <#SunshineHoursYear> gives total sunshine hours since 1 minute past midnight on New Year's Day
* <#SunshineHoursYear y=2019> for the total for 2019
* <#SunshineHoursYear r=-2> total for the year before last (if current year is 2021, that returns total for 2019 as previous example)
| Returns the sunshine hours total in selected period


(You need a sensor to be monitoring this throughout selected period)
=== Examples for Monthly Records ===
|}
#<#ByMonthDewPointH mon=3> is highest monthly dew point for month of March considering all years, and <#ByMonthDewPointHT mon=3> is the related time and date.
#<#ByMonthTempH mon=3> gives highest temperature in any March, <#ByMonthTempHT mon=3> gives the date and time for that highest temperature
 
'''NOTE:''' Use without an input parameter in "MySQLConnect", "MQTT", or a template file, and then you don't need to rewrite the instruction when current month changes.
'''NOTE:''' If processed at rollover, the current month will change on first day of a month, and so not relate to month that has just finished.
 
=== Examples Solar ===
#Monthly examples
#* <#SunshineHoursMonth> gives total sunshine hours since 1 minute past midnight at start of current month
#* <#SunshineHoursMonth y=2021 m=1> for the January 2021 total
#* <#SunshineHoursMonth r=-1> for last month's total
#* <#SunshineHoursMonth r=-12> for same month as current month, but one year ago
==== Yearly examples ====
#* <#SunshineHoursYear> gives total sunshine hours since 1 minute past midnight on New Year's Day
#* <#SunshineHoursYear y=2019> for the total for 2019
#* <#SunshineHoursYear r=-2> total for the year before last (if current year is 2021, that returns total for 2019 as previous example)
 
(And of course you need a solar sensor for this)


=== Output modification parameters availability by tag name ===
=== Output modification parameters availability by tag name ===