Simple metrics are used to receive and store RAW data published by products, machines, or sensors remotely connected to your DPS application.
Simple metrics are used to store simple data, like measures and logical variables.
Creating a Simple metric
To add a new Simple Metric to a Thing Definition, you should:
- Enter the RAW Data page.
- Select the Thing Definitions tab.
- Select the Thing Definition to edit.
- Press the Add Metric button.
- Select the Simple Metric type and provide the required information.
- Press the Save button and edit the additional information, if needed.
Editing a Simple metric
Once a Simple Metric has been saved, you can configure more information on it.
A Simple Metric is described by:
General
- Label: the metric label shown within the widget.
- Name: the name of the metric, also used to reference it within the dashboards' templates.
- Description: the text describing the metric. The description is displayed as a tooltip within the dashboard widgets.
- Unit: the unit of measurement (e.g. Kg, °C, pieces, liters...etc.)
- Value Type: the type of the value, one of Boolean, Double, Float, Integer, Long, String.
Pay attention to select the right type, if not, metric values may not be stored correctly. - Group: the group the metric belongs to (e.g. Temperatures, System).
Mapping
The mapping section of a metric you can configure:
-
Path: the path used to dispatch the incoming messages according to the underlying connection protocol, for instance in the case of MQTT this is the last part of the message topic.
-
Name: the name of the property to be extracted from the incoming message payload.
-
Value Encoding: the way the value is encoded within the payload (Literal, Binary HEX/INT).
For more details, see the article Encoding Values. -
Value Transformer: the transformer to be applied to the decoded value before being saved in the data storage.
For more details, see the article Transforming Values.
Initial value
Into a Simple metric, you can configure the value to be assigned to the metric when the thing is created or activated the first time. The value is registered by using the creation/activation timestamp.
Range
In case the metric is of type numeric, in this section, you can specify the minimum and maximum values the metric can assume.
Minimum and maximum values can also be dynamically redefined by specifying a property or a metric for them.
You can also define whether to discard incoming values that do not fit the range, avoiding unexpected behaviors, like alerts and rules triggering or wrong widget visualization (e.g. spikes on time-series diagram).
Note that, only constant values are used to validate the incoming metric values. In case you are using a dynamic range remember to specify a static range that at least contains the dynamic one.
Thresholds
In this section you can specify the intermediate thresholds. This information is used by widgets (e.g. Radial Gauge) to highlight values according to the thresholds (e.g. value > 75 -> amber, value > 90 -> red).
A threshold can also be dynamic by using a property or another metric. You can define static thresholds between the min and max values, and then redefine the thresholds by using metrics or properties.
It is up to you to use plausible values that are contained in the min and max values.
Comments
0 comments
Please sign in to leave a comment.