Device State
Device state is the last known payload reported by a device. IOTMER stores and makes this queryable without requiring you to run your own state store.
How state works
When a device publishes to its designated state topic, IOTMER captures and stores the payload. The state is updated with each publish — only the latest value is kept.
View device state
Go to device detail → State tab.
The panel shows:
- Last state payload (JSON rendered inline)
- Timestamp of the last update
Query state via API
GET /workspaces/{id}/devices/{device_id}/state
Authorization: Bearer <token>
Response:
{
"payload": { "temp": 22.5, "humidity": 60 },
"updated_at": "2024-03-15T10:32:00Z"
}
Update state via API
You can also write device state from your backend (useful for digital twin patterns):
PUT /workspaces/{id}/devices/{device_id}/state
Content-Type: application/json
{
"payload": { "status": "offline", "reason": "maintenance" }
}