Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
22.5k Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Save Calculations to ThingsBoard

When a calculated field is enabled, Trendz automatically writes its results to ThingsBoard as telemetry under the key _ECD_{KEY}. This makes calculated metrics available anywhere ThingsBoard supports telemetry — dashboards, alarm rules, rule chains, predictions, and further calculations.

Disabling a calculation field stops new writes but never deletes existing telemetry already stored in ThingsBoard.

Trendz calculated field
│
│ writes telemetry (_ECD_yourKey)
▼
ThingsBoard entity
│
┌───────┴────────────────────────────────┐
│ │
▼ ▼
Alarm Rules Dashboards / Rule Engine /
(threshold alerts) Predictions / Anomaly models

Two jobs control when data is written:

Job When it runs Purpose
Reprocess Once, on demand Backfill historical data for the selected time range
Refresh Scheduled (recurring) Keep telemetry up to date at a defined frequency

Before enabling a calculation, verify the key parameters that determine how data will appear in ThingsBoard:

Parameter Description
Grouping Interval Time bucket size — e.g. HOUR stores one point per hour in ThingsBoard.
Aggregation How values within a bucket are combined — e.g. SUM totals all readings in the hour.
Time Time range used by the refresh job. Choose a range that covers what each refresh cycle needs to process.

Recommended time settings by job frequency:

Frequency Recommended time range
Minute / Hour Today
Day Last 7 days
Week Last 14 days
Month Last 3 months
  1. Open the calculation field and verify Grouping Interval, Aggregation, and Time.

  2. Click Save Field to apply changes.

  3. In the confirmation dialog, click Save.

  4. You will be prompted to enable the calculation field and run a refresh task. You can do it now or later.

Once saved, the calculation field appears in the Calculation folder in the business entities panel.

The Reprocess Task runs once to compute and store historical data in ThingsBoard for the selected time range and entities.

  1. Open the Tasks tab and click Run Reprocess Task.

  2. Select the time range to reprocess.

  3. Choose the target entities — you can apply the calculation to all entities with the same entity profile.

  4. Click Run.

After the job completes, the telemetry appears in ThingsBoard under the key _ECD_{KEY}.

The Refresh Task runs on a recurring schedule to keep ThingsBoard telemetry up to date.

  1. Click the Jobs button in the calculation field editor.

  2. Enable calculation result saving.

  3. Set the start date — the earliest point from which data will be saved.

  4. Define the frequency — how often the job runs. The minimum interval is 1 minute (not recommended due to load); on Trendz Cloud the minimum is 1 hour.

  5. Choose target entities — select individual entities or all entities with the same profile for automatic updates.

  6. Click Save.

Once saved, the calculation shows an Enabled status. Telemetry will update automatically at the specified frequency for the selected entities.

Once the refresh and reprocess jobs are running, the calculated telemetry is continuously updated in ThingsBoard and available everywhere telemetry is supported.

You can create alarm rules based on the calculated telemetry key (_ECD_{KEY}) directly in the entity profile.

Example: A calculation produces temperature deviation values for each sensor relative to the building average. When the deviation exceeds 10°, an alarm is triggered. When it falls back below the threshold, the alarm is cleared.

  1. Open the entity profile where the calculation is created.

  2. Navigate to Alarm Rules and toggle Edit mode.

  3. Click Add alarm rule and configure the create and clear conditions using the _ECD_ telemetry key.

  4. Click Apply changes.

Once saved, the alarm rules are active.

Visualize the metric in any Trendz widget — line chart, heatmap, state view, and others. See Trendz Visualizations for the full list of chart types.

To embed a Trendz view into a ThingsBoard dashboard, see Embed Trendz Views.

Use Trendz Prediction Models to forecast future values of the saved metric and visualize them alongside the historical data.

Detect anomalies or outages in the saved metric using Trendz Anomaly Models. When an anomaly is detected, you can automatically trigger an alarm in ThingsBoard.