Downlink Messages

Configuration commands sent to Haltian ENTRYWAY — people counting settings, system config, 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 PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 17220
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
peopleCountingOrientation540Both0 = normal, 1 = reversed

Direction Configuration

The peopleCountingOrientation field controls which PIR sensor detects entry vs. exit:

ValueMeaning
0Normal — factory default direction
1Reversed — 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 PropertyCBOR IndexDirectionDescription
tsmId1BothMessage ID: 1500
tsmEv2Both30 = command, 31 = response
tsmDstTuid7CommandTarget device identifier
transactionId25BothLinks command to response
networkChannelBothWirepas network channel
txPowerBothTransmit 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 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": "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:

  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 the applied configuration
  3. Verify — Compare response values against command to confirm settings were applied
CBOR IndexJSON PropertyCategory
1tsmIdHeader
2tsmEvHeader
3tsmTsHeader (response only)
4tsmTuidHeader (response only)
5tsmGwHeader (response only)
7tsmDstTuidAddressing (command only)
25transactionIdCommand tracking
540peopleCountingOrientationPeople counting config
543autoRoleWirepas node role
544lowLatencyWirepas node role