Downlink Messages
This page documents CBOR-encoded commands sent from the cloud to the PRESENCE sensor over the Wirepas mesh network. These messages configure sensor behavior such as detection sensitivity, reporting mode, and LED indicators.
Overview
This page documents the Wirepas CBOR commands sent to the sensor over the mesh network. These are the raw on-wire messages — field names and structure differ from the Haltian IoT JSON API exposed to end users.
Downlink messages use the command/response pattern: the cloud sends a command (tsmEv: 30) and the sensor replies with a response (tsmEv: 31) echoing the current configuration with all fields populated.
All messages are CBOR-encoded and sent over Wirepas endpoint 21/21. Each example below shows both the JSON (decoded CBOR) and CBOR (numeric indexes as transmitted on the wire) formats.
For messages the sensor transmits to the cloud, see Uplink Messages. For configuration workflows, see Configuration.
PIR Sensor Configuration (tsmId 13200)
The primary configuration message. Controls detection sensitivity, reporting mode, and LED behavior.
| JSON Property | CBOR Index | Direction | Description |
|---|---|---|---|
tsmId | 1 | Both | Message ID: 13200 |
tsmEv | 2 | Both | 30 = command, 31 = response |
tsmDstTuid | 7 | Command | Target device identifier |
transactionId | 25 | Both | Links command to response |
threshold | 263 | Both | PIR detection sensitivity (60–1100) |
enableLed | 264 | Both | LED on detection: 0 = off, 1 = on |
mode | 37 | Both | Reporting mode (see below) |
Reporting Modes
| Value | Name | Uplink Message | Description |
|---|---|---|---|
0 | Movement count | tsmId 13100 | Count movements at each report interval |
1 | Occupancy | tsmId 2100 | Binary occupied/unoccupied state changes only |
2 | Event-based | tsmId 13100 | Report only when movement is detected |
In mode 2, the sensor only transmits when movement is detected. A passiveReportInterval heartbeat is sent when no movement occurs, confirming the sensor is still alive.
Sensitivity
The threshold parameter controls PIR detection sensitivity:
| Value | Effect |
|---|---|
60 | Maximum sensitivity — detects subtle movement |
150 | Default — balanced detection |
1100 | Minimum sensitivity — only detects large movement |
Lower values increase sensitivity but may increase false positives in busy environments. Higher values reduce false triggers but may miss subtle movements.
Command Example
Send to sensor — set occupancy mode with default sensitivity:
{
"tsmId": 13200,
"tsmEv": 30,
"tsmDstTuid": "TSPR04TSC20205001",
"transactionId": 42,
"threshold": 150,
"enableLed": 0,
"mode": 1
}
{1: 13200, 2: 30, 7: "TSPR04TSC20205001", 25: 42,
263: 150, 264: 0, 37: 1}
Response Example
Sensor echoes back all configuration fields with current values:
{
"tsmId": 13200,
"tsmEv": 31,
"tsmTs": 1755064700,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 42,
"threshold": 150,
"enableLed": 0,
"mode": 1,
"passiveReportInterval": 3600
}
{1: 13200, 2: 31, 3: 1755064700, 4: "TSPR04TSC20205001", 5: "TSGW06EWK31903495",
25: 42, 263: 150, 264: 0, 37: 1}
Query Current Configuration
Send with only header fields to read current settings without changing anything:
{
"tsmId": 13200,
"tsmEv": 30,
"tsmDstTuid": "TSPR04TSC20205001",
"transactionId": 43
}
{1: 13200, 2: 30, 7: "TSPR04TSC20205001", 25: 43}
Occupancy Light Configuration (tsmId 13210)
Configure PRESENCE variants with integrated LED indicators. Controls detection parameters for the visual occupancy display.
This configuration applies only to Thingsee PRESENCE variants with integrated lights. Standard TSPR04 models do not have lights and will not respond to this configuration.
| JSON Property | CBOR Index | Direction | Description |
|---|---|---|---|
tsmId | 1 | Both | Message ID: 13210 |
tsmEv | 2 | Both | 30 = command, 31 = response |
tsmDstTuid | 7 | Command | Target device identifier |
transactionId | 25 | Both | Links command to response |
mode | 37 | Both | Light mode (see below) |
index | 112 | Both | Light to enable in forced mode |
staticFilter | 285 | Both | Digital filter: 0 = off, 1 = on |
threshold | 263 | Both | Hot-region detection threshold |
duration | 191 | Both | Auto-reset time in seconds (0 = disabled) |
Light Modes
| Value | Name | Description |
|---|---|---|
0 | Normal | Automatic occupancy-based LED control |
1 | Force single light | Force a specific LED on (set index) |
2 | Outside installation | Disable occupancy detection, maintenance mode |
Light Index
| Value | Color |
|---|---|
0 | Red (occupied) |
1 | Green (available) |
2 | Blue |
Command Example
{
"tsmId": 13210,
"tsmEv": 30,
"tsmDstTuid": "TSPR04TSC20205001",
"transactionId": 44,
"mode": 0,
"staticFilter": 1,
"threshold": 30,
"duration": 0
}
{1: 13210, 2: 30, 7: "TSPR04TSC20205001", 25: 44,
37: 0, 285: 1, 263: 30, 191: 0}
Response Example
{
"tsmId": 13210,
"tsmEv": 31,
"tsmTs": 1755064800,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 44,
"mode": 0,
"index": 0,
"staticFilter": 1,
"threshold": 30,
"duration": 0
}
{1: 13210, 2: 31, 3: 1755064800, 4: "TSPR04TSC20205001", 5: "TSGW06EWK31903495",
25: 44, 37: 0, 112: 0, 285: 1, 263: 30, 191: 0}
Occupancy Light Brightness (tsmId 13211)
Configure individual LED brightness for PRESENCE variants with integrated lights.
| JSON Property | CBOR Index | Direction | Description |
|---|---|---|---|
tsmId | 1 | Both | Message ID: 13211 |
tsmEv | 2 | Both | 30 = command, 31 = response |
tsmDstTuid | 7 | Command | Target device identifier |
transactionId | 25 | Both | Links command to response |
index | 112 | Both | Light to configure (0=Red, 1=Green, 2=Blue) |
max | 36 | Both | Maximum brightness percentage (0–100) |
Command Example
Set green LED to 50% brightness:
{
"tsmId": 13211,
"tsmEv": 30,
"tsmDstTuid": "TSPR04TSC20205001",
"transactionId": 45,
"index": 1,
"max": 50
}
{1: 13211, 2: 30, 7: "TSPR04TSC20205001", 25: 45,
112: 1, 36: 50}
Response Example
{
"tsmId": 13211,
"tsmEv": 31,
"tsmTs": 1755064900,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 45,
"index": 1,
"max": 50
}
{1: 13211, 2: 31, 3: 1755064900, 4: "TSPR04TSC20205001", 5: "TSGW06EWK31903495",
25: 45, 112: 1, 36: 50}
System Interval Configuration (tsmId 1500)
Configure measurement and reporting intervals. Used by all Thingsee sensors.
| JSON Property | CBOR Index | Direction | Description |
|---|---|---|---|
tsmId | 1 | Both | Message ID: 1500 |
tsmEv | 2 | Both | 30 = command, 31 = response |
tsmDstTuid | 7 | Command | Target device identifier |
transactionId | 25 | Both | Links command to response |
measurementInterval | 256 | Both | Seconds between measurements |
reportInterval | 258 | Both | Seconds between reports (default: 60) |
Command Example
{
"tsmId": 1500,
"tsmEv": 30,
"tsmDstTuid": "TSPR04TSC20205001",
"transactionId": 46,
"measurementInterval": 10,
"reportInterval": 60
}
{1: 1500, 2: 30, 7: "TSPR04TSC20205001", 25: 46,
256: 10, 258: 60}
Response Example
{
"tsmId": 1500,
"tsmEv": 31,
"tsmTs": 1755065000,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 46,
"measurementInterval": 10,
"reportInterval": 60
}
{1: 1500, 2: 31, 3: 1755065000, 4: "TSPR04TSC20205001", 5: "TSGW06EWK31903495",
25: 46, 256: 10, 258: 60}
Wirepas Node Role (tsmId 1501)
Configures the device’s role in the Wirepas mesh network.
| JSON Property | CBOR Index | Direction | Description |
|---|---|---|---|
tsmId | 1 | Both | Message ID: 1501 |
tsmEv | 2 | Both | 30 = command, 31 = response |
tsmDstTuid | 7 | Command | Target device identifier |
transactionId | 25 | Both | Links command to response |
autoRole | 543 | Both | Automatic role selection: 0 = fixed, 1 = auto |
lowLatency | 544 | Both | Low-latency mode: 0 = normal, 1 = low latency |
Node Role Options
| autoRole | lowLatency | Behavior |
|---|---|---|
1 | 0 | Default — network assigns optimal role |
0 | 0 | Fixed role, standard latency |
0 | 1 | Fixed role, low latency (higher battery usage) |
1 | 1 | Auto role with low latency preference |
Command Example
{
"tsmId": 1501,
"tsmEv": 30,
"tsmDstTuid": "TSPR04TSC20205001",
"transactionId": 47,
"autoRole": 1,
"lowLatency": 0
}
{1: 1501, 2: 30, 7: "TSPR04TSC20205001", 25: 47,
543: 1, 544: 0}
Response Example
{
"tsmId": 1501,
"tsmEv": 31,
"tsmTs": 1755065100,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 47,
"autoRole": 1,
"lowLatency": 0
}
{1: 1501, 2: 31, 3: 1755065100, 4: "TSPR04TSC20205001", 5: "TSGW06EWK31903495",
25: 47, 543: 1, 544: 0}
Command/Response Pattern
All downlink messages follow the same pattern:
- Send command — Set
tsmEv: 30, includetsmDstTuid(target device) andtransactionId(any integer) - Receive response — Sensor replies with
tsmEv: 31, sametransactionId, echoing all configuration fields with current values - Verify — Compare response values against command to confirm settings were applied
- Query only — Send with only header fields (no config parameters) to read current configuration
Use transactionId to correlate commands with responses, especially when configuring multiple devices simultaneously. Any integer value works — increment per command for easy tracking.
CBOR Index Reference (Downlink)
| CBOR Index | JSON Property | Category |
|---|---|---|
| 1 | tsmId | Header |
| 2 | tsmEv | Header |
| 3 | tsmTs | Header (response only) |
| 4 | tsmTuid | Header (response only) |
| 5 | tsmGw | Header (response only) |
| 7 | tsmDstTuid | Addressing (command only) |
| 25 | transactionId | Command tracking |
| 36 | max | LED brightness |
| 37 | mode | Reporting / light mode |
| 112 | index | Light selection |
| 191 | duration | Auto-reset timer |
| 256 | measurementInterval | System intervals |
| 258 | reportInterval | System intervals |
| 263 | threshold | PIR sensitivity / detection threshold |
| 264 | enableLed | LED indicator |
| 285 | staticFilter | Digital filter |
| 543 | autoRole | Wirepas node role |
| 544 | lowLatency | Wirepas node role |