Skip to content

Clients

Alasdair Allan edited this page Aug 20, 2013 · 23 revisions

Building clients which talk to the steward is pretty simple, and perhaps the easiest way to do so is via Websockets. The steward provides two main API endpoints accessible using secure web socket protocol on port 8888, advertising this service via zero-configuration networking (mDNS), perhaps better known as Bonjour).

Authorised clients can connect to the,

 wss://steward.local:8888/console

resource in order to receive logging entries from the steward as well as state updates from things which talk to the steward. When a client first connects to this resource, most actors in the system will present a brief synopsis.

Alternatively they can connect to the,

 wss://steward.local:8888/manage

resource in order to manage activies, events, tasks and groups or to request the steward communicate with things to to perform and action (e.g. turn on a light) or observe an event such as an instantaneous measurement (e.g. take a measurement of temperature), or request notification from a thing of an event occurring (e.g. movement detected).

There are a number of example clients available which illustrate how to use these two end points to accomplish simple automation.

More complicated clients, one which monitor updates from the steward looking for changing conditions, and reacting to them on behalf of the user by asking the steward to perform actions, are entirely possible. Technically speaking these are intelligent agents working in a multi-agent system with shared goals of making life more convenient for the user. We like to think that we're implementing magic.