DataView JSON Format
A DataView is a single JSON object stored as a .json file in /dvs/ on the device (or embedded inline in allocdata). This page documents the complete JSON structure.
Top-level structure
Section titled “Top-level structure”{ "displayName": "My Application", "displayIcon": "my_app_icon", "target_size": { "w": 176, "h": 264, }, "infopages": [ { "id": "1", "infowidgets": [], }, ], "dicts": [ { "lang": "en", "description": "English", "dict": { "key": "value", }, }, ],}Top-level attributes
Section titled “Top-level attributes”| Attribute | Type | Required | Description |
|---|---|---|---|
displayName |
string | yes | User-visible name shown on the home screen and in the system bar |
displayIcon |
string | no | Preloaded icon name or base64 PBM data used as the app icon on the home screen |
target_size |
object | no | The screen size this DataView was designed for. Contains "w" and "h" in pixels. Default: { "w": 176, "h": 264 } |
infopages |
array | yes | Array of 0–N InfoPage objects (see InfoPage) |
dicts |
array | no | Array of language dictionaries for multi-language support (see Multi-language) |
Naming rules
Section titled “Naming rules”allocdata integration
Section titled “allocdata integration”DataViews are referenced from allocdata.json (or unallocdata.json) under the data.user.apps section:
{ "data": { "global": { "dev": { "<device-name>": { "<config-attributes>" } } }, "network": { "networks": { "<name>": { "<network-config>" } }, "networkOrder": [ "<name>" ] }, "user": { "visitor": "<optional-user-name>", "apps": { "<dv-source-ref>": { "id": "<dv-name-when-loaded>", "src": "local | inline | remote", "data": { "<widget-name>": "<initial-value>" } } } }, "apps": { "<dv-name>": { /* DataView JSON goes here if src:inline */ } }, "dicts": [ "config/names.json", "config/locations.json" ] }}Source types
Section titled “Source types”src value |
Meaning |
|---|---|
"local" |
Load DataView from /dvs/<dv-source-ref>.json on the device flash |
"inline" |
DataView JSON is embedded in the data.apps section of allocdata |
"remote" |
DataView is fetched from a remote URL (advanced use) |
Pre-initializing widget values
Section titled “Pre-initializing widget values”The data object inside each app entry allows you to set the initial values for named widgets at allocation time, before any MQTT downlink messages are sent:
{ "apps": { "duresshome": { "src": "local", "data": { "user_name": "Jane Smith", "user_id": "EMP-4421", "department": "A&E", }, }, },}These values are loaded once when the device enters the allocated state.
Complete annotated example
Section titled “Complete annotated example”{ "displayName": "Patient Tracker", "displayIcon": "hospital_icon", "target_size": { "w": 176, "h": 264, }, "infopages": [ { "id": "1", "infowidgets": [ { "name": "patient_name", "interaction": "dynamic", "region": { "x": 0, "y": 0, "w": 176, "h": 40, }, "format": "text", "formatter": { "name": "string", "font": { "weight": "Bold", "sz": 14, }, "halign": "center", "autobreak": true, }, "value": "Loading...", }, { "name": "ward_label", "interaction": "static", "region": { "x": 0, "y": 45, "w": 80, "h": 20, }, "format": "text", "formatter": { "name": "string", "sz": 10, }, "value": "Ward:", }, { "name": "ward_value", "interaction": "dynamic", "region": { "x": 80, "y": 45, "w": 96, "h": 20, }, "format": "text", "formatter": { "name": "string", "sz": 10, }, "value": "", }, { "name": "alert_btn", "interaction": "button", "region": { "x": 20, "y": 200, "w": 136, "h": 40, }, "format": "text", "formatter": { "name": "string", "halign": "center", "outline": "solid_rounded", "outline_sz": 2, }, "value": "Send Alert", "actions": [ { "a": "updateRemote", "p": "app.tracker.alert_btn:pressed", }, { "a": "beep", "p": "AT1", }, ], }, ], }, ], "dicts": [ { "lang": "en", "description": "English", "dict": { "tracker-ward": "Ward:", }, }, { "lang": "fr", "description": "Fran\u00e7ais", "dict": { "tracker-ward": "Service:", }, }, ],}Related
Section titled “Related”- InfoPage — page structure and ID rules
- InfoWidget — all widget attributes
- Text Formatters —
format:"text"reference - Graphic Formatters —
format:"graphic"reference - Multi-language — dictionary system
- Runtime Updates via MQTT — updating widgets after allocation