Lookup Asset¶
The Lookup Asset node enables an integration flow to query asset data in EnOS according to the query method you configured and uses the specified data records in the output. Only JSON is supported currently for the input.
Node Type¶
EnOS.
Input and Output Ability¶
This node has 1 entry point and 1 exit point. Both the input and output are JSON.
Node Properties¶
Name
The name for this node.
Query Method
The method that the node uses to select the assets of the data to be used for the output. The following methods are available.
By Device Key: Any asset with a device key that matches what is returned in the expression.
By Attribute: Any asset with an attribute that matches what is returned in the expression. You will need to specify which model’s attribute is to be used. Does not support attributes with timestamp, date, array, and file data types.
By Tag: Any asset with tags that matches the specified tag key and value.
Advanced Query: Additional options for querying assets that include using conditions. The maximum number of conditions is 5.
Generic: Two options are available, By Model and By Product. All assets under the selected model or product will be used.
Customize: Five options are available, By Device Key, By Attribute, By Tag, By Model ID, and By Product Key. As per By Device Key, for By Model ID and By Product Key, any asset with a model ID/product key that matches what is returned in the expression will be used.
Expression
This is a required field if one of the following query methods is selected.
By Device Key
By Attribute
By Model ID
By Product Key
See the examples below.
Query Method: By Device Key.
${msg.electricMeter}
The node searches the records and returns the assets with a device key that matches “electricMeter”.
Query Method: By Attribute.
Attribute: maxPower.
${msg.maxPower}
The node searches the records and returns the assets with an attribute that matches “maxPower”.
Output
The value of the returned assets from the query, to be stored using key:value format in the output message. Currently supports assetId. If multiple assets are returned, the first result will be used. If the message already has the same key, if will be overwritten by the result.
Description
The description for this node.
Limitations¶
For Advanced Query method, the maximum number of conditions is 5.
Samples¶
Input Sample¶
{
"externalId":"externalId",
"timestamp":24214324324,
"measurepoints":{
"speed":32,
"heat":40
}
}
Output Sample¶
The Lookup Asset node uses the expression ${msg.measurementpoint.speed}
and By Attribute to search for any asset whose speed measurement point matches the value of 32
and includes the asset’s ID in the output.
{
"externalId":"externalId",
"timestamp":24214324324,
"measurepoints":{
"speed":32,
"heat":40
},
"assetId":"assetId"
}