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

Use Metrics in ThingsBoard

Metrics created in the Trendz Metric Explorer can be published to ThingsBoard as telemetry and used anywhere ThingsBoard supports telemetry — dashboards, Rule Engine, and Alarm Rules.

Generated Metric
│
│ Save Calculation
▼
Native Calculation Field
│
├── Reprocess Task ──▶ Historical data saved to ThingsBoard
│
└── Refresh Task ────▶ Ongoing automatic updates
│
▼
ThingsBoard Telemetry (key: _ECD_*)
│
┌───────────────┼───────────────┐
▼ ▼ ▼
Dashboards Alarm Rules Rule Engine

From the Generated Metric editor, click Save Calculation and enter:

Parameter Description
Calculation Name Label shown in Trendz for this field.
Calculation Key Telemetry key used in ThingsBoard, automatically prefixed with _ECD_.

Example: saving key energy_consumption_rate creates ThingsBoard telemetry at _ECD_energy_consumption_rate.

Click Save — the field appears in the Calculation folder in the Fields Section.

Before running any jobs, verify the following parameters on the Calculation Field:

Parameter Description
Grouping Interval How data is bucketed — e.g., HOUR saves one point per hour to ThingsBoard.
Aggregation How multiple values in the same interval are combined — e.g., SUM.
Time The lookback window used by the refresh job.

Recommended Time settings by job frequency:

Time setting Use when
Today Minute or hourly jobs
Last 7 Days Daily jobs
Last 14 Days Weekly jobs
Last 3 Months Monthly jobs

Click Save Field, then confirm with Save to apply the parameters.

A Reprocess Task calculates the metric over a historical time range and saves the results to ThingsBoard. Run this once after creating the Calculation Field to populate historical data.

  1. Open the Tasks tab.

  2. Click Run Reprocess Task.

  3. Select the time range to reprocess.

  4. Choose the items — you can apply the job to the current item, all items, or a subset of items with the same entity profile.

  5. Click Run.

After the task completes, ThingsBoard will contain telemetry points for the selected period.

A Refresh Task keeps telemetry up to date by automatically recalculating the metric on a schedule.

  1. Click the Jobs button.

  2. Enable calculation result saving.

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

  4. Define the frequency — how often the job runs.

  5. Choose the target items — entities with the same entity profile to update automatically.

  6. Click Save.

Once saved, the Enabled status appears next to the calculation name. Telemetry will now update automatically at the configured frequency for the selected items.

Once the Calculation Field is configured with a refresh job and historical data is loaded via a reprocess job, the metric telemetry is continuously updated in ThingsBoard. You can use it anywhere ThingsBoard supports telemetry — including dashboards, Alarm Rules, and the Rule Engine. The metric telemetry key (e.g., _ECD_energy_consumption_rate) is used in Rule Engine chains exactly like any other device telemetry key.

Create ThingsBoard alarms triggered by the metric telemetry:

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

  2. Navigate to Alarm Rules and enable Edit mode.

  3. Click Add alarm rule and configure the create and clear conditions.

  4. Click Apply changes.

Example: A metric calculates the absolute temperature deviation from the building average. An alarm rule triggers a Warning alarm of type Abnormal Temperature when the deviation exceeds 10, and clears it when it drops back below. This can detect device overheating, an open window, or a broken refrigerator — without writing any Rule Engine logic.

Visualize the metric using any Trendz widget — line chart, heatmap, state chart (from the Range Analysis tab), and more. Completed views can be embedded into ThingsBoard dashboards.

See Trendz Visualizations and Embed Visuals in ThingsBoard for details.

Use Trendz Prediction Models to forecast future values of the metric and embed the prediction view into a ThingsBoard dashboard.

See Prediction Models for details.

Use Trendz Anomaly Models to detect anomalies or outages in the metric. When an anomaly is detected, automatic alarm creation can be configured.

See Anomaly Detection for details.