ThingsBoard Documentation

Documentation for using ThingsBoard IoT Platform. Open documentation for releases before 2.0
ThingsBoard Professional Edition with White-labeling and Platform Integrations Learn More

Enrichment Nodes

Enrichment Nodes are used to update meta-data of the incoming Message.

Customer attributes

image

Node finds Customer of the Message Originator entity and adds Customers Attributes or Latest Telemetry value into Message Metadata.

Administrator can configure the mapping between original attribute name and Metadata attribute name.

There is Latest Telemetry checkbox in the Node configuration. If this checkbox selected, Node will fetch Latest telemetry for configured keys. Otherwise, Node will fetch server scope attributes.

image

Outbound Message Metadata will contain configured attributes if they exist. To access fetched attributes in other nodes you can use this template ‘metadata.temperature

Following Message Originator types are allowed: Customer, User, Asset, Device.

If unsupported Originator type found, an error is thrown.

If Originator does not have assigned Customer Entity Failure chain is used, otherwise Success chain.

You can see the real life example, where this node is used, in the next tutorial:

Device attributes

image

Node finds Related Device of the Message Originator entity using configured query and adds Attributes (client\shared\server scope) and Latest Telemetry value into Message Metadata.

Attributes are added into metadata with scope prefix:

For example, shared attribute ‘version’ will be added into Metadata with the name ‘shared_version’. Client attributes will use ‘cs_’ prefix. Server attributes use ‘ss_’ prefix. Latest telemetry value added into Message Metadata as is, without prefix.

In ‘Device relations query’ configuration Administrator can select required Direction and relation depth level. Also Relation type can be configured with required set of Device types.

image

If multiple Related Entities were found, only the first Entity is used for attributes enrichment, other entities will be discarded.

Failure chain is used if no Related Entity was found, otherwise - Success chain.

If attribute or telemetry was not found, it is not added into Message Metadata and still routed via Success chain.

Outbound Message Metadata will contain configured attributes only if they exist.

To access fetched attributes in other nodes you can use this template ‘metadata.temperature

Originator attributes

image

Add Message Originator Attributes (client\shared\server scope) and Latest Telemetry value into Message Metadata.

Attributes are added into metadata with scope prefix:

For example, shared attribute ‘version’ will be added into Metadata with the name ‘shared_version’. Client attributes will use ‘cs_’ prefix. Server attributes use ‘ss_’ prefix. Latest telemetry value added into Message Metadata as is, without prefix.

image

Outbound Message Metadata will contain configured attributes if they exist.

If attribute or telemetry was not found, it is not added into Message Metadata and still routed via Success chain.

To access fetched attributes in other nodes you can use this template ‘metadata.cs_temperature

You can see the real life example, where this node is used, in the following tutorials:

Originator fields

image

Node fetches fields values of the Message Originator entity and adds them into Message Metadata. Administrator can configure the mapping between field name and Metadata attribute name. If specified field is not part of Message Originator entity fields it will be ignored.

image

Following Message Originator types are allowed: Tenant, Customer, User, Asset, Device, Alarm, Rule Chain.

Failure chain is used If unsupported Originator type found, otherwise - Success chain.

If field value was not found, it is not added into Message Metadata and still routed via Success chain.

Outbound Message Metadata will contain configured attributes only if they exist.

To access fetched attributes in other nodes you can use this template ‘metadata.devType

image

Node finds Related Entity of the Message Originator entity using configured query and adds Attributes or Latest Telemetry value into Message Metadata.

Administrator can configure the mapping between original attribute name and Metadata attribute name.

In ‘Relations query’ configuration Administrator can select required Direction and relation depth level. Also set of Relation filters can be configured with required Relation type and Entity Types.

There is Latest Telemetry checkbox in the Node configuration. If this checkbox selected, Node will fetch Latest telemetry for configured keys. Otherwise, Node will fetch server scope attributes.

image

If multiple Related Entities are found, only first Entity is used for attributes enrichment, other entities are discarded.

If no Related Entity found Failure chain is used, otherwise Success chain.

Outbound Message Metadata will contain configured attributes if they exist.

To access fetched attributes in other nodes you can use this template ‘metadata.tempo

You can see the real life example, where this node is used, in the next tutorial:

Tenant attributes

image

Node finds Tenant of the Message Originator entity and adds Tenant Attributes or Latest Telemetry value into Message Metadata.

Administrator can configure the mapping between original attribute name and Metadata attribute name.

There is Latest Telemetry checkbox in the Node configuration. If this checkbox selected, Node will fetch Latest telemetry for configured keys. Otherwise, Node will fetch server scope attributes.

image

Outbound Message Metadata will contain configured attributes if they exist. To access fetched attributes in other nodes you can use this template ‘metadata.tempo

Following Message Originator types are allowed: Tenant, Customer, User, Asset, Device, Alarm, Rule Chain.

If unsupported Originator type found, an error is thrown.

Failure chain is used if Originator does not have assigned Tenant Entity, otherwise - Success chain.