Data Sources and Data Streams
Last updated
Last updated
Each point exported to DCH is mapped to a corresponding Data Stream which records all the historic values for the point and its most recent metadata. Data streams are grouped into Data Sources. A Data Source is set up by the DCH user. A Data Source can be set up for a site, or for multiple sites. For larger sites, it may also be necessary or advantageous to set up multiple data sources due to the large number of points being uploaded and the frequency of upload.
If the gateway is publishing data for multiple sites, or there is a large data upload rate required, then the controller may need to publish to multiple data sources. In this case multiple JSON and MQTT functions would run in parallel, with one MQTT function per data source.
DCH can nominally accept 130 MQTT messages per second per data source (one message every 7.7ms), however communications between the gateway and the broker can be unreliable if the message rate is too fast and point data may be lost. An average of one message every 30-50ms is recommended. To minimise network traffic, MQTT Quality of Service is recommended to be set to 0 (fire and forget).
The data stream is created and named using the first message received for the corresponding point. The name is automatically generated using the data source random name, site (optional), point parent contained in the first JSON message received (optional) and point name contained in the first JSON message received. An example is below and shows the various parts of the name.
dsapi-faithful-adorable-tax
Clayton.ClaytonB000
B127Mech125_26_126_26_127
TotActEnergyExp
Generated from data source
Site
Point Parent
Point Name