Page 1 of 1

JSON-file from Meteobridge. **solved**

Posted: Sat Jan 13, 2024 11:29 am
by Tln7559
At request Meteobridge can output an XML-file, as described under Add-On Services, or equivalent output of a TXT-file.
For data-extraction have a preference for JSON-format, because the JSON-tagging allows easy finding of 'borders' of the value-fields:
especially useful if the value-fields are of variable length.
Therefore looking for the equivalent function for output of a JSON-file.
Searched the documentation at the website (and some forums), but cannot find a function which simply outputs the mapped datafields of Meteobridge as a JSON-file, equivalent to the output of the XML-file.
For initial approach with contents of the JSON-file with just the whole set of fields from the mapping, with tags related to the labels in the mapping:
a selection of fields from the mapping is not required, because labels in the mapping already unambiguous.
Selection from the mapping is only nice-to-have, allowing reduction of size of the JSON-file.

Is such function somewhere available in Meteobridge? Under which 'cover'?
If not, has/knows somebody a Template-construction realizing such function?
Or (as alternative) could one of the existing outputs be redirected to provide a JSON-type of file?

Re: JSON-file from Meteobridge

Posted: Tue Jan 30, 2024 10:26 am
by admin
You can define a template that mimics JSON syntax and call Meteobridge to report the data accordingly.
Link: https://meteobridge.com/wiki/index.php/Add-On_Services

Re: JSON-file from Meteobridge

Posted: Tue Jan 30, 2024 11:01 am
by Tln7559
Got a hint pointing to an example for direct external calling for a JSON-output, and 'translated/customized' that info into a template.
Not the whole bunch of data as available in Meteobridge, but still a grand selection.
The resulting experimental template-file in the attached ZIP-file has layout to get SI/metric values.