Downlink Commands

Raw CBOR downlink commands for Thingsee PRESENCE — configuration messages sent to the sensor over Wirepas mesh

Overview

This page documents the CBOR-encoded commands sent to Thingsee PRESENCE over the Wirepas mesh network for device configuration.

For the Haltian IoT Platform equivalent (GraphQL Service API), see Configuration Commands.

Command/Response Pattern

All CBOR downlink messages follow the same pattern:

  1. Send command — Set tsmEv: 30, include tsmDstTuid (target device) and transactionId
  2. Receive response — Sensor replies with tsmEv: 31, same transactionId, all fields populated with current values
  3. Verify — Compare response values against command to confirm settings applied
  4. Query only — Send with only header fields (no config parameters) to read current configuration

Wirepas endpoint: 21/21


PIR Sensor Configuration (tsmId 13200)

Controls detection sensitivity, reporting mode, and LED behavior.

JSON PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 13200
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
threshold263BothPIR detection sensitivity (80–1060)
enableLed264BothLED on detection: 0 = off, 1 = on
mode37BothReporting mode: 1 = Occupancy, 2 = Visitor counter
passiveReportIntervalBothIdle reporting interval in seconds

Command:

{
  "tsmId": 13200,
  "tsmEv": 30,
  "tsmDstTuid": "TSPR04TSC20205001",
  "transactionId": 42,
  "threshold": 150,
  "enableLed": 0,
  "mode": 1,
  "passiveReportInterval": 3600
}
{1: 13200, 2: 30, 7: "TSPR04TSC20205001", 25: 42,
 263: 150, 264: 0, 37: 1}

Response:

{
  "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:

{
  "tsmId": 13200,
  "tsmEv": 30,
  "tsmDstTuid": "TSPR04TSC20205001",
  "transactionId": 43
}

Occupancy Light Configuration (tsmId 13210)

JSON PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 13210
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
mode37Both0 = Normal, 1 = Force single light, 2 = Outside installation
index112BothLight: 0 = Red, 1 = Green, 2 = Blue
staticFilter285BothDigital filter: 0 = off, 1 = on
threshold263BothHot-region detection threshold
duration191BothAuto-reset time in seconds (0 = disabled)

Command:

{
  "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:

{
  "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)

JSON PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 13211
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
index112BothLight: 0 = Red, 1 = Green, 2 = Blue
max36BothMaximum brightness percentage (0–100)

Command — set green LED to 50%:

{
  "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:

{
  "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)

JSON PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 1500
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
measurementInterval256BothSeconds between measurements
reportInterval258BothSeconds between reports (default: 60)

Command:

{
  "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:

{
  "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 PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 1501
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
autoRole543Both0 = fixed role, 1 = auto (default)
lowLatency544Both0 = normal (default), 1 = low latency

Command:

{
  "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:

{
  "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}

CBOR Index Reference

CBOR IndexJSON PropertyCategory
1tsmIdHeader
2tsmEvHeader
3tsmTsHeader (response only)
4tsmTuidHeader (response only)
5tsmGwHeader (response only)
7tsmDstTuidAddressing (command only)
25transactionIdCommand tracking
36maxLED brightness
37modeReporting / light mode
112indexLight selection
191durationAuto-reset timer
256measurementIntervalSystem intervals
258reportIntervalSystem intervals
263thresholdPIR sensitivity / detection threshold
264enableLedLED indicator
285staticFilterDigital filter
543autoRoleWirepas node role
544lowLatencyWirepas node role