Attribute Element
<attribute>
The <attribute> element defines the attributes for a device datapoint. For an <attribute> element within a <byte> element, the attribute name must map an <attribute> element that is defined within the <attributes> element.
The following table lists the attributes for the <attribute> element.
Attribute | Description | Required/Optional |
---|---|---|
enum | Defines whether the attribute has an enumeration of values within an enclosed set of <enum> elements. | Optional |
float | If set to true, specifies that the attribute is a floating point value. If the enum, float, or signed attribute is not specified, or not set to true, the attribute is interpreted as an unsigned integer. | Optional |
length | Defines the length of an input datapoint. Example:Â For a datapoint with a length of 2, the <byte> element maps attributes to bytes 0 and 1. | Optional |
name | Defines the name for the attribute. This name is used by client applications and users to select an IzoT Server datapoint. You can select any name, but using common names across multiple device types simplifies implementation of client applications. Following are example attribute names. A "<block_name>-" prefix may be added when the same attribute is implemented by multiple blocks on a device. A "<block_name>-<block_number>-" prefix may be added when there are multiple blocks of the same type on a device. An "-<instance_number>" suffix may be added when there are multiple attributes of the same type within a single application.
| Required |
scale | Defines a percentage by which to scale the value. A scale value of 100Â represents a scale factor of 100%, or 1x. Always specify a scale property for signed and unsigned integer values. Example:Â If the server reads a value of 200 from a device while polling brightness, and it has a scale value of 50 for that byte, then the IzoT REST API XML for messages will display the brightness as 100 (50% of 200 is 100). | Optional |
signed | If set to true, specifies that the attribute is a signed integer value. If the enum, float, or signed attribute is not specified, or not set to true, the attribute is interpreted as an unsigned integer. | Optional |
value | Defines an absolute value for the byte to be updated for a datapoint. The value attribute is used only for input datapoints. | Optional |
Example 1
<attributes> Â Â <attribute name="brightness"> Â Â Â Â <nvs> Â Â Â Â Â Â <nv ... /> Â Â Â Â </nvs> Â Â </attribute> </attributes>
Example 2
<nvs> Â Â <nv ... > Â Â Â Â <byte ...> Â Â Â Â Â Â <attribute name="brightness" enum="true"> Â Â Â Â Â Â Â Â <enum ... /> Â Â Â Â Â Â </attribute> Â Â Â Â </byte> Â Â </nv> </nvs>
XML Schema Definition
 <xs:element name="attribute">     <xs:complexType>       <xs:choice>         <xs:element ref="enum" />         <xs:element ref="nvs" />       </xs:choice>       <xs:attribute name="name" type="xs:NMTOKEN" use="required" />       <xs:attribute name="length" type="xs:NMTOKEN" use="optional" />       <xs:attribute name="enum" use="optional" >         <xs:simpleType>           <xs:restriction base="xs:NMTOKEN">             <xs:pattern value="true|false" />           </xs:restriction>         </xs:simpleType>       </xs:attribute>       <xs:attribute name="float" use="optional" >         <xs:simpleType>           <xs:restriction base="xs:NMTOKEN">             <xs:pattern value="true|false" />           </xs:restriction>         </xs:simpleType>       </xs:attribute>       <xs:attribute name="scale" type="xs:NMTOKEN" use="optional" />       <xs:attribute name="signed" use="optional" >         <xs:simpleType>           <xs:restriction base="xs:NMTOKEN">             <xs:pattern value="true|false" />           </xs:restriction>         </xs:simpleType>       </xs:attribute>       <xs:attribute name="value" type="xs:NMTOKEN" use="optional" />     </xs:complexType>   </xs:element>