Downlink Messages

Configuration commands sent to Thingsee PRESENCE — PIR sensitivity, occupancy mode, LED control, and network roles

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 PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 13200
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
threshold263BothPIR detection sensitivity (60–1100)
enableLed264BothLED on detection: 0 = off, 1 = on
mode37BothReporting mode (see below)

Reporting Modes

ValueNameUplink MessageDescription
0Movement counttsmId 13100Count movements at each report interval
1OccupancytsmId 2100Binary occupied/unoccupied state changes only
2Event-basedtsmId 13100Report only when movement is detected

Sensitivity

The threshold parameter controls PIR detection sensitivity:

ValueEffect
60Maximum sensitivity — detects subtle movement
150Default — balanced detection
1100Minimum 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.

JSON PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 13210
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
mode37BothLight mode (see below)
index112BothLight to enable in forced mode
staticFilter285BothDigital filter: 0 = off, 1 = on
threshold263BothHot-region detection threshold
duration191BothAuto-reset time in seconds (0 = disabled)

Light Modes

ValueNameDescription
0NormalAutomatic occupancy-based LED control
1Force single lightForce a specific LED on (set index)
2Outside installationDisable occupancy detection, maintenance mode

Light Index

ValueColor
0Red (occupied)
1Green (available)
2Blue

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 PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 13211
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
index112BothLight to configure (0=Red, 1=Green, 2=Blue)
max36BothMaximum 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 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 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 PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 1501
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
autoRole543BothAutomatic role selection: 0 = fixed, 1 = auto
lowLatency544BothLow-latency mode: 0 = normal, 1 = low latency

Node Role Options

autoRolelowLatencyBehavior
10Default — network assigns optimal role
00Fixed role, standard latency
01Fixed role, low latency (higher battery usage)
11Auto 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:

  1. Send command — Set tsmEv: 30, include tsmDstTuid (target device) and transactionId (any integer)
  2. Receive response — Sensor replies with tsmEv: 31, same transactionId, echoing all configuration fields with current values
  3. Verify — Compare response values against command to confirm settings were applied
  4. Query only — Send with only header fields (no config parameters) to read current configuration
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