JSON-file from Meteobridge. **solved**

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
User avatar
Tln7559
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: Tue Jun 28, 2022 6:57 am

JSON-file from Meteobridge. **solved**

Post 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?
Meteobridge for reading TFA_Nexus, WF_Tempest & GW1000
+ datadistribution to various organisations
Domoticz for all other jobs
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: JSON-file from Meteobridge

Post 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
User avatar
Tln7559
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: Tue Jun 28, 2022 6:57 am

Re: JSON-file from Meteobridge

Post 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.
Attachments
MB_Output_JSON.zip
Template-file for JSON-generation
(739 Bytes) Downloaded 152 times
Meteobridge for reading TFA_Nexus, WF_Tempest & GW1000
+ datadistribution to various organisations
Domoticz for all other jobs
Post Reply