The sets of streams that your devices will support are defined in JSON
files inside the data_streams
directory of your simulation.
You can have different files with different collections for every defined profile in your simulation or reuse them in several profiles.
You can skip this step if your simulation does not require to upload data samples to Digi Remote Manager. |
You can store time-series data in Remote Manager that can be retrieved later by an external application using Remote Manager web service APIs. This feature is known within Remote Manager as data streams.
Time series data in Remote Manager involves two concepts:
-
Data points are the individual values which are stored in data streams with a unique time stamp.
-
Data streams are containers of data points. Data streams hold metadata about the data points within them. Data streams and the data points they hold are addressed using hierarchical paths (much like folders).
There are two different ways to generate data values to upload to Digi Remote Manager with the IoT Device Simulator:
-
Generated by the IoT Device Simulator, as
static
,incremental
, orrange
values.The advantage of this is you do not require any extra resources or code to get new values. But it may not be enough for your simulation requirements.
-
Generated by custom code.
This means you must write some code to provide new data values per device and stream. But offers more possibilities to cover the requirements.
For this example you need two streams to upload:
-
Current light level: a
range
value generated by the IoT Device Simulator. -
Status of each streetlight: managed by custom code.
Follow these steps to create a file with a set of data streams:
-
Inside
data_streams
directory, renametemplate_streams.json
file tolight_streams.json
.In your
streetlight.json
profile you configureddata_streams_id
to belight_streams
, this means you must have a file with that name and.json
extension insidedata_streams
directory. See previous step 3. Establish your devices profile. -
Open the
light_streams.json
file to add the required data streams. -
Define the collection of data streams.
For the example:
-
One to simulate the measured light level.
This data is generated by the IoT Device Simulator as a
range
value between0
and50000
every two minutes. -
Another to upload the current status: on (
1
), off (0
)This data is generated by custom code every 30 seconds. See 6. Implement custom code.
-
For a complete explanation of data stream files, see Data streams structure. |
data_streams/light_streams.json
{
"light_level": {
"type": "integer",
"units": "lux",
"sampling_rate": "PT2M",
"data_source": {
"mode": "range",
"deviation": "10",
"limits": "0,50000",
"initial_value": "1000"
}
},
"on_status": {
"type": "integer",
"units": "units",
"sampling_rate": "PT30S",
"data_source": {
"mode": "command",
"timeout": 5
}
}
}