diff --git a/developers/bindings/thing-xml.md b/developers/bindings/thing-xml.md index 32979897a7..f70c2499e8 100644 --- a/developers/bindings/thing-xml.md +++ b/developers/bindings/thing-xml.md @@ -31,9 +31,9 @@ A bridge is a specific type of thing as it can additionally provide access to ot Which Things can be associated through which bridge type is defined within the description of a thing: ```xml - + - + Some sample description @@ -46,7 +46,7 @@ Bindings may optionally set the listing of a thing type. By doing do, they indicate to user interfaces whether it should be shown to the users or not, e.g. when pairing things manually: ```xml - + ... ``` @@ -76,32 +76,41 @@ Overriding labels of a channel type must only be done if the very same functiona ### State Channel Types -The following XML snippet shows a thing type definition with 2 channels and one referenced channel type: +The following XML snippet shows a thing type definition with three channels and two referenced channel types: ```xml - + Some sample description - - + + + - + Number Temperature + + Number:Dimensionless + + + ``` +The `item-type` element defines the [item type](../../configuration/items.md#type) to be used when a linked item is created. +If the `item-type` is a `Number:`, then a `unitHint` attribute may be provided to suggest the measurement unit to be used when a linked item is created. + In order to reuse identical channels in different bindings a channel type can be system-wide. A channel type can be declared as system-wide by setting its `system` property to true and can then be referenced using a `system.` prefix in a `channel` `typeId` attribute in any binding - note that this should only be done in the core framework, but not by individual bindings! The following XML snippet shows a system channel type definition and thing type definition that references it: ```xml - + Some sample description @@ -158,11 +167,11 @@ If a functionality is rarely used it should be better marked as `advanced`. The following XML snippet shows a trigger channel: ```xml - + Some sample description - + @@ -422,11 +431,11 @@ A thing can only have direct channels or channel groups, but not both. Inside the thing types XML file channel groups can be defined like this: ```xml - + - - + + @@ -437,7 +446,7 @@ The group type must have a label, an optional description, and an optional categ Moreover the list of contained channels must be specified: ```xml - + This is a single switch actor with a switch channel Light @@ -465,7 +474,7 @@ Among others the one solution could use the data during a device pairing process To define such thing meta data the thing type definition provides the possibility to specify so-called `properties`: ```xml - + ... MyThingVendor @@ -496,7 +505,7 @@ Having this property identified per binding it could be used as the `representat The `representation property` shall be defined in the thing type XML: ```xml - + ... Philips @@ -523,7 +532,7 @@ When comparing representation properties, the auto-ignore service checks for mat If a configuration parameter will be used, then its respective `parameter` shall be declared in the XML `config-description` section or the `config-description` [XML file](../addons/config-xml.md): ```xml - + ... uniqueId ... @@ -569,12 +578,12 @@ Nevertheless, this value can be overridden in the channel definition. In this example, an auto update policy is defined for the channel type, but is overridden in the channel definition: ```xml - + recommend - + Thing type which overrides the auto update policy of a channel @@ -616,9 +625,9 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - + - + ... @@ -627,9 +636,9 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p String - + OR - + String @@ -637,9 +646,9 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p OR - + OR - + String @@ -659,9 +668,9 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p - + - + ... @@ -670,9 +679,9 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p String - + OR - + String @@ -680,9 +689,9 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p OR - + OR - + String @@ -702,7 +711,7 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p - + Dimmer OR trigger @@ -749,13 +758,13 @@ The full Java API for bridge and _Thing_ descriptions can be found in the Java p - + String String - + ... @@ -871,7 +880,7 @@ The following update instruction changes the channel-type for the `battery-level - + system:battery-level @@ -891,7 +900,7 @@ The following removes the `water_level` channel from `foo:pool` things and adds - + foo:concentration @@ -912,8 +921,8 @@ In addition to the update instructions, the thing-type definition needs to add a - - + + 1