How controls receive live state — the standardized connection block. The
same vocabulary (filter, valuePath, value semantics) applies no matter the
transport; method picks the wire: meshsocket (a CAR-TER server),
mqtt/http (see Data Sources), or sensor (this device's own hardware).
Definition
"sync": [{
"method": "meshsocket",
"type": "listen",
"event": "broadcast",
"filter": { "msg_type": "telemetry" },
"valuePath": "cpu"
}]
Equivalent bindings on other transports:
{ "method": "mqtt", "topic": "server/telemetry", "valuePath": "cpu" }
{ "method": "http", "path": "/api/status", "interval": 5, "valuePath": "cpu" }
Flow
- A payload arrives (server broadcast, MQTT publish, or HTTP poll response)
- App filters by matching all
filterkeys against the payload - Extracts value at
valuePath(dot-notation) - Updates control binding — identically for every transport
External sources (MQTT / HTTP)
With method: "mqtt" or "http" a sync entry binds an external source directly
— an MQTT broker topic or a polled JSON endpoint — with no MeshSocket server in
the loop. Same filter/valuePath semantics, same special receivers. See
Data Sources for source declaration, payload rules, and full examples.
Local hardware
With method: "sensor" a sync entry binds this device's own hardware instead of
the mesh — { "method": "sensor", "sensor": "heading" } feeds the control the
compass with no server at all. See Sensors for the catalog and
Publishers to stream readings to other devices.
The layout state block (join, snapshots, ack'd commands)
A top-level layout key, not a per-control sync — the app↔server session contract:
"state": { "sync": true, "authority": "MyHub", "acks": true, "ackTimeoutMs": 2000 }
- With
syncon (or any dynamic content in the layout), the app broadcastscontrol_sync_request {from, dynamic:[slot events]}on layout load AND every reconnect. Servers treat it as the join signal (carterkiton_sync_request) and theauthorityanswers with acontrol_snapshotof current values, so a rejoining device renders truth immediately. acks: trueopts every control action into ack'd commands: fired payloads are stamped_cmd(uuid) +_from(sender name); the serving hub answerscommand_ack {cmd_id, to, ok}for commands it actually handled (carterkitenable_command_acks). The control stays optimistically set but pending — sync updates are held off it — until the ack; onok:falseorackTimeoutMs(default 2000) expiry it reverts to the last synced value with an error haptic.control_sync_request/control_snapshot/command_ackand the_cmd/_fromstamps are wire API — never rename them.
Notes
- Multiple syncs per Control Definition allowed — and they may mix transports (e.g. a meshsocket binding plus an Data Sources fallback)
- Filter matches exact key-value pairs
- Sparkline accumulates values in a ring buffer
- Used by Gauge, Label, Map, Graph, and more
- Dynamic-content injections are diffed by control id: an identical re-push
is a no-op, and ids that persist keep their live values — keep injected ids
stable across pushes (see Group Definition
dynamic)