Source “IoT Data Hub Aggregation”
The source “IoT Data Hub Aggregation” provides the possibility to process several variables of a device at the same time as one state. This function is particularly useful if, for example, you want to link the humidity and temperature values that originate from a device in a condition of a rule. Based on the condition, the rule can be triggered afterwards.
Furthermore, this functionality is used to link GPS coordinates (longitude and latitude) from a device directly and easily in one step with the geo-coordinate of the digital twin.

To display the history of GPS data in the detailed view of a twin on a map, you can create the aggregated state according to this instruction:
- Select the source “IoT Data Hub Aggregation” and a device from the IoT Data Hub to receive data from.
- Then select all the desired variables, whose values will be aggregated into a JSON object.
- The value type is a JSON.
- In the Javaskript transformer, define the two variables lat and lon, e.g.:
module.exports = (data) => {
return {lat: data.gpsLatitude, lon: data.gpsLongitude};
}
-
Then link this state to the geo-coordinates of the twin.
-
With the next incoming data packet the position of the twin will be updated directly.
