6 Sample DataChunk version 2 object in JSON Format
DataChunk version 2 is the current specification of the DataChunk object format used by DotVision, and by extension the current DataChunk version used by Spoony devices.
DataChunks are DotVision proprietary format used to carry TimeSeries data, such as DataPoint values.
This section describes only the subset of Datachunk V2 functionalities used by Spoony devices. Unused fields are not mentioned but are available from the full specifications available on DotVision website: https://docs.blueforest.io/docs/datachunk/
Current revisions of the device firmware only support JSON encoding.
DataChunk class diagram is shown below:
Figure 1 – DataChunk class diagram
1 DataChunk object
Property |
Name |
Type |
Card. |
Description |
v |
Version |
String |
1 |
Datachunk Version. Currently 2.0 |
f |
From |
DateTime |
1 |
Timestamp when this datachunk start. UTC Time |
t |
To |
DateTime |
1 |
Timestamp when this datachunk end. UTC Time |
r |
Records |
* |
List of Records |
Figure 2 - DataChunk object specifications
2 Record object
Property |
Name |
Type |
Card. |
Description |
d |
DeviceId |
String |
1 |
Device Id (Friendly Name) |
u |
Unit |
String |
1 |
Unit as configured in DataChunk Service |
s |
Series |
* |
List of Series |
Figure 3 - Record object specifications
On Spoony devices, one Record object is created for each unique Unit declared in DataChunk Service V2 configuration.
3 Serie object
Property |
Name |
Type |
Card. |
Description |
m |
Measurement |
String |
1 |
Measurement name |
t |
Type |
String |
1 |
Always “float” on Spoony devices |
s |
Samples |
* |
List of Samples |
Figure 4 - Serie object specifications
On Spoony devices, Measurement name is the name specified as Alias in the DataChunk Service V2 configuration, or DataPoint name by default.
4 Sample object
Property |
Name |
Type |
Card. |
Description |
i |
Index |
Int64 |
1 |
Sample’s Index. Represent the order those samples were generated on the device |
t |
Timestamp |
DateTime |
1 |
Timestamp when the measure was Taken. UTC time |
q |
Quality |
String |
1 |
Value quality. Always “good” currently |
v |
Value |
Float |
1 |
DataPoint value. Always floating-point type on Spoony devices. |
e |
Extensions |
? |
Minimum/Maximum values extension |
Figure 5 - Sample object specifications
Value field has two possible meaning on Spoony devices:
- If Aggregation functionality is enabled in DataChunk Service configuration for this DataPoint, Value field is the calculated average Value,
- If aggregation is disabled for this DataPoint, Value field is instantaneous value.
Extension field is only present when aggregation functionality is enabled for this DataPoint and is described in next paragraph.
5 MinMax extension object
Property |
Name |
Type |
Card. |
Description |
min |
Minimum |
Float |
1 |
Minimum value over aggregation period |
max |
Maximum |
Float |
1 |
Maximum value over aggregation period |
Figure 6 - MinMax extension object specifications
MinMax extension object is only available when DataPoint aggregation functionality is enabled in DataChunk Service configuration file. See paragraph 4.7.3.1 for details on aggregation functionality configuration.
6 Sample DataChunk version 2 object in JSON Format
The following sample is a valid DataChunk version 2 JSON object which can be used as a reference. It contains both standard and aggregated DataPoints (with average, min, and max values) for reference:
Figure 7 – Sample DataChunk version 2 JSON Object
Figure 1 – DataChunk class diagram
Figure 2 - DataChunk object specifications
Figure 3 - Record object specifications
Figure 4 - Serie object specifications
Figure 5 - Sample object specifications
Comments
0 comments
Please sign in to leave a comment.