Uplink Messages
This page is primarily for customers who operate their own gateways and cloud infrastructure. It documents every message the PRESENCE sensor transmits over the Wirepas mesh network, shown in both JSON and CBOR format.
Overview
This page documents the Wirepas CBOR messages transmitted by 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. For the Haltian IoT API format, see Operation — Data Transmission.
Thingsee PRESENCE transmits CBOR-encoded messages over Wirepas endpoint 21/21. The gateway adds header fields (tsmTs, tsmGw) and forwards messages to the cloud.
Each message is identified by tsmId (message structure ID). Each example below is shown in both JSON (decoded CBOR) and CBOR (numeric indexes as transmitted on the wire).
For CBOR encoding/decoding details, see CBOR-JSON Conversion Reference. For configuration commands sent to the sensor, see Downlink Messages.
Wirepas endpoint: 21/21
MQTT topic: haltian-iot/wirepas/gw-event/received_data/{gateway-id}/sink1/{network-id}/21/21
Movement Count (tsmId 13100)
The primary application message in movement count mode (mode: 0). Reports the number of PIR detections since the last report.
| JSON Property | CBOR Index | Description |
|---|---|---|
tsmId | 1 | Message ID: 13100 |
tsmEv | 2 | Event type: 10 (timed), 11 (startup) |
tsmTs | 3 | UTC timestamp in seconds (added by gateway) |
tsmTuid | 4 | Device unique identifier |
tsmGw | 5 | Gateway identifier (added by gateway) |
moveCount | 44 | Number of movements detected since last report |
Reporting Behavior
| Condition | Timing |
|---|---|
| Normal operation | Every report interval (default 60s) |
| Device startup | Immediate report with tsmEv: 11 |
| No movement | Report with moveCount: 0 at report interval |
Example
{
"tsmId": 13100,
"tsmEv": 10,
"tsmTs": 1755064655,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"moveCount": 7
}
{1: 13100, 2: 10, 44: 7}
Interpretation: Device TSPR04TSC20205001 detected 7 movements since the last report. The value resets to 0 after each report.
Occupancy State (tsmId 2100)
Sent in occupancy mode (mode: 1). Reports binary occupied/unoccupied state changes — only sent when the state transitions.
| JSON Property | CBOR Index | Description |
|---|---|---|
tsmId | 1 | Message ID: 2100 |
tsmEv | 2 | Event type: 7 (state change), 10 (timed) |
tsmTs | 3 | UTC timestamp in seconds (added by gateway) |
tsmTuid | 4 | Device unique identifier |
tsmGw | 5 | Gateway identifier (added by gateway) |
state | 38 | Occupancy state |
State Values
| Value | Meaning |
|---|---|
0 | Area is not occupied |
1 | Area is occupied |
Reporting Behavior
| Condition | Timing |
|---|---|
| State change | Immediate report with tsmEv: 7 |
| No change | Periodic heartbeat at report interval with tsmEv: 10 |
In occupancy mode, the sensor only sends messages on state transitions and periodic heartbeats. This reduces network traffic compared to movement count mode.
Example
{
"tsmId": 2100,
"tsmEv": 7,
"tsmTs": 1755064700,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"state": 1
}
{1: 2100, 2: 7, 38: 1}
Interpretation: Device TSPR04TSC20205001 reports the area has become occupied.
Occupancy Count (tsmId 13102)
Reports cumulative occupancy event count — how many times the area has transitioned to occupied since the last report.
| JSON Property | CBOR Index | Description |
|---|---|---|
tsmId | 1 | Message ID: 13102 |
tsmEv | 2 | Event type: 10 (timed) |
tsmTs | 3 | UTC timestamp in seconds (added by gateway) |
tsmTuid | 4 | Device unique identifier |
tsmGw | 5 | Gateway identifier (added by gateway) |
count | 113 | Number of occupancy events since last report |
duration | 191 | Total occupied time in seconds (optional) |
Example
{
"tsmId": 13102,
"tsmEv": 10,
"tsmTs": 1755068200,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"count": 12,
"duration": 1800
}
{1: 13102, 2: 10, 113: 12, 191: 1800}
Interpretation: The area was occupied 12 times for a total of 1800 seconds (30 minutes) since the last report.
System Info (tsmId 1100)
Sent once on device boot-up. Contains firmware version and device model.
| JSON Property | CBOR Index | Description |
|---|---|---|
tsmId | 1 | Message ID: 1100 |
tsmEv | 2 | Event type: 11 (startup) |
swVersion | 70 | Firmware version string |
modelCode | 71 | Device model code (e.g., TSPR04) |
psn | — | Production serial number |
Example
{
"tsmId": 1100,
"tsmEv": 11,
"tsmTs": 1755060000,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"swVersion": "3.2.1",
"modelCode": "TSPR04",
"psn": "TSC20205001"
}
{1: 1100, 2: 11, 70: "3.2.1", 71: "TSPR04"}
Battery Level (tsmId 1110)
Reported every 6 hours (21600 seconds). Monitors remaining battery capacity.
| JSON Property | CBOR Index | Multiplier | Description |
|---|---|---|---|
tsmId | 1 | — | Message ID: 1110 |
tsmEv | 2 | — | Event type: 10 (timed) |
batl | 21 | 10^1 | Battery level percentage |
batl uses multiplier 10^1 — CBOR value 920 decodes to 92.0% in JSON. Divide the raw CBOR value by 10 when decoding.
Example
{
"tsmId": 1110,
"tsmEv": 10,
"tsmTs": 1755081600,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"batl": 92
}
{1: 1110, 2: 10, 21: 920}
Orientation Info (tsmId 1111)
Reports device orientation as 3-axis acceleration values. Useful for verifying correct mounting.
| JSON Property | CBOR Index | Description |
|---|---|---|
tsmId | 1 | Message ID: 1111 |
tsmEv | 2 | Event type: 10 (timed), 11 (startup) |
accx | 40 | X-axis acceleration |
accy | 41 | Y-axis acceleration |
accz | 42 | Z-axis acceleration |
Example
{
"tsmId": 1111,
"tsmEv": 10,
"tsmTs": 1755068000,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"accx": 12,
"accy": -45,
"accz": 980
}
{1: 1111, 2: 10, 40: 12, 41: -45, 42: 980}
Interpretation: Device is mounted approximately level (Z-axis near 1000 = gravity pointing down through the sensor).
Network Diagnostics (tsmId 1202)
Reported every 12 hours (43200 seconds). Provides mesh network connectivity metrics.
| JSON Property | CBOR Index | Description |
|---|---|---|
tsmId | 1 | Message ID: 1202 |
tsmEv | 2 | Event type: 10 (timed) |
tuid | 62 | Device identifier |
rssi | 61 | Received signal strength |
rssiDbm | 65 | Signal strength in dBm |
Example
{
"tsmId": 1202,
"tsmEv": 10,
"tsmTs": 1755103200,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"tuid": "TSPR04TSC20205001",
"rssi": -62,
"rssiDbm": -62
}
{1: 1202, 2: 10, 62: "TSPR04TSC20205001", 61: -62, 65: -62}
Firmware Binary Info (tsmId 1312)
Sent once on boot alongside System Info. Reports firmware binary details.
Example
{
"tsmId": 1312,
"tsmEv": 11,
"tsmTs": 1755060000,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"binaryType": 1,
"binaryVersion": "3.2.1"
}
{1: 1312, 2: 11}
Error Event (tsmId 1403)
Sent when an error condition occurs. Use errorType and errorCause to diagnose issues.
Example
{
"tsmId": 1403,
"tsmEv": 29,
"tsmTs": 1755064700,
"tsmTuid": "TSPR04TSC20205001",
"tsmGw": "TSGW06EWK31903495",
"errorType": 1,
"errorCause": 3
}
{1: 1403, 2: 29}
Event Types Reference
All tsmEv values used by PRESENCE uplink messages:
| tsmEv | Name | Description |
|---|---|---|
| 7 | State change | Occupancy state transition (used by tsmId 2100) |
| 10 | Timed | Periodic report at configured interval |
| 11 | Startup | Device boot-up / power-on |
| 29 | Error | Critical error report |
| 34 | Timed diagnostics | Periodic diagnostic event |
CBOR Index Reference (Uplink)
| CBOR Index | JSON Property | Category |
|---|---|---|
| 1 | tsmId | Header |
| 2 | tsmEv | Header |
| 3 | tsmTs | Header |
| 4 | tsmTuid | Header |
| 5 | tsmGw | Header |
| 21 | batl | System (multiplier 10^1) |
| 38 | state | Occupancy |
| 40 | accx | Orientation |
| 41 | accy | Orientation |
| 42 | accz | Orientation |
| 44 | moveCount | Movement detection |
| 61 | rssi | Network |
| 62 | tuid | Network |
| 65 | rssiDbm | Network |
| 70 | swVersion | System |
| 71 | modelCode | System |
| 113 | count | Occupancy count |
| 191 | duration | Occupancy duration |