1KEY Developers
Reference

Event reference

Every event has the same envelope; data depends on type.

Field Type Meaning
cursor string Position in the hub's events. Unique per hub
type string Event type, below
hub_id string The hub
device_id integer or null The device the event is about
time timestamp When it happened, by the hub's clock (the cloud's for hub.*)
clock_trusted boolean or null false when the hub stamped it before it knew the time
data object Type-specific fields

Hub

Type data
hub.connected {}
hub.disconnected {"reason": "mqtt_keep_alive_timeout"}; reason is AWS IoT's disconnect reason, lowercased, or null
hub.events_skipped {"from": 1, "to": 899}: some events could not be delivered. Re-read devices for current state

Channels

Type data
channel.observed {"key": "lock", "endpoint": 0, "value": false}: the device reported a value. Sent on every change; for alarm and scene channels, on every report
channel.desired {"key": "lock", "endpoint": 0, "value": false}: a command asked for a value

A command's outcome is the channel.observed that follows its channel.desired.

Devices

Type data
device.added {"name": "Front door"}
device.updated {"name": "Front door", "removed_channels": […]}
device.available, device.unavailable {}: the radio can reach the device again, or no longer can
device.forgotten {"name": "Front door"}: removed from the hub

Credentials and rules

Type data
credential.created {"slot": 1, "label": "Unit 3"}
credential.applied {"state": "active"}
credential.revoked {}
rule.created, rule.updated {"name": "…", "enabled": true}
rule.fired, rule.deleted {}

New event types are added without a version change. Ignore types you do not handle.