Webtags: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
1,437 bytes added ,  24 September 2022
m
no edit summary
mNo edit summary
<hr/>
 
= Introduction =
= Essential Background Reading =
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 calcu;lated 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.:
 
temp -> (process) -> 17.1
 
ThereThe arewebtags severalcan methodshave modifiers to askchange the output or the input e.g. you can change the decimal CMXpoint to doa thiscomma translation(output allmodifier). ofAll whichthese will be discusseddescribed below (or in a sub-page). Two main methods are
#The processing (as Extra Web Files) and
#The getting the value by using the local interface GET method.
 
For using Webtags see below
In the first case you use <span style="font-family:Courier"><#temp></span> in the file which will then show up as <span style="font-family:Courier">17.1</span> in the output file. In the second case you use the URL in your browser: <span style="font-family:Courier">http://<ip-address>:8998/api/tags/process.json?temp</span> which returns <span style="font-family:Courier">{"temp":"12,7"}</span>. This method can give you a quick view of a value but can also be used programmatically from anywhere you can reach the CumulusMX machine.
 
= List of all tags =
== The Local List ==
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.
 
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 of Webtags carries a lot of additional information so it has its own [[Full list of Webtags|Webtag page]].
 
= Using Webtags =
There are basically two main methods to ask CMX to do this translation both of which will be discussed below (or in a sub-page). The two methods are:
#Processing files through the running instance of CumulusMX
#The gettingGetting the value by using the local interface GET method.
In the first case you use <span style="font-family:Courier"><#temp></span> in the file which will then show up as <span style="font-family:Courier">17.1</span> in the output file. In the second case you use the URL in your browser: <span style="font-family:Courier">http://<ip-address>:8998/api/tags/process.json?temp</span> which returns <span style="font-family:Courier">{"temp":"12,7"}</span>. This method can give you a quick view of a value but can also be used programmatically from anywhere you can reach the CumulusMX machine.
 
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.
The second method can give you a quick view of a value from the browser but its principal use is to be used programmatically from anywhere you can reach the CumulusMX machine.
 
In addition, there are two other methods to retrieve the value of the webtag:
The webtags can have modifiers to change the output or the input e.g. you can change the decimal point to a comma (output modifier). All these will be described below (or in a sub-page)
#Getting the values through the HTTP POST method
#Using MySQL through the Custom Upload feature
 
All methods are described in the [[Using Webtags]] page.

Navigation menu