Data: Time Series Node
The Data: Time Series Node allows a workflow to query recent state across a time period for one or more devices for a specific attribute.
Node Properties
The configuration for the node is similar to the Time Series Dashboard Block. There are three major components: Device Selection, Query Configuration, and Result Path.
Device Selection
The first step is selecting the devices to query. There are several options for selecting devices:
- Specific Devices and/or Tags: Allows you to either select specific devices and tags or define a payload path to pull one or more Device IDs off of the current workflow payload to query.
- Parent System ID: Queries all devices with a specified parent system or all devices that have no parent system. This field is templatable.
- Experience Group ID: Queries all devices that are associated with a specified Experience Group. This field is templatable. Experience User ID or Email: Queries all devices that are associated with the specified Experience user. This field is templatable.
- Advanced Query: Allows you to construct your own device query.
In the example above, all devices with a tag equal to 123
are queried.
Query Configuration
The Data: Time Series Node also requires the following:
- Attribute
- Time Range
- Resolution
- Aggregation
The available resolutions vary depending on the selected time range, just like the Time Series Dashboard Block. In the above example, the attribute height
is queried over the last 60 minutes with a one-minute resolution using a Last
aggregation.
Result Path
Once the query is configured, the node needs a payload path to know where to store the result on the current workflow payload. The value placed at that path is an array of points:
[
{ "time": Thurs Feb 18 2016 18:00:00 GMT-0500 (EST), "value": 48.8 },
{ "time": Thurs Feb 18 2016 19:00:00 GMT-0500 (EST), "value": 49.7 },
{ "time": Thurs Feb 18 2016 20:00:00 GMT-0500 (EST), "value": 51.0 },
{ "time": Thurs Feb 18 2016 21:00:00 GMT-0500 (EST), "value": 51.7 },
{ "time": Thurs Feb 18 2016 22:00:00 GMT-0500 (EST), "value": 50.2 },
{ "time": Thurs Feb 18 2016 23:00:00 GMT-0500 (EST), "value": 50.6 },
{ "time": Fri Feb 19 2016 00:00:00 GMT-0500 (EST), "value": 50.9 },
{ "time": Fri Feb 19 2016 01:00:00 GMT-0500 (EST), "value": 49.1 },
{ "time": Fri Feb 19 2016 02:00:00 GMT-0500 (EST), "value": 49.2 },
{ "time": Fri Feb 19 2016 03:00:00 GMT-0500 (EST), "value": 49.1 },
{ "time": Fri Feb 19 2016 04:00:00 GMT-0500 (EST), "value": 58.1 },
{ "time": Fri Feb 19 2016 05:00:00 GMT-0500 (EST), "value": 57.8 },
{ "time": Fri Feb 19 2016 06:00:00 GMT-0500 (EST), "value": 49.7 },
{ "time": Fri Feb 19 2016 07:00:00 GMT-0500 (EST), "value": 54.2 },
{ "time": Fri Feb 19 2016 08:00:00 GMT-0500 (EST), "value": 54.2 },
{ "time": Fri Feb 19 2016 09:00:00 GMT-0500 (EST), "value": 53.6 },
{ "time": Fri Feb 19 2016 10:00:00 GMT-0500 (EST), "value": 57.8 },
{ "time": Fri Feb 19 2016 11:00:00 GMT-0500 (EST), "value": 53.2 },
{ "time": Fri Feb 19 2016 12:00:00 GMT-0500 (EST), "value": 55.6 },
{ "time": Fri Feb 19 2016 13:00:00 GMT-0500 (EST), "value": 55.5 },
{ "time": Fri Feb 19 2016 14:00:00 GMT-0500 (EST), "value": 55.6 },
{ "time": Fri Feb 19 2016 15:00:00 GMT-0500 (EST), "value": 54.2 },
{ "time": Fri Feb 19 2016 16:00:00 GMT-0500 (EST), "value": 52.4 },
{ "time": Fri Feb 19 2016 17:00:00 GMT-0500 (EST), "value": 32.2 }
]
The array of points is in order from oldest timestamp to newest. Each point is an object with two properties:
value
: Value for that pointtime
: Timestamp of that point.
In the above example, the result is stored at working.timeSeriesVal
.
Node Example
The payload after the execution of the example Data: Time Series Node may look similar to:
{
"time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
"working": {
"timeSeriesVal": [
{ "time": Thurs Feb 18 2016 18:00:00 GMT-0500 (EST), "value": 48.8 },
{ "time": Thurs Feb 18 2016 19:00:00 GMT-0500 (EST), "value": 49.7 },
{ "time": Thurs Feb 18 2016 20:00:00 GMT-0500 (EST), "value": 51.0 },
{ "time": Thurs Feb 18 2016 21:00:00 GMT-0500 (EST), "value": 51.7 },
{ "time": Thurs Feb 18 2016 22:00:00 GMT-0500 (EST), "value": 50.2 },
{ "time": Thurs Feb 18 2016 23:00:00 GMT-0500 (EST), "value": 50.6 },
{ "time": Fri Feb 19 2016 00:00:00 GMT-0500 (EST), "value": 50.9 },
{ "time": Fri Feb 19 2016 01:00:00 GMT-0500 (EST), "value": 49.1 },
{ "time": Fri Feb 19 2016 02:00:00 GMT-0500 (EST), "value": 49.2 },
{ "time": Fri Feb 19 2016 03:00:00 GMT-0500 (EST), "value": 49.1 },
{ "time": Fri Feb 19 2016 04:00:00 GMT-0500 (EST), "value": 58.1 },
{ "time": Fri Feb 19 2016 05:00:00 GMT-0500 (EST), "value": 57.8 },
{ "time": Fri Feb 19 2016 06:00:00 GMT-0500 (EST), "value": 49.7 },
{ "time": Fri Feb 19 2016 07:00:00 GMT-0500 (EST), "value": 54.2 },
{ "time": Fri Feb 19 2016 08:00:00 GMT-0500 (EST), "value": 54.2 },
{ "time": Fri Feb 19 2016 09:00:00 GMT-0500 (EST), "value": 53.6 },
{ "time": Fri Feb 19 2016 10:00:00 GMT-0500 (EST), "value": 57.8 },
{ "time": Fri Feb 19 2016 11:00:00 GMT-0500 (EST), "value": 53.2 },
{ "time": Fri Feb 19 2016 12:00:00 GMT-0500 (EST), "value": 55.6 },
{ "time": Fri Feb 19 2016 13:00:00 GMT-0500 (EST), "value": 55.5 },
{ "time": Fri Feb 19 2016 14:00:00 GMT-0500 (EST), "value": 55.6 },
{ "time": Fri Feb 19 2016 15:00:00 GMT-0500 (EST), "value": 54.2 },
{ "time": Fri Feb 19 2016 16:00:00 GMT-0500 (EST), "value": 52.4 },
{ "time": Fri Feb 19 2016 17:00:00 GMT-0500 (EST), "value": 32.2 }
]
},
"globals": { },
"applicationId": "568beedeb436ab01007be53d",
"applicationName": "Embree",
"triggerId": "56c794a06895b00100cbe84c",
"triggerType": "timer",
"flowId": "56c794a06895b00100cbe84c",
"flowName": "Query Data",
}
Node Errors
If no devices are found using the query or no data has come from those devices, an empty object is placed at the payload path.
Was this page helpful?
Still looking for help? You can also search the Losant Forums or submit your question there.