MatterDeviceReport a sensor reading and detect alarm transitions

Report a sensor reading and detect alarm transitions

Edge-detects an alarm transition for a single sensor channel and emits AlarmTriggered / AlarmCleared (or NO_EVENT when unchanged).

curl -X POST "https://api.spkey.co/matter-devices/example_string/ReportSensorState" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "channel": "boolean_state",
  "matterPath": "example_string",
  "value": 3.14,
  "deviceTypeId": 123,
  "endpoint": 42,
  "deviceTypeSource": "shadow",
  "timestamp": "example_string"
}'
{
  "success": true,
  "aggregateId": "example_string",
  "version": 3.14,
  "event": {
    "type": "AlarmTriggered",
    "data": {
      "deviceId": "example_string",
      "channel": "boolean_state",
      "alarmType": "contact",
      "severity": "warning",
      "matterPath": "example_string",
      "deviceTypeId": 123,
      "endpoint": 42,
      "deviceTypeSource": "shadow",
      "rawValue": 3.14,
      "timestamp": "example_string"
    }
  }
}
POST
/matter-devices/{id}/ReportSensorState
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (JWT)
Bearer Tokenstring
Required

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.
API Key (header: X-API-Key)
X-API-Keystring
Required

API key for B2B organization access. Provided during organization onboarding.

API key for B2B organization access. Provided during organization onboarding.
path
idstring
Required

Matter Device ID

Content-Typestring
Required

The media type of the request body

Options: application/json
channelstring
Required

Which sensor channel this reading is for

Options: boolean_state, smoke, smoke_interconnect, co, occupancy, device_fault
matterPathstring
Required

Full Matter endpoint/cluster/attribute path, e.g. "1/69/0" or "2/92/0"

Pattern: ^\d+\/\d+\/\d+$
valuenumber
Required

Reported value (0/1 boolean state, 0-8 ExpressedState, 0/1/2 AlarmStateEnum, occupancy bitmap)

deviceTypeIdinteger

Matter device type id (29/0) — required to interpret boolean_state

endpointinteger

Matter endpoint the attribute was found on (sensors are not always on 1)

deviceTypeSourcestring

Provenance of deviceTypeId — shadow / sticky D1 projection / caller

Options: shadow, sticky, command, shadow_borrowed, shadow_disputed
timestampstring

ISO timestamp of the reading

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (JWT). JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

header
X-API-Keystring
Required

API Key for authentication. API key for B2B organization access. Provided during organization onboarding.

Path Parameters

idstring
Required

Matter Device ID

Body

application/json
channelstring
Required

Which sensor channel this reading is for

Allowed values:boolean_statesmokesmoke_interconnectcooccupancydevice_fault
matterPathstring
Required

Full Matter endpoint/cluster/attribute path, e.g. "1/69/0" or "2/92/0"

valuenumber
Required

Reported value (0/1 boolean state, 0-8 ExpressedState, 0/1/2 AlarmStateEnum, occupancy bitmap)

deviceTypeIdinteger

Matter device type id (29/0) — required to interpret boolean_state

endpointinteger

Matter endpoint the attribute was found on (sensors are not always on 1)

deviceTypeSourcestring

Provenance of deviceTypeId — shadow / sticky D1 projection / caller

Allowed values:shadowstickycommandshadow_borrowedshadow_disputed
timestampstring

ISO timestamp of the reading

Responses

successboolean
Required
aggregateIdstring
Required
versionnumber
Required
eventstring
Required

Emitted transition event, or null when the reading caused no transition