Skip to content
Stand with Ukraine flag

Time-Series Data

Time-series data is a sequence of timestamped key-value pairs published by a device or computed by the platform. It represents continuously changing measurements — sensor readings, counters, state changes — where every data point matters, not just the latest.

Compared to attributes:

AttributesTime-series
StorageLatest value onlyFull history
Typical dataConfig, stateSensor readings
Queryable by time rangeNoYes
AggregatableNoYes

Each time-series entry consists of:

  • Key — the measurement name (e.g., temperature)
  • Value — string, boolean, integer, double, or JSON
  • Timestamp — Unix epoch in milliseconds; auto-assigned by the server if not provided by the device

Simple payload:

{ "temperature": 26.5, "humidity": 78, "pressure": 1013.2 }

With explicit timestamp:

{ "ts": 1745000000000, "values": { "temperature": 26.5, "humidity": 78 } }

Devices publish time-series data over MQTT, HTTP, CoAP, LwM2M, and other protocols. Each protocol may use different payload format that is mapped to the same internal JSON format; only the transport mechanism differs. See the Connectivity guide for protocol-specific details.

Many protocols support multiple readings with different timestamps in a single message — useful for batching offline data or high-frequency sensors:

[
{ "ts": 1745000000000, "values": { "temperature": 25.1 } },
{ "ts": 1745000060000, "values": { "temperature": 25.4 } },
{ "ts": 1745000120000, "values": { "temperature": 26.0 } }
]
ThingsBoard stores time-series data in **PostgreSQL**. A separate **latest values** table is maintained for fast access to the current readings. Time-series retention is managed by your subscription plan.
CapabilityDescriptionGuide
Visualize on dashboardsPlot history with time-series charts; display latest values on gauges, cards, and tablesDashboards
Trigger alarmsFire alarms when a value crosses a thresholdAlarm rules
Process in Rule EngineFilter, enrich, transform, or route telemetry messages; forward to external systemsRule Engine
Compute derived valuesCalculate aggregations, delta, or any formula from raw telemetryCalculated Fields
Query via REST APIFetch latest values or historical data with time range and aggregation; delete specific rangesREST API