Account-level Shelly Cloud API, authorized by an OAuth access token
(Authorization: Bearer) — no per-device auth keys needed.
An account here is a plain map (or any struct) with:
:server— the account's cloud server, e.g."https://shelly-74-eu.shelly.cloud"(fromShelly.OAuth'suser_api_url):token— the OAuth access token
All calls are paced through Shelly.RateGate when it is running
(~1 request/second/account is the cloud's limit).
Summary
Functions
Status of every device on the account in ONE call (all_status).
Returns {:ok, %{device_id => raw_status}} with lowercase ids; parse
per device/channel with Shelly.Status.parse/4.
Flatten a list_devices/1 result into one entry per channel —
multi-relay devices (Pro 2/3/4) become several addable rows.
List every device on the account (get_all_lists): id, user-given
name, model/type, generation, channel count, room, online state.
Parse one device's all_statuses/1 entry for a channel — derives
online from the payload's cloud connectivity instead of assuming it
Switch a relay channel on or off.
Types
Functions
Status of every device on the account in ONE call (all_status).
Returns {:ok, %{device_id => raw_status}} with lowercase ids; parse
per device/channel with Shelly.Status.parse/4.
Flatten a list_devices/1 result into one entry per channel —
multi-relay devices (Pro 2/3/4) become several addable rows.
List every device on the account (get_all_lists): id, user-given
name, model/type, generation, channel count, room, online state.
Returns {:ok, devices} where devices is the raw map keyed by
device id — see expand_channels/1 for a flattened per-channel list.
Parse one device's all_statuses/1 entry for a channel — derives
online from the payload's cloud connectivity instead of assuming it:
{:ok, statuses} = Shelly.Account.all_statuses(account)
Shelly.Account.parse_status(statuses["0cdc7ef76644"], 0)
Switch a relay channel on or off.