API Reference Shelly v#0.1.0

Copy Markdown View Source

Modules

Shelly smart-device client for Elixir — cloud APIs, real-time events, and component-aware status parsing across every hardware generation.

Account-level Shelly Cloud API, authorized by an OAuth access token (Authorization: Bearer) — no per-device auth keys needed.

The legacy Shelly Cloud v1 API (/device/status, /device/relay/control). Shelly has deprecated it and announced removal — prefer Shelly.CloudV2 (same auth key) or the OAuth Shelly.Account API. Kept as a fallback.

Shelly Cloud v2 API, authorized by a per-account auth key (Shelly app → Settings → User Settings → Access And Permissions → "Get key" — the key and the server URI are shown together).

Real-time events socket for an OAuth-connected account (wss://<server>:6113/shelly/wss/hk_sock?t=<token>).

Shelly Cloud OAuth (authorization-code) flow — the "connect your account" path that replaces auth keys entirely.

Per-account rate gate for Shelly Cloud traffic. The cloud allows ~1 request/second/account and returns 429 for anything faster — and polling, control commands and one-off calls all draw from the same budget, so every call should flow through one gate.

Parses Shelly device status payloads into a flat status map — one parser for every transport (legacy v1 API, v2 API, OAuth account API, websocket events) and every hardware shape