Events (WebSocket)
The WebSocket
/v1/stream is a WebSocket on both transports (wss://igh-<serial>.local:8490/v1/stream, wss://api.igh.app/v1/stream), authenticated with Authorization: Bearer or ?token= on the upgrade.
- Requests travel as
ClientMessage{ id, method, path, query?, body? }and are answered{ id, status, body }, exactly as over HTTPS. - Subscriptions:
{ id, subscribe: ["state", "sensor", "scene", "exposure"] }→{ id, status: 200, body: { subscribed } }. Until a client subscribes it gets all four. - Events (
Event):{ event, house, device?, class?, state?, at }: a unit's or gang's new state, a sensor reading or detection, a scene run ({ running }), orexposure(what the integration shows changed: readGET /v1/houseagain). Only exposed items appear, and they arrive as they happen. - Closing: the credential is checked on every message and whenever the integration changes. One that stops passing gets an
Errorframe, then the close code4000 + HTTP status(4401, 4403, 4404, 4429, 4503) with the error code as the reason. Through the cloud, a gateway that goes offline closes the stream with 4503gateway_offline; on AWS the error frame may be the only signal. A refused upgrade is answered with the HTTP status and the error body. - At most 20 WebSocket connections per home through the cloud. Reconnect with a backoff, then read
GET /v1/stateonce to catch up.
IGH home API 1.1.0. Generated from the doc source; do not edit.