Skip to content
Stand with Ukraine flag

Attributes

Attributes are key-value pairs that describe the properties, state, or configuration of an entity. Unlike telemetry, attributes represent semi-static data — ThingsBoard stores only the latest value and its timestamp.

Each attribute entry consists of:

  • Key — the attribute name (e.g., maxTemperatureThreshold)
  • Value — string, boolean, integer, double, or JSON object
  • Timestamp — Unix epoch in milliseconds; the last time this attribute was updated

Example payload:

{ "reportingInterval": 60, "firmwareVersion": "v2.4.0", "alarmEnabled": true }

Unlike time-series data, only the latest value per key is retained — there is no history.

ThingsBoard supports three attribute scopes that define who can read and write each attribute:

ScopeWritable byReadable byAvailable for
Server-sidePlatform onlyPlatformAll entities
SharedPlatform onlyPlatform + DeviceDevices only
Client-sideDevice onlyPlatform (read-only)Devices only

Server-side attributes store platform-managed metadata and configuration. Devices cannot read or modify them — they are managed exclusively via the ThingsBoard UI or REST API.

Typical use: location data, alarm thresholds, operational settings.

{
"latitude": 40.7128,
"longitude": -74.0060,
"maxTemperatureThreshold": 40,
"alarmEnabled": true
}
  • latitude / longitude — used in map widgets to show entity location
  • maxTemperatureThreshold — referenced by the Rule Engine to trigger alarms
  • alarmEnabled — controls whether alarm generation is active

Shared attributes deliver configuration from the platform to a device. The platform writes them; the device can read them but cannot modify them.

Typical use: remote device configuration — target firmware version, reporting interval, operational thresholds.

Devices receive updates depending on their protocol:

  • Real-time (e.g., MQTT) — subscribe to attribute updates and receive notifications immediately when a value changes
  • Periodic polling (e.g., HTTP) — poll the server at intervals for the latest values
  • Downlink (network integrations) — updates delivered as downlink messages
{
"targetFirmwareVersion": "v2.4.0",
"reportingInterval": 60,
"maxTemperatureThreshold": 45
}
  • targetFirmwareVersion — device checks this to decide whether an upgrade is needed
  • reportingInterval — how often (in seconds) the device should publish telemetry
  • maxTemperatureThreshold — limit the device uses locally for its own control logic

Client-side attributes are reported by the device to the platform. The platform stores and displays them but cannot modify them — only the device can write these values.

Typical use: reporting active firmware version, current configuration, device state.

{
"currentFirmwareVersion": "v2.3.1",
"currentConfiguration": { "mode": "auto", "interval": 30 },
"deviceState": "ACTIVE"
}
  • currentFirmwareVersion — used for fleet-wide firmware monitoring
  • currentConfiguration — the device’s active runtime config (mode, interval, etc.)
  • deviceState — current status, e.g., ACTIVE, IDLE, ERROR
  1. Open the entity details page (e.g., Entities → Devices → [device name]).
  2. Navigate to the Attributes tab and select the scope: Server-side, Shared, or Client-side.
  3. Click + to open the Add attribute dialog.
  4. Enter the Key, select the data type (String, Boolean, Integer, Double, or JSON), and enter the Value.
  5. Click Add.

For bulk creation, use bulk provisioning to import multiple entities and their attributes from a CSV file.

Attributes can be read and written programmatically via the REST API. Authenticate using a JWT token in the X-Authorization header. Separate endpoints exist for each scope.

Enable `CACHE_ATTRIBUTES_ENABLED` to load each attribute from the database only once and serve subsequent reads from cache.
CapabilityDescriptionGuide
Monitor on dashboardsDisplay and compare attribute values with gauges, cards, and entity tables; edit writable attributes directly from the UI with input widgetsDashboards
Configure devices remotelyWrite shared attributes to push configuration to devices; devices receive updates in real time or via pollingConnectivity guide
Trigger alarmsFire alarms when an attribute value crosses a thresholdAlarm rules
Enrich telemetry messagesInject attribute values (thresholds, metadata) into telemetry messages for per-device dynamic processingRule Engine
Process attribute updatesIntercept, transform, and react to attribute changes — validate before persistence or trigger automationRule Engine
Use in Calculated FieldsCombine attribute values with time-series data as inputs to computed formulas — e.g., normalize a sensor reading using a device-specific calibration factorCalculated Fields
Query via REST APIRead and write attributes by scope programmaticallyREST API