Skip to content
Stand with Ukraine flag

Business Entities

Trendz treats your ThingsBoard topology — assets, devices, and the relations between them — as a flat table where every column is a telemetry key or attribute from any entity in the hierarchy. Relations are the joins that link fields from different entity types.

Consider a Smart Building solution where Buildings contain Apartments, and each Apartment has Energy Meter devices:

Trendz uses the relations between profiles to traverse this hierarchy and fetch the data you need, regardless of how deeply nested the entities are.

When you build a report, Trendz resolves the data path automatically based on the relations in your topology. For example, a report using only two fields:

  • building name — an attribute on the Building asset
  • energy — telemetry on the Energy Meter device
  • Aggregation: SUM, time range: last month

Trendz executes the following steps internally:

  1. Finds all Building assets in ThingsBoard.
  2. For each Building, finds all related Apartment assets.
  3. For each Apartment, finds all related Energy Meter devices.
  4. Loads energy telemetry for all Energy Meters over the last month.
  5. Aggregates the telemetry per Building using SUM.

The result shows total energy consumed by each building — with no manual join logic required.

Managing Relations Between Business Entities

Section titled “Managing Relations Between Business Entities”

ThingsBoard lets you create any number of relations between devices and assets. In Trendz, however, only one relation type is permitted between two device/asset profiles. This constraint ensures a stable, unambiguous data traversal path.

When multiple relation types exist between the same two profiles, Trendz cannot determine which relation to follow, resulting in undefined behavior.

Example of a conflicting configuration:

FromRelationTo
ApartmentcontainsEnergyMeter
ApartmentconnectedEnergyMeter

With both relations active, Trendz cannot decide which EnergyMeters belong to which Apartment for a given query.

How to resolve it:

Use the Enabled checkbox on the Business Entity page to deactivate the relation types you do not need.

  1. Click the Business Entities button in the bottom-left corner of Trendz.
  2. Select the business entity whose relations you want to configure (e.g., EnergyMeter).
  3. Open the Relations tab.
  4. Uncheck Enabled for each relation type that should not be used.
  5. Click Save.

Only the enabled relations are used when Trendz traverses your topology to load data.