Webtags: Difference between revisions

1,580 bytes added ,  19:35, 23 September 2022
m
mNo edit summary
Line 10: Line 10:


= Essential Background Reading =
= 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 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
There are several methods to ask CMX to do this translation all of which will be discussed 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.
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 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)