Downlink Messages
This page documents CBOR-encoded commands sent from the cloud to the ENTRYWAY sensor over the Wirepas mesh network. These messages configure sensor behavior such as measurement intervals, counting direction, 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 new configuration.
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.
People Counting Configuration (tsmId 17220)
Configures people counting parameters: direction.
| JSON Property | CBOR Index | Direction | Description |
|---|---|---|---|
tsmId | 1 | Both | Message ID: 17220 |
tsmEv | 2 | Both | 30 = command, 31 = response |
tsmDstTuid | 7 | Command | Target device identifier |
transactionId | 25 | Both | Links command to response |
peopleCountingOrientation | 540 | Both | 0 = normal, 1 = reversed |
Direction Configuration
The peopleCountingOrientation field controls which PIR sensor detects entry vs. exit:
| Value | Meaning |
|---|---|
0 | Normal — factory default direction |
1 | Reversed — swap in/out assignments |
If counts seem inverted after installation, set peopleCountingOrientation: 1 rather than physically rotating the sensor.
Command Example
Send to sensor — set normal counting direction:
{
"tsmId": 17220,
"tsmEv": 30,
"tsmDstTuid": "XXCN01TSC20205507",
"transactionId": 42,
"peopleCountingOrientation": 0
}
{1: 17220, 2: 30, 7: "XXCN01TSC20205507", 25: 42,
540: 0}
Response Example
Sensor echoes back the applied configuration:
{
"tsmId": 17220,
"tsmEv": 31,
"tsmTs": 1755064700,
"tsmTuid": "XXCN01TSC20205507",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 42,
"peopleCountingOrientation": 0
}
{1: 17220, 2: 31, 3: 1755064700, 4: "XXCN01TSC20205507", 5: "TSGW06EWK31903495",
25: 42, 540: 0}
System Configuration (tsmId 1500)
General system settings such as network channel and transmit power.
| 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 |
networkChannel | — | Both | Wirepas network channel |
txPower | — | Both | Transmit power level |
Command Example
{
"tsmId": 1500,
"tsmEv": 30,
"tsmDstTuid": "XXCN01TSC20205507",
"transactionId": 43,
"networkChannel": 1,
"txPower": 8
}
{1: 1500, 2: 30, 7: "XXCN01TSC20205507", 25: 43}
Response Example
{
"tsmId": 1500,
"tsmEv": 31,
"tsmTs": 1755064800,
"tsmTuid": "XXCN01TSC20205507",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 43,
"networkChannel": 1,
"txPower": 8
}
{1: 1500, 2: 31, 3: 1755064800, 4: "XXCN01TSC20205507", 5: "TSGW06EWK31903495", 25: 43}
Wirepas Node Role (tsmId 1501)
Configures the device’s role in the Wirepas mesh network. Controls whether the device can route traffic for other nodes and its latency requirements.
| 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": "XXCN01TSC20205507",
"transactionId": 44,
"autoRole": 1,
"lowLatency": 0
}
{1: 1501, 2: 30, 7: "XXCN01TSC20205507", 25: 44,
543: 1, 544: 0}
Response Example
{
"tsmId": 1501,
"tsmEv": 31,
"tsmTs": 1755064900,
"tsmTuid": "XXCN01TSC20205507",
"tsmGw": "TSGW06EWK31903495",
"transactionId": 44,
"autoRole": 1,
"lowLatency": 0
}
{1: 1501, 2: 31, 3: 1755064900, 4: "XXCN01TSC20205507", 5: "TSGW06EWK31903495",
25: 44, 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 the applied configuration - Verify — Compare response values against command to confirm settings were applied
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 |
| 540 | peopleCountingOrientation | People counting config |
| 543 | autoRole | Wirepas node role |
| 544 | lowLatency | Wirepas node role |