SDK for managing devices and their states, it is based on extended protocol homieiot. The main idea was taken from Homie iot convention and contains extented features that are used in 2Smart products.
-
The device has a group of attributes
$options
, which in format repeats the$properties
from the node. Used to store device settings, both editable and not. Example:sweet-home/device/$options/some-option
. -
The device has a group of attributes
$telemetry
, which in format repeats the$properties
from the node. Used to store various telemetry and statistics.$stats
is not used. Example:sweet-home/device/$telemetry/some-telemetry
. -
A node has a
$state
attribute, similar to a device. Example:sweet-home/device/node/$state
. -
The node has a group of attributes
$options
, similar to the device. Example:sweet-home/device/node/$options/some-option
. -
The node has a group of attributes
$telemetry
, similar to the device. Example:sweet-home/device/node/$telemetry/some-telemetry
. -
A mechanism for validating the set values has been added to the application:
- On the received message, in case of incorrect values, the error body should be sent to a topic like
errors/sweet-home/device/node...
The error body should be in the JSON format of the string
{ "code" : "<error_code>", "message": "<error message>" }
For example, if an incorrect value has come to the topic
sweet-home/device/node/sensor/set
, then the error should be sent to the topicerrors/sweet-home/device/node/sensor
- Valid for any editable values (
$properties
,$options
,$telemetry
).
- On the received message, in case of incorrect values, the error body should be sent to a topic like
-
Device and node indicators are taken from the following attributes:
- Status (state) -
$state
. - Signal strength -
$telemetry/signal
. - Battery charge level -
$telemetry/battery
.
- Status (state) -
Device attribute $stats
from the original protocol is not supported.
- For device:
$homie
,$name
,$localip
,$mac
,$fw/name
,$fw/version
,$implementation
,$state
. - For node:
$name
,$state
plus at least one property. - For properties: (
$properties
,$options
,$telemetry
):$name
.
- Broker - supported transport protocols.
- Device - tool for device creation/control.
- Node - tool for node creation/control.
- Property - tool for property creation/control.
- Sensor - tool for sensor creation/control.
- ETL - set of rules for the data transformation.
- Homie - toolkit for managing devices and their states.
- Bridge - toolkit for bridge developers.
- Utils - set of utilities.