Skip to content

Micro-application Data and Resources ​

2.00.091: Application parameter ownership ​

Following “everything is a device”, presentation settings, layouts, component settings, 3D settings and other application parameters belong to the corresponding device's app_attrs. ThinkLink is the authority for reads and writes. Project, building and space settings belong to the device representing that object. Shared settings need one explicit owner device; consumers reference it instead of saving competing copies.

Browser storage is a temporary cache. Reloading, signing in again or switching browsers must recover the platform value. Keep device identity not ready, association not ready, load failure and missing data distinct. Never save an empty object because identity or data has not loaded.

ContentOwner and write boundary
Application and component settingsDevice app_attrs; register owned top-level fields, nested schema, schema version and writer
Shared project or space settingsDevice representing the object; record its device ID/EUI mapping rather than using a business object ID as a device ID
3D configurationapp_attrs.__transform_3d; the application defines models, coordinates, units and rendering
Operation logs, maintenance logs and their attachmentsIndependent platform log services; never app_attrs or a project log array

Reading and partial updates ​

Use platform device data APIs to read all app_attrs or select top-level fields. Read the owning top-level field when nested data is needed. Do not request 3D as a top-level transform_3d field.

  • Prefer POST /thinklink/device/update-device-data with the owner device’s eui and type: "app_attrs"; use set, set_paths and remove for the intended fields while preserving other applications and components.
  • When changing device configuration and application attributes together, use update-config with attribute_changes.app_attrs. Submit only owned, changed fields; do not write back the entire snapshot.
  • Prefer set_paths for nested updates. Replacing a shared top-level object from an old snapshot can overwrite another component. Partial updates do not automatically resolve concurrent edits to the same field.
  • Thing-model and RPC attribute updates remain top-level shallow merges. Preserve sibling properties explicitly when changing a nested object; HTTP set_paths semantics do not apply to scripts.
  • Read back after saving. Application attributes participate in forwarding only when forwarding fields are explicitly configured. Do not assume every change is pushed over MQTT; refresh by querying when no reliable subscription exists.

The following is application data, not a mandated platform schema or a complete HTTP request. Separate components own overview and equipmentCard; the 3D field uses the platform name:

json
{
  "overview": {"schemaVersion": 1, "layout": "grid"},
  "equipmentCard": {"schemaVersion": 1, "showHumidity": true},
  "__transform_3d": {"position": {"x": 1, "y": 2, "z": 3}}
}

Use modifyAttrs when migrating scripts. To change only x, preserve other 3D properties and position y/z. This example constructs a value only; currentAppAttrs must be successfully read from ThinkLink. It is not an RPC action envelope or an atomic concurrency mechanism:

javascript
const current3d = currentAppAttrs.__transform_3d ?? {};
const next3d = {
  ...current3d,
  position: { ...current3d.position, x: 4 }
};
const ownedPatch = { __transform_3d: next3d };
// Submit using the target version's modifyAttrs contract, then read back.

Verified APIs and request examples ​

Contract basis: the 2026-10-20 upgrade notice and the bilingual user OpenAPI generated by tkl-api; the local contract version remains 1.25.5. This supersedes the save endpoint’s ID and buffer-flush guidance in release c08e93f5. MCP discovery/preparation does not prove target deployment, database migration or saved values.

Use the business platform origin <BASE_URL> without /thinklink, with the token: <TOKEN> header. The MCP URL is not the business API base. JSON requests use Content-Type: application/json.

Method and pathoperationIdRequest and response
POST /thinklink/device/find-device-datadeviceFindDeviceDataRequired id/type; app_attrs returns full {content}, empty content is {}, no group update_time
POST /thinklink/device/find-current-attrsdeviceFindCurrentAttrsLocate by id; preserve existing read parameters, not eui
POST /thinklink/device/find-page-by-fieldsdeviceFindPageByFieldsapp_attrs:true or a top-level field array; returns data/total/current/pageSize, total may be a decimal string
POST /thinklink/device/update-device-datadeviceUpdateDeviceDataRequired eui/type; id is rejected; partial updates return the complete committed {content} snapshot
POST /thinklink/device/update-configdeviceUpdateConfigRequired id; changes for configuration, attribute_changes.app_attrs for application patches; returns {result:true}

Full-group request body:

json
{"id":"<DEVICE_ID>","type":"app_attrs"}

Projected page request scoped to actual device bindings (exact EUI matching; an empty binding must produce an empty scope):

json
{"current":1,"pageSize":50,"euis":["<DEVICE_EUI>"],"fields":["id","name"],"app_attrs":["cockpit","__transform_3d"]}

Do not put app_attrs in fields. Dots are literal key characters, not nested paths. Missing keys are omitted; explicit null/false/0 and nested null remain. Full-group reads use current memory; paginated reads use database snapshots that may lag and have no cross-page consistency guarantee.

Partial update, only for owned fields whose existing parents are objects or absent:

sh
curl -X POST '<BASE_URL>/thinklink/device/update-device-data' \
  -H 'token: <TOKEN>' -H 'Content-Type: application/json' \
  --data '{"eui":"<DEVICE_EUI>","type":"app_attrs","set_paths":[{"path":["cockpit","layout","columns"],"value":3}],"remove":[["cockpit","obsolete"]]}'

set replaces whole top-level values. set_paths is an array of {path:["parent","child"],value:...} entries with at least one nonempty string per path; missing parent objects are created. Arrays are replaced atomically, not indexed. In remove, strings delete top-level keys and string arrays delete object paths. Missing paths do nothing and empty parents remain. Duplicate or ancestor/descendant paths, traversal through scalars/null/arrays, unknown patch fields and invalid JSON are rejected. null/false/0 are values, not deletion commands.

Combined configuration and attribute request, after reading and confirming the intended changes:

json
{"id":"<DEVICE_ID>","changes":{"name":"<DEVICE_NAME>"},"attribute_changes":{"app_attrs":{"set_paths":[{"path":["cockpit","layout","columns"],"value":3}]}}}

For update-config above, configuration SQL and attribute flushing are not atomic; an error can follow committed configuration or changed memory. Read back after success or failure. Single-device group reads/writes support eight groups, including app_attrs and process_data; the old four-group write restriction is obsolete. Do not transfer these patch semantics to batch APIs.

Management HTTP saves do not publish attribute MQTT. Explicit forwarding fields are necessary for application attributes to participate in forwarding, but do not make HTTP saves push messages. Verify script events and natural device cycles separately.

2026-10-20: EUI save protocol ​

Backend commit 315bbd5 and frontend commit c0be12a introduce this protocol while the version remains 2.00.091. The version number alone does not establish compatibility; check the target commits or actual protocol behavior before rollout. Only update-device-data changes to eui, locating the device by the current token's organization and EUI. The EUI is trimmed and lowercased. An ID-only request, or a request containing both eui and id, returns 400 and is incompatible.

find-device-data, find-current-attrs and update-config still use id. Maintain an accurate ID/EUI association for the owner device. Do not replace IDs globally or blindly retry with a different identity field after an error.

Save results and error handling ​

These behaviors apply only to update-device-data, not update-config, batch APIs or script actions.

SituationPlatform behavior and caller action
Successful saveAn independent database transaction persists the specified group of the current device without a global buffer flush. The response is the complete committed group snapshot {content}. Refresh by reading back; do not wait for a guaranteed MQTT push.
Transaction failureThe patch is not applied to cache and does not enter automatic retry. Preserve edits, report the error and never show save success.
Notification failure after commitLog the error without reporting the committed save as failed; avoid duplicate submissions.
Concurrent updateUnrelated field updates during the SQL wait are preserved. Real-time changes to the same path take precedence in cache. A later read may differ from the returned snapshot; this does not establish transaction failure or justify overwriting new values with an old snapshot.
Network timeout or disconnectShow an unknown save outcome. Do not assume the transaction was not committed. Read the affected paths using the associated ID before deciding whether to retry. If readback fails, retain the unknown state; do not automatically replay the whole namespace.
Invalid or oversized patchLimits return 400 / Invalid device data patch. Report failure and preserve edits; reduce the patch or fix its structure. Splitting a patch cannot guarantee success when the current group already exceeds its limit.

After success or an unknown outcome, confirm that ID/EUI still identify the same owner device, then read by ID and compare the affected paths. Readback reflects current values, not an audit proof of the original transaction. Reconcile concurrent differences instead of retrying indefinitely. Never overwrite platform settings with an empty configuration after a failed read.

sh
curl -X POST '<BASE_URL>/thinklink/device/find-device-data' \
  -H 'token: <TOKEN>' -H 'Content-Type: application/json' \
  --data '{"id":"<DEVICE_ID>","type":"app_attrs"}'

Patch limits ​

LimitMaximum
Operations per patch (set keys + set_paths entries + remove entries)1,000
Segments per path32
Patch JSON size1 MiB
Current group and resulting group size4 MiB each
JSON nesting depth64
JSON traversal nodes100,000

Frontends and SDKs should provide clear messages; the backend remains the final validator. Limits apply to the aggregate patch and data group, not just individual array lengths. Continue using partial updates: set replaces top-level values, set_paths modifies nested fields and remove deletes fields. Arrays are replaced as a whole; duplicate and ancestor/descendant paths are rejected.

3D migration and compatibility ​

Use app_attrs.__transform_3d. Stop using top-level transform_3d, the old data group and changes.transform_3d. Replace the old modifyTransform3d action with modifyAttrs. The 2.00.082 main-table field and the separate 2.00.083 device_data group are historical storage. Do not carry over the old action's undefined/null deletion and clearing rules.

The platform migration handles legacy platform 3D data and database structure. Each project must inventory and migrate its own JSON, project configuration, browser parameters and user scripts. Verify model rendering, positions and preservation of other components before retiring old readers and writers.

Migration inventory and acceptance ​

For each item record its old storage, business object, target device ID/EUI, field owner, read/write entry points, historical record and attachment counts, migration method, reconciliation result and retirement condition. Unresolved device ownership remains pending.

The tkl-app-helper storage at server_attrs.microapp_* is an unfinished migration. Register original settings, owner devices and target app_attrs paths first. Check projections, readers, writers, actual SDK consumers and adopted versions. Retire old storage only after recovery and partial-save verification; do not simply delete old settings.

  1. Back up values and associations. Resolve conflicting old sources before import so a repeated migration does not overwrite newer data.
  2. Migrate only owned fields in batches, read back and compare values, counts and relations. Reconcile independent logs and attachments separately.
  3. Verify platform readback after reload, sign-in and browser changes. Have two components edit separate fields and confirm both changes and untouched nested fields survive.
  4. Verify 3D rendering, log reads/writes, optional device links, tags and attachments before retiring old stores and entry points.
  5. Verify EUI saves with ID readback, explicit rejection of legacy ID saves and unchanged ID-based APIs. Cover transaction failure, unknown timeout outcomes, concurrent updates and all limit errors; never show failure as save success.
  6. Report source adaptation, database migration, deployment, browser acceptance and MQTT integration separately. Mark unperformed stages explicitly; local tests are not deployment acceptance.

The following selective-read and pagination guidance is retained from 2.00.083; application parameters and 3D ownership follow the 2.00.091 rules above. Confirm deployed frontend/backend and database capabilities before enabling it. Publishing documentation does not upgrade the platform.

Scope and minimal fields ​

Overview screens primarily need alarms, online/offline status and a few business states such as running, occupied or faulted. Establish the current organization, formal location scope or actual device bindings before calling POST /thinklink/device/find-page-by-fields.

json
{
  "current": 1,
  "pageSize": 50,
  "location_code_subtree": "<building-location-code>",
  "fields": ["online"],
  "alarm_detail": false
}

Replace the placeholder with an actual location in the current organization. Every row includes eui, alarm_status and alarm_desc; select other fields as needed. Request id explicitly for later editing, and name or location_code only when needed for labels or grouping.

  • fields selects base fields, calculated online. Attributes and telemetry have separate selectors; do not treat telemetry_data as a physical column in fields.
  • server_attrs, shared_attrs and process_data accept field-name arrays or true for the whole group. Select telemetry by thing-model ID, for example {"<thing-model-id>":["temperature"]}. Omit an unused selector; false and null are not substitutes for omission.
  • Overviews should not request full configuration, attribute groups, all telemetry or alarm_detail:true by default. Load details after a building, space or device is selected.
  • Use the existing list's location_code for the current location; use location_code_subtree for descendants as well. Subtrees use complete path boundaries, not code-prefix matching. Business spaces use their actual device bindings.
  • Ordinary queries retain current-organization and PUBLIC visibility; the subtree branch additionally restricts to the current organization. Enforce the intended scope and never fall back from an empty binding or unknown location to the whole organization.

Complete pagination and failure states ​

The response is {data,total,current,pageSize}. For whole-building or whole-space summaries, fetch all pages according to total, deduplicate by EUI and verify scope coverage. A first page is not a complete summary. Failed pages, stale results or a scope change invalidate completeness.

alarm_status counts each device's current alarms by severity; alarm_desc contains descriptions. Neither is a subtree aggregation endpoint. online uses active_time and twice heart_period, returning false when either is absent; it is not automatically equivalent to a custom _online attribute.

Preserve distinct unrequested, unloaded, failed, stale and missing-field states. Do not replace them with healthy, no alarms, zero or false. Application-attribute projection preserves explicit null and omits only missing keys; follow other groups’ contracts separately. This paginated endpoint reads persisted data, whereas find-device-data reads current cache, so values can temporarily differ after script updates.

Reuse data and cache resources ​

Reuse requests across cards and views for the same organization, scope and selected fields. Include these in cache keys; switching organization or scope must not reuse old summaries. Load names, models, spatial bindings and app_attrs.__transform_3d separately from frequent status refreshes. Merge updates only where a reliable subscription exists; do not assume new fields already have MQTT delivery.

Upload and replace models, textures, images, videos and documents through the File Management API. Check quota, persist file IDs, obtain and renew access-ticket values as needed, and read /v/:ticket. Both the single-file and organization-total limits are 50 MiB. Load resources by scene and reuse them across status refreshes. Invalidate caches using update_time or a resource version after replacement. Anonymous access requires explicitly enabled sharing.

Application acceptance ​

Check actual fields, scope, every page, empty bindings, missing fields and failures. Inspect duplicate requests across cards, expired tickets, sharing disabled, and rendering after replacement. Preserve existing application IDs, configuration, routes, menus and business permissions. Verify the actual hosted page; a local build or successful upload is insufficient.