OpenClaw IoT Event Schema: Design Your Device Gateway
Once you accept that OpenClaw is event-driven, not device-driven, the next step is a consistent event schema. Here's a practical pattern for any device or platform.
Canonical Event Shape
A simple schema that works across Apple Watch, ESP32, Home Assistant, and MQTT:
{
"event": "device.event_type",
"source": "apple_watch | esp32 | home_assistant | mqtt",
"device_id": "string",
"timestamp": "ISO8601",
"payload": {
"temperature": 26.3,
"humidity": 41,
"battery": 78,
"duration_min": 32,
"avg_hr": 148
}
}
- event — Namespace + action (e.g.
sensor.reading,workout.completed) - source — Where the event came from
- device_id — Stable identifier for the device
- payload — Flexible; device-specific fields
Webhook → Agent Adapter
Your OpenClaw agent receives the raw webhook and can:
- Validate — Check signature, timestamp, device_id
- Normalize — Map source-specific fields into a common structure
- Route — Different event types → different skills or workflows
- React — Log, correlate, call tools, make decisions
Example agent logic:
sensor.reading+ temp > 30 → trigger cooling workflowworkout.completed+ poor sleep yesterday → suggest restsensor.offline→ open ticket, notify ops
Position: "AI Brain for Your Devices"
OpenClaw isn't the hub. It's the brain. Devices and platforms feed it events. It correlates, decides, and triggers actions. That's the value prop.
Next Steps
- Define your
eventnamespace (e.g.home.*,health.*,industrial.*) - Map each source (Shortcuts, Home Assistant, ESP32) to the schema
- Add a single webhook endpoint in Clawctl
- Let your agent handle the rest
Deploy with Clawctl
Clawctl provides a secure webhook URL, authentication, and audit logs. Egress allowlists ensure your agent only contacts approved services.