@ -24,27 +24,28 @@ Additionally let's imagine that devices periodically publishes other telemetry m
- `speed` - current speed value.
- `direction` - compass direction in which the device is moving.
- `acceleration` - how quickly the speed of the device is changing.
- `fuel_level` - current fuel level.
- `battery_level` - current battery level.
- `parked_location` - precise location where the device is parked.
- `parked_duration` - current park duration value.
- `parked_time` - timestamp when the device was parked.
- `fuelLevel` - current fuel level.
- `batteryLevel` - current battery level.
- `parkedLocation` - precise location where the device is parked.
- `parkedDuration` - current park duration value.
- `parkedTime` - timestamp when the device was parked.
Let's imagine that we need to make some historical analysis by fetching 3 latest telemetry readings for the keys listed below if the `event` value is set to *motion*:
Let's imagine that we need to make some historical analysis by fetching 3 latest telemetry readings in the range from 1 hour ago to 1 millisecond ago.
If the `event` value is set to *motion* we need to fetch data for keys:
- `speed`
- `direction`
- `acceleration`
- `fuel_level`
- `battery_level`
- `fuelLevel`
- `batteryLevel`
Otherwise, if the `event` value is set to *parked* value we need to fetch 3 latest telemetry readings for the following data keys:
Otherwise, if the `event` value is set to *parked* value we need to fetch data for keys:
- `parked_location`
- `parked_duration`
- `parked_time`
- `fuel_level`
- `battery_level`
- `parkedLocation`
- `parkedDuration`
- `parkedTime`
- `fuelLevel`
- `batteryLevel`
Imagine that you created a script node that depending on the `event` value adds to the message metadata appropriate keyToFetch fields.
@ -83,9 +84,9 @@ Imagine that you created a script node that depending on the `event` value adds
"deviceName": "GPS-001",
"deviceType": "GPS Tracker",
"ts": "1685379440000",
"keyToFetch1": "parked_location",
"keyToFetch2": "parked_duration",
"keyToFetch3": "parked_time"
"keyToFetch1": "parkedLocation",
"keyToFetch2": "parkedDuration",
"keyToFetch3": "parkedTime"
}
}
```
@ -96,8 +97,6 @@ In order to fetch the additional telemetry key values to make some historical an
In order to fetch the data using dynamic interval we need enable *Use dynamic interval* option in the rule node configuration and specify the templates for the *Interval start* and *Interval end*: