Device State Changed Event
device.state.changed is sent when device IO state changes.
Topic
text
device.state.changedEvent — Triggered by Remote Control
When triggered by an API command, reason is remoteControl and correlationId is the request requestId that caused the change.
json
{
"type": "event",
"topic": "device.state.changed",
"data": {
"deviceId": "abc123456789",
"occurredAt": "2026-04-03T00:41:44Z",
"reason": "remoteControl",
"correlationId": "req_op_001",
"peripherals": {
"relays": [
{
"index": 1,
"on": true
},
{
"index": 2,
"on": false
},
{
"index": 3,
"on": false
},
{
"index": 4,
"on": false
}
],
"digitalInputs": [
{
"index": 1,
"active": false
},
{
"index": 2,
"active": false
},
{
"index": 3,
"active": false
},
{
"index": 4,
"active": false
}
],
"sensors": [
{
"index": 1,
"type": "TEMP",
"value": 30.4,
"unit": "C",
"status": "ONLINE"
},
{
"index": 2,
"type": "TEMP",
"value": 32.6,
"unit": "C",
"status": "ONLINE"
},
{
"index": 2,
"type": "HUMI",
"value": 54,
"unit": "%",
"status": "ONLINE"
}
]
},
"stateUpdatedAt": "2026-04-03T00:41:44Z"
}
}Event — Triggered on the Device Side
When triggered locally by the device, reason is localChange and correlationId is not included.
json
{
"type": "event",
"topic": "device.state.changed",
"data": {
"deviceId": "abc123456789",
"occurredAt": "2026-04-03T00:41:44Z",
"reason": "localChange",
"peripherals": {
"relays": [
{
"index": 1,
"on": false
},
{
"index": 2,
"on": false
},
{
"index": 3,
"on": false
},
{
"index": 4,
"on": false
}
],
"digitalInputs": [
{
"index": 1,
"active": false
},
{
"index": 2,
"active": false
},
{
"index": 3,
"active": false
},
{
"index": 4,
"active": false
}
],
"sensors": [
{
"index": 1,
"type": "TEMP",
"value": 30.4,
"unit": "C",
"status": "ONLINE"
},
{
"index": 2,
"type": "TEMP",
"value": 32.6,
"unit": "C",
"status": "ONLINE"
},
{
"index": 2,
"type": "HUMI",
"value": 54,
"unit": "%",
"status": "ONLINE"
}
]
},
"stateUpdatedAt": "2026-04-03T00:41:44Z"
}
}data Schema
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | string | Yes | Unique device identifier |
occurredAt | string | Yes | Event time in RFC3339 UTC |
reason | string | No | Reason for the state change. See the table below |
correlationId | string | No | Related request ID. Present only when reason=remoteControl |
peripherals | object | Yes | Complete peripheral state data |
stateUpdatedAt | string | Yes | Device state update time in RFC3339 UTC |
reason Enum
| Value | Trigger Scenario | correlationId |
|---|---|---|
remoteControl | Triggered by an API command (device.operation.execute or a REST relay command) | The corresponding request requestId |
localChange | Triggered on the device side. Due to firmware limitations, the precise local source is unknown; it may be a panel button, a digital input, or another local hardware event | Not present |
Rules
data.peripheralsreuses theperipheralsschema from REST device detail responsesdata.peripheralsis complete peripheral state data, not an incremental diff- Clients should replace the current device hardware state with the full block from the event
- The
reasonfield may be missing. If it is missing, clients should not assume a trigger source
