Webtags: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
216 bytes added ,  15:51, 4 October 2022
m
(5 intermediate revisions by the same user not shown)
Line 10: Line 10:


= Introduction =
= Introduction =
Data gathered by CMX is stored locally in the database (see e.g. [[Dayfile.txt|dayfile]] and [[Standard_log_files|standard logfiles]] and a range of ini files, Extra Sensor files, Airlink logfiles etc...). To make these data - and calculated derivatives - available to the user ''CumulusMX'' (''CMX'') uses a system of Webtags. In short, a ''Webtag'' is a symbolic name which is translated into a value when asked by ''CMX''. So e.g.:
Data gathered by CMX is stored locally in the database (see e.g. [[Dayfile.txt|dayfile]] and [[Standard_log_files|standard logfiles]] and a range of ini files, Extra Sensor files, Airlink logfiles etc...). To make these data - and calculated derivatives - available to the user ''CumulusMX'' (''CMX'') uses a system of Webtags. In short, a ''Webtag'' is a symbolic name which is translated into a value when asked to ''CMX''. So e.g.:


   temp  -> (process) -> 17.1
   temp  -> (process) -> 17.1
Line 19: Line 19:


= List of all tags =
= List of all tags =
This chapter is about the full list of Webtags. The names of the webtags are basically functional i.e. you can guess what the value says. The order of the tags in ''the local list'' is unknown, most likely it is a mix of time of origin, functionality and alphabetical ordering. The order of the tags in the full list is functional i.e. they are grouped by an arbitrary functional partition. Within such group no effort has been made to order according to another ordinal.  
This chapter is about the [[Full list of Webtags]]. The names of the webtags are basically functional i.e. you can guess what the value says. The order of the tags in ''the local list'' is unknown, most likely it is a mix of time of origin, functionality and alphabetical ordering. The order of the tags in the full list is functional i.e. they are grouped by an arbitrary functional partition. Within such group no effort has been made to order according to another ordinal.  


The naming of the webtags can sometimes be confusing
The naming of the webtags can sometimes be confusing
Line 29: Line 29:
The naming of the tags can sometime be confusing. The long history of development of Cumulus(MX) has left its traces and although technically corrections can be made, the effort to do that is such that I won't bet on it happening. So a short guide to what can be expected follows here.
The naming of the tags can sometime be confusing. The long history of development of Cumulus(MX) has left its traces and although technically corrections can be made, the effort to do that is such that I won't bet on it happening. So a short guide to what can be expected follows here.


For a shor history of inconsistency you may read [[Webtags_(preserving_history)#General_Format_for_Web_Tags|here]].
For a short history of inconsistency you may read [[Webtags_(preserving_history)#General_Format_for_Web_Tags|here]].


#Inconsistency in use of "Y": The character "Y" has been selected to denote yesterday in tag names. The inconsistency is where it appears. e.g. rfallY, YSunshineHours, Ybeaufort, windAvgY
#Inconsistency in use of "Y": The character "Y" has been selected to denote yesterday in tag names. The inconsistency is where it appears. e.g. rfallY, YSunshineHours, Ybeaufort, windAvgY
Line 35: Line 35:
#Inconsistency in use of "T": Where the "T" is added as indicating the time of the event (High or Low) e.g. leading to T<tag name>TH, this method is not consistently followed and may lead to some confusion. E.g. tempTH (the value for the temperature at its maximum) and TtempTH (for the time of that corresponding value). But also YearDewPointH (years highest dewpoint) and YearDewPointHT for the time of the event i.s.o. TYearDewPointH (which does not exist but which might have been more consistent).
#Inconsistency in use of "T": Where the "T" is added as indicating the time of the event (High or Low) e.g. leading to T<tag name>TH, this method is not consistently followed and may lead to some confusion. E.g. tempTH (the value for the temperature at its maximum) and TtempTH (for the time of that corresponding value). But also YearDewPointH (years highest dewpoint) and YearDewPointHT for the time of the event i.s.o. TYearDewPointH (which does not exist but which might have been more consistent).


Whatever you find and use, make sure you understand what you are looking at (you may need tests to verify). If the lists below are not correct, again you are invited to share or correct your discoveries.
Whatever you find and use, make sure you understand what you are looking at (you may need tests to verify). If the lists below are not correct, please share your finds on the forum. If bugs exist, please put them also forward in the forum: either the software or the wiki needs to be adapted.


== The local List ==
== The local List ==
From version 3.12.0 the complete list of Webtags can be generated from your running CumulusMX instance.
From version 3.12.0 the complete list of Webtags can be generated from your running CumulusMX instance.


Goto the interface. In the menu go to ''Program settings=>General options'', tick ''List web tags''. The next time that MX is restarted,  it will create a file called WebTags.txt in the same folder as where the executable is found. Unticking that parameter will have the inverse effect.
Goto the interface. In the menu go to ''Program settings=>General options'', tick ''List web tags''. The next time that MX is restarted,  it will create a file called ''WebTags.txt'' in the same folder as where the executable is found. Unticking that parameter will have the inverse effect and the file will no longer be renewed at restart (though the file is not removed).


The ''WebTags.txt'' file will list all the tags your build of Cumulus can currently handle. This list only contains the bare tag names. Parameters and modifiers will need to be looked up and added to make use of these. This list can be of use if you are using the tags to create your own program or website while interfacing with CumulusMX. It is useful to save it now and then with the CMX version nr in its name. This will make it possible to find the new tags easily through making a difference.
The ''WebTags.txt'' file will list all the tags your build of Cumulus can currently handle. This list only contains the bare tag names. Parameters and modifiers will need to be looked up and added to make use of these. This list can be of use if you are using the tags to create your own program or website while interfacing with CumulusMX. It is useful to save it now and then with the CMX version nr in its name. This will make it possible to find the new tags easily through making a difference.


== The full List ==
== The full List ==
The full list of Webtags carries a lot of additional information so it has its own [[Full list of Webtags|Webtag page]]. It is grouped by functionality without additional ordering. Some description is given where available.
The full list of Webtags has its own [[Full list of Webtags|Webtag page]]. It is grouped by functionality without additional ordering. Some description is given where available.


= Using Webtags =  
= Using Webtags =  
There are the following methods to ask CMX to do this translation both of which will be discussed below (or in a sub-page). The two methods are:
There are the following methods to ask CMX to do this translation all of which will be discussed below (or in a sub-page). The methods are:
#Processing files through the running instance of CumulusMX
#Processing files through the running instance of CumulusMX
#Getting the value by using the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_GET|GET method]].  
#Getting the value by using the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_GET|GET method]].  
#Getting the values through the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_POST|POST method]]
#Getting the values through the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_POST|POST method]]


The first method is used in files used as input for the Extra Web Files in CMX which are then processed by CMX if you tick ''process'' The output file then contains the value.<br/>
The first method is used in files used as input for the Extra Web Files in CMX which are then processed by CMX if you tick ''process''. The output file then contains the value.<br/>
The second and third method's principal use is to be used programmatically from anywhere you can reach the CumulusMX machine.
The second and third method's principal use is to be used programmatically from anywhere you can reach the CumulusMX machine.


'''NOTE''': it is not possible to give Webtag modifiers by using the get method but it is in the POST method. Check out the differences in the above links.
'''NOTE''': it is not possible to give Webtag modifiers by using the GET method, but it is in the POST method. Check out the differences in the above links.


There are three bonus methods for getting values out of the CMX database:
There are three bonus methods for getting values out of the CMX database:
#Getting [[Cumulus_MX_Local_API#Predetermined_Data|predetermined data]] (not really with Webtags)
#Getting [[Cumulus_MX_Local_API#Predetermined_Data|predetermined data]] (not really with Webtags but useful in this context)
#Using MySQL through the Custom Upload feature
#Using MySQL through the Custom Upload feature
#Using the ''Custom Logs'' feature of CMX (from 3.22 and up) through which you get a timeseries of one or more Webtag(s)
#Using the ''Custom Logs'' feature of CMX (from 3.22 and up) through which you get a timeseries of one or more Webtag(s)
Line 91: Line 91:


== Processing files ==
== Processing files ==
The oldest, most common and possibly the easiest method for using webtags is processing a file (e.g. a HTML web page or a PHP script) which contains a webtag description like <#temp rc=y>. After processing the output file then contains the value (e.g. 17.1) for that webtag and the complete description, including the brackets have then disappeared.  
The oldest, most common and probably the easiest method for using webtags is processing a file (e.g. a HTML web page or a PHP script) which contains a webtag description like <#temp rc=y>. After processing the output file then contains the value (e.g. 17.1) for that webtag and the complete description, including the brackets have then disappeared.  


The configuration should look like the screenshot below:
The configuration should look like the screenshot below:
Line 98: Line 98:


== MySQL ==
== MySQL ==
In the MySQL settings of the Interface there exists the possibility to create Custom Upload queries. This is n ot the place to treat the use of MySQL extensively, but CumulusMX offers the possibility to use Webtags in such a Custom Upload query definition. The example below should clarify:
In the MySQL settings of the Interface there exists the possibility to create Custom Upload queries. This is not the place to treat the use of MySQL extensively and the custom queries, but CumulusMX offers the possibility to use Webtags in such a Custom Upload query definition. The example below should clarify:


   <span style="font-family:Courier">INSERT IGNORE INTO `test_daily_summary` (`MaxRainRate`, `LogDate`, `RollOver`)
   <span style="font-family:Courier">INSERT IGNORE INTO `test_daily_summary` (`MaxRainRate`, `LogDate`, `RollOver`)
     VALUES ('<#rrateTM>', '<#metdateyesterday format=yyyy-MM-dd>',  '(1 * SUBSTRING(<#rollovertime>,0,2))');</span>
     VALUES ('<#rrateTM>', '<#metdateyesterday format=yyyy-MM-dd>',  '(1 * SUBSTRING(<#rollovertime>,0,2))');</span>


Again, the modifiers are discussed below.
Again, the modifiers are discussed on [[Webtags/Parameters|their own page]].

Navigation menu