Skip to main content

Overview

Device state is organized into named containers called buckets. Each bucket has an object_key, object_revision, and object_timestamp. All communication between device and server is framed in terms of buckets.

Object Key Format

Examples:
  • device.09AA01AB12345678 — device bucket for serial 09AA01AB12345678
  • shared.09AA01AB12345678 — shared bucket for the same device
  • structure.abc123 — structure bucket for a home
  • user.homeassistant — user bucket for pairing
The type prefix determines how the device processes the data. The identifier is usually the device serial number but varies by bucket type (e.g., structure IDs, user IDs).

Revision and Timestamp

Every bucket tracks two versioning fields:

Sync Rules

Timestamp is the sole authority for determining which data is newer:

Zero Timestamp Sentinel

A timestamp of 0 signals “no data exists.” When the device receives object_timestamp: 0, it treats this as an invitation to upload its current local state via PUT. This happens after device reset or server-side data deletion.

Conditional Writes

Most buckets use base_object_revision in PUT requests — informational only, no validation. One exception: The shared bucket uses if_object_revision — a conditional write guard. If the revision doesn’t match the server’s current revision, the server should reject the write. This prevents the device from overwriting a temperature change the server pushed while the device was preparing its PUT.

All 28 Bucket Types

Direction key: For most home server implementations, only the essential buckets need active handling: device, shared, structure, user, and schedule.

Write Protection

The device bucket has 113 device-only fields that the server cannot write. If you push a value for one of these fields, the device compares it against its local value and if different, re-sends its own value in the next PUT — actively overwriting your change. Accept these re-PUTs normally. Do not try to fight them. See device bucket for the full list.

Merge Strategy

  • Subscribe responses (server → device): Shallow merge — device applies the fields in value to its local state
  • Schedule bucket: Full replacement — always push the complete schedule JSON
  • PUT requests (device → server): Inline merge — data fields mixed with metadata at the top level