Skip to content

System Overview — MQTT & Device Views

The CC2 device is controlled by MQTT commands (downlink) and reports state via MQTT data (uplink). What the wearer sees on the screen is defined by Device Views (DVs) — JSON files stored in /dvs/.

These three layers are connected by shared key paths and widget names.


duress_app/ Backend
▼ MQTT downlink
┌──────────────────────────────────────────┐
│ {"app":{"duress":{"data":{"alerts":[ │
│ {"id":"1","subj":"Nurse A", │
│ "location":"ICU","resp":0} │
│ ]}}}} │
└──────────────────────────────────────────┘
▼ Device receives MQTT
┌──────────────────────────────────────────┐
│ duress DV → alerts msglist │
│ Widgets updated: subj, location, resp │
│ DED skeleton shows alert detail │
└──────────────────────────────────────────┘

Key paths that link MQTT to DVs:

MQTT keyDV widget bound to itUsed in
app.duress.data.alertsalerts msglistduress
devcfg.ui.langdevcfg.ui.lang (editable)syscfg
devcfg.ui.enable_lockdevcfg.ui.enable_lock (bool)syscfg
devcfg.alert.showFlashdevcfg.alert.showFlash (bool)duress (page 2)
devdata.power.gaugedevdata.power.gauge (dynamic)sysinfo, allocated_home
devdata.fw.device_iddevdata.fw.device_id (dynamic)sysinfo, allocated_home, duresstest

Wearer taps "Acknowledge" button on alert
▼ DV action fires
┌──────────────────────────────────────────┐
│ {"a":"updateRemote","p":"yes"} │
└──────────────────────────────────────────┘
▼ Device sends MQTT uplink
┌──────────────────────────────────────────┐
│ {"app":{"duress":{"alerts":{ │
│ "id":"1","ackyes":"yes" │
│ }}}} │
└──────────────────────────────────────────┘
▼ duress_app/ Backend receives it

SourceWidgetUsed for
Device config (allocdata)user_name, user_roleWearer sees their own name on duresshome, badge_lock
Portal (MQTT app.duress)subj, locationRecipient sees the alert sender’s name on duress

They are completely independent. Changing the device’s user_name does not change the notification name the duress_appsends. The portal uses its own associatedUser field.