Skip to content
Stand with Ukraine flag

Sync GPS Position from Tracker to Vehicle or Container

  • Calculated Field
  • 131 installs
  • v1.0.0
  • Jun 15, 2026
  • MIT license
  • v4.3+

Sync latest GPS position from a tracker device onto its parent vehicle, container, or rental asset — so dashboards, geofences, and history stay on the asset across tracker swaps.

Type
  • Propagation
Category
  • Geospatial
Use Cases
  • Fleet Tracking
  • Asset Tracking

Who it’s for

Fleet operators, logistics teams, and asset-rental managers who treat the vehicle, container, or equipment as the permanent record — when the tracker is replaceable hardware and dashboards, geofences, and history must stay on the asset across every swap.

What it does

Reads the latest latitude and longitude telemetry from the tracker device and writes them onto the parent asset (vehicle, container, rental unit) via a Contains relation.

Mirror latest tracker position to parent asset diagram

How to set up

Before this CF can write to the parent, set up a Contains relation from the parent asset to the tracker device. Each asset that should receive position updates needs this relation pointing at its currently attached tracker.

Via UI:

  1. Open the parent asset’s details page (Entities → Assets → [asset name]).
  2. Navigate to the Relations tab and select the From scope.
  3. Click + to open the Add relation dialog.
  4. Set type Contains, target type Device, and pick the tracker that is currently installed on this asset.
  5. Click Add.

When a tracker is replaced, delete the old Contains relation and add a new one pointing at the replacement tracker. The CF starts mirroring the new tracker’s position immediately — no other configuration changes.

For bulk setup across many assets and trackers, use the Relations REST API.

How to customize

  • To use different tracker telemetry keys — change the Time series key on each argument (e.g. latitudelat, longitudelon).
  • To avoid clashing with keys the asset already has — rename the argument (this becomes the key written on the parent) to something scoped (e.g. currentLatitude, trackerLat).
  • To propagate additional telemetry to the parent — add more arguments (e.g. speed, mileage, odometer). Each argument becomes one key on the parent asset.
  • To follow a different relation type — change the Relation type from Contains to whatever your hierarchy uses (Manages, OwnedBy). Keep Relation direction as Up to parent.
  • To compute a value before propagating, rather than copy as-is — the template ships in Arguments only mode, which writes each argument’s value to the parent under the same key. Switch to Calculation result mode and supply a TBEL script to derive, filter, or combine values before they land on the parent.
  • To turn off the database write, WebSocket push, or downstream CF re-evaluation on the parent — under Process right away, toggle Save to time series, Save to latest values, Send to WebSockets, or Send to Calculated fields.
  • To filter, transform, or forward the propagated values to external systems — switch Strategy to Process via Rule Chains. Rule nodes on the parent then receive the values and can drop them, change them, save them conditionally, push them to an external system, or anything else the chain defines.

Share Your Calculated Field with the Community

Built a useful data transformation? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers worldwide.