diff --git a/README.md b/README.md index c29d57e..c344e9c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Please note this v2 branch is a work-in-progress. It might change before the final release.** -Version: **2.0.0**. +Version: **2.1.0**. Homie is a lightweight MQTT convention for the IoT. @@ -18,7 +18,7 @@ You can find an implementation of the Homie convention: ## Background -An instance of a physical piece of hardware (an Arduino, an ESP8266...) is called a **device**. A device has **device properties**, like the current local IP, the Wi-Fi signal, etc. A device can expose multiple **nodes**. For example, a weather device might expose a `temperature` node and an `humidity` node. A node can have multiple **node properties**. The `temperature` node might for example expose a `degrees` property containing the actual temperature, and an `unit` property. Node properties can be **ranges**. For example, if you have a LED strip, you can have a node property `led` ranging from `1` to `10`, to control LEDs independently. Node properties can be **settable**. For example, you don't want your `degrees` property to be settable in case of a temperature sensor: this depends on the environment and it would not make sense to change it. However, you will want the `degrees` property to be settable in case of a thermostat. +An instance of a physical piece of hardware (an Arduino, an ESP8266...) is called a **device**. A device has **attributes**, like the current local IP, the Wi-Fi signal, etc. A device can expose multiple **nodes**. For example, a weather station with two wireless sensors might expose a `temperature` node and an `humidity` node. A node can have multiple **properties**. The `temperature` node might for example expose a `degrees` property containing the actual temperature, and an `battery` property containing the battery level of the temperature sensor. Node properties can be **ranges**. For example, if you have a LED strip, you can have a node property `led` ranging from `1` to `10`, to control LEDs independently. Node properties can be **settable**. For example, you don't want your `degrees` property to be settable in case of a temperature sensor: this depends on the environment and it would not make sense to change it. However, you will want the `degrees` property to be settable in case of a thermostat. ## QoS and retained messages @@ -34,15 +34,19 @@ An ID MAY contain only lowercase letters from `a` to `z`, numbers from `0` to `9 To efficiently parse messages, Homie defines a few rules related to topic names. The base topic you will see in the following convention will be `homie/`. You can however choose whatever base topic you want. -* `homie` / **`device ID`**: this is the base topic of a device. Each device must have an unique device ID which adhere to the [ID format](#id-format). +### Devices +* `homie` / **`device ID`**: this is the base topic of a device. Each device must have a unique device ID which adhere to the [ID format](#id-format). +* Attributes are topics that are prefixed with a `$`. These sub-topics add meta-data to Devices, Nodes and Properties describing their parent topic. -### Device properties -* `homie` / **`device ID`** / `$` **`device property`**: a topic starting with a `$` after the base topic of a device represents a device property. A device property MUST be one of these: +### Device attributes + +* `homie` / **`device ID`** / `$` **`device attribute`**: a topic starting with a `$` after the base topic of a device represents a device attribute. A device attribute MUST be one of these: +
Property | +Topic | Direction | Description | Retained | @@ -139,6 +143,13 @@ To efficiently parse messages, Homie defines a few rules related to topic names.Yes or No, depending of your implementation | No |
---|---|---|---|---|---|---|
$nodes | +Device → Controller | +Nodes the device exposes, with format id separated by a , if there are multiple nodes. For ranges, define the range after the id , within [] and separated by a - . |
+ Yes | +Yes | +
Property | +Topic | Direction | Description | Retained | @@ -173,25 +183,121 @@ Properties starting with a `$` are special properties. It must be one of the folYes | Yes |
---|---|---|---|---|---|---|
$name | +Device → Controller | +Friendly name of the Node | +Yes | +Yes | +||
$properties | Device → Controller | -Properties the node exposes, with format id separated by a , if there are multiple nodes. For ranges, define the range after the id , within [] and separated by a - . For settable properties, add :settable to the id |
+ Properties the node exposes, with format id separated by a , if there are multiple nodes. For ranges, define the range after the id , within [] and separated by a - . |
Yes | Yes |
Topic | +Direction | +Description | +Valid values | +Retained | +Required | +
---|---|---|---|---|---|
$settable | +Device → Controller | +Specifies whether the property is settable (true ) or readonly (false ) |
+ true ,false |
+ Yes | +Yes | +
$unit | +Device → Controller | +A string containing the unit of this property. You are not limited to the recommended values, although they are the only well known ones that will have to be recognized by any Homie consumer. | +
+ Recommended: + °C Degree Celsius+ °F Degree Fahrenheit+ ° Degree+ L Liter+ gal Galon+ V Volts+ W Watt+ A Ampere+ % Percent+ m Meter+ ft Feet+ Pa Pascal+ psi PSI+ # Count or Amount
+ |
+ Yes | +Yes | +
$datatype | +Device → Controller | +Describes the format of data. | +integer , float , boolean (true or false ), string , enum |
+ Yes | +Yes | +
$name | +Device → Controller | +Friendly name of the property. | +Any String | +Yes | +Yes | +
$format | +Device → Controller | ++ Describes what are valid values for this property. + | +
+
|
+ Yes | +Yes | +