Skip to content

Commit

Permalink
Add Analog Input (Basic) cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <[email protected]>
  • Loading branch information
cdjackson committed Apr 20, 2019
1 parent 82c1e0a commit f39ef94
Show file tree
Hide file tree
Showing 10 changed files with 1,215 additions and 82 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following clusters are currently supported -:
| 0009 | ALARMS | Attributes and commands for sending alarm notifications and configuring alarm functionality. |
| 000A | TIME | This cluster provides a basic interface to a real-time clock. The clock time MAY be read and also written, in order to synchronize the clock (as close as practical) to a time standard. This time standard is the number of seconds since 0 hrs 0 mins 0 sec on 1st January 2000 UTC (Universal Coordinated Time). |
| 000B | RSSI_LOCATION | This cluster provides a means for exchanging Received Signal Strength Indication (RSSI) information among one hop devices as well as messages to report RSSI data to a centralized device that collects all the RSSI data in the network. |
| 000C | ANALOG_INPUT_BASIC | The Analog Input (Basic) cluster provides an interface for reading the value of an analog measurement and accessing various characteristics of that measurement. The cluster is typically used to implement a sensor that measures an analog physical quantity. |
| 000F | BINARY_INPUT_BASIC | The Binary Input (Basic) cluster provides an interface for reading the value of a binary measurement and accessing various characteristics of that measurement. The cluster is typically used to implement a sensor that measures a two-state physical quantity. |
| 0012 | MULTISTATE_INPUT_BASIC | The Multistate Input (Basic) cluster provides an interface for reading the value of a multistate measurement and accessing various characteristics of that measurement. The cluster is typically used to implement a sensor that measures a physical quantity that can take on one of a number of discrete states. |
| 0013 | MULTISTATE_OUTPUT_BASIC | The Multistate Output (Basic) cluster provides an interface for setting the value of an output that can take one of a number of discrete values, and accessing characteristics of that value. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ public static class DataTypeMap {
dataTypeMapping.put("BITMAP_48_BIT", new DataTypeMap("Integer", 0x1d, 6, false));
dataTypeMapping.put("BITMAP_56_BIT", new DataTypeMap("Integer", 0x1e, 7, false));
dataTypeMapping.put("BITMAP_64_BIT", new DataTypeMap("Integer", 0x1f, 8, false));
dataTypeMapping.put("ENUMERATION_16_BIT", new DataTypeMap("Integer", 0x31, 2, false, 0xffff));
dataTypeMapping.put("ENUMERATION_8_BIT", new DataTypeMap("Integer", 0x30, 1, false, 0xff));
dataTypeMapping.put("ENUMERATION_16_BIT", new DataTypeMap("Integer", 0x31, 2, false, 0xffff));
dataTypeMapping.put("ENUMERATION_32_BIT", new DataTypeMap("Integer", 0x33, 4, false, 0xffffffff));
dataTypeMapping.put("FLOAT_32_BIT", new DataTypeMap("Double", 0x39, 4, true));
dataTypeMapping.put("DATA_8_BIT", new DataTypeMap("Integer", 0x08, 1, false));
dataTypeMapping.put("OCTET_STRING", new DataTypeMap("ByteArray", 0x41, -1, false));
dataTypeMapping.put("UTCTIME", new DataTypeMap("Calendar", 0xe2, 4, true, 0xffffffff));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static void main(final String[] args) {
zclParser.addFile("src/main/resources/0009_Alarms.xml");
zclParser.addFile("src/main/resources/000A_Time.xml");
zclParser.addFile("src/main/resources/000B_RssiLocation.xml");
zclParser.addFile("src/main/resources/000C_AnalogInputBasic.xml");
zclParser.addFile("src/main/resources/000F_BinaryInputBasic.xml");
zclParser.addFile("src/main/resources/0012_MultistateInputBasic.xml");
zclParser.addFile("src/main/resources/0013_MultistateOutputBasic.xml");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="zigbee-description.xsd" code="0x000C">
<name>Analog Input (Basic)</name>
<description>The Analog Input (Basic) cluster provides an interface for reading the value of an analog measurement and accessing various characteristics of that measurement. The cluster is typically used to implement a sensor that measures an analog physical quantity.</description>

<attribute code="0x001C" type="CHARACTER_STRING" side="server" optional="true" writable="true" reportable="false">
<name>Description</name>
<description>The Description attribute, of type Character string, MAY be used to hold a description of the usage of the input, output or value, as appropriate to the cluster. The character set used SHALL be ASCII, and the at- tribute SHALL contain a maximum of 16 characters, which SHALL be printable but are otherwise unrestricted.</description>
</attribute>
<attribute code="0x0041" type="FLOAT_32_BIT" side="server" optional="true" writable="true" reportable="false">
<name>Max Present Value</name>
<description>The MaxPresentValue attribute, of type Single precision, indicates the highest value that can be reliably obtained for the PresentValue attribute of an Analog Input cluster, or which can reliably be used for the PresentValue attribute of an Analog Output or Analog Value cluster.</description>
</attribute>
<attribute code="0x0045" type="FLOAT_32_BIT" side="server" optional="true" writable="true" reportable="false">
<name>Min Present Value</name>
<description>The MinPresentValue attribute, of type Single precision, indicates the lowest value that can be reliably ob- tained for the PresentValue attribute of an Analog Input cluster, or which can reliably be used for the PresentValue attribute of an Analog Output or Analog Value cluster.</description>
</attribute>
<attribute code="0x0051" type="BOOLEAN" side="server" optional="true" writable="true" reportable="false">
<name>Out Of Service</name>
<description></description>
</attribute>
<attribute code="0x0055" type="FLOAT_32_BIT" side="server" optional="true" writable="true" reportable="false">
<name>Present Value</name>
<description>The PresentValue attribute indicates the current value of the input, output or value, as appropriate for the cluster. For Analog clusters it is of type single precision, for Binary clusters it is of type Boolean, and for multistate clusters it is of type Unsigned 16-bit integer. The PresentValue attribute of an input cluster SHALL be writable when OutOfService is TRUE. When the PriorityArray attribute is implemented, writing to PresentValue SHALL be equivalent to writing to element 16 of PriorityArray, i.e., with a priority of 16.</description>
</attribute>
<attribute code="0x0067" type="ENUMERATION_8_BIT" side="server" class="AnalogInputReliabilityEnum" optional="true" writable="true" reportable="false">
<name>Reliability</name>
<description>The Reliability attribute, of type 8-bit enumeration, provides an indication of whether the PresentValueor the operation of the physical input, output or value in question (as appropriate for the cluster) is &#8220;reliable&#8221; as far as can be determined and, if not, why not. The Reliability attribute MAY have any of the following values:</description>
<description>NO-FAULT-DETECTED (0) OVER-RANGE (2) UNDER-RANGE (3) OPEN-LOOP (4) SHORTED-LOOP (5) UNRELIABLE-OTHER (7) PROCESS-ERROR (8) MULTI-STATE-FAULT (9) CONFIGURATION-ERROR (10)</description>
</attribute>
<attribute code="0x006A" type="FLOAT_32_BIT" side="server" optional="true" writable="true" reportable="false">
<name>Resolution</name>
<description>This attribute, of type Single precision, indicates the smallest recognizable change to PresentValue.</description>
</attribute>
<attribute code="0x006F" type="BITMAP_8_BIT" side="server" class="AnalogInputStatusFlagsBitmap" optional="true" writable="true" reportable="false">
<name>Status Flags</name>
<description>This attribute, of type bitmap, represents four Boolean flags that indicate the general &#8220;health&#8221; of the analog sensor. Three of the flags are associated with the values of other optional attributes of this cluster. A more detailed status could be determined by reading the optional attributes (if supported) that are linked to these flags. The relationship between individual flags is not defined.</description>
<description>The four flags are Bit 0 = IN_ALARM, Bit 1 = FAULT, Bit 2 = OVERRIDDEN, Bit 3 = OUT OF SERVICE</description>
<description>where:</description>
<description>IN_ALARM -Logical FALSE (0) if the EventStateattribute has a value of NORMAL, otherwise logical TRUE (1). This bit is always 0 unless the cluster implementing the EventState attribute is implemented on the same endpoint.</description>
<description>FAULT -Logical TRUE (1) if the Reliability attribute is present and does not have a value of NO FAULT DETECTED, otherwise logical FALSE (0).</description>
<description>OVERRIDDEN -Logical TRUE (1) if the cluster has been overridden by some mechanism local to the device. Otherwise, the value is logical FALSE (0). In this context, for an input cluster, &#8220;overridden&#8221; is taken to mean that the PresentValue and Reliability(optional) attributes are no longer tracking changes to the physical input. For an Output cluster, &#8220;overridden&#8221; is taken to mean that the physical output is no longer tracking changes to the PresentValue attribute and the Reliability attribute is no longer a reflection of the physical output. For a Value cluster, &#8220;overridden&#8221; is taken to mean that the PresentValue attribute is not writeable.</description>
<description>OUT OF SERVICE -Logical TRUE (1) if the OutOfService attribute has a value of TRUE, otherwise logical FALSE (0).</description>
</attribute>
<attribute code="0x0075" type="ENUMERATION_32_BIT" side="server" optional="true" writable="true" reportable="false">
<name>Engineering Units</name>
<description>The EngineeringUnits attribute indicates the physical units associated with the value of the PresentValue attribute of an Analog cluster.</description>
<description>Values 0x0000 to 0x00fe are reserved for the list of engineering units with corresponding values specified in Clause 21 of the BACnet standard. 0x00ff represents 'other'. Values 0x0100 to 0xffff are available for proprietary use.</description>
<description>If the ApplicationType attribute is implemented, and is set to a value with a defined physical unit, the physical unit defined in ApplicationType takes priority over EngineeringUnits.</description>
<description>This attribute is defined to be Read Only, but a vendor can decide to allow this to be written to if ApplicationType is also supported. If this attribute is written to, how the device handles invalid units (e.g., changing Deg F to Cubic Feet per Minute), any local display or other vendor-specific operation (upon the change) is a local matter.</description>
</attribute>
<attribute code="0x0100" type="SIGNED_32_BIT_INTEGER" side="server" optional="true" writable="true" reportable="false">
<name>Application Type</name>
<description>The ApplicationType attribute is an unsigned 32 bit integer that indicates the specific application usage for this cluster. (Note: This attribute has no BACnet equivalent). ApplicationType is subdivided into Group, Type and an Index number, as follows.</description>
<description>Group = Bits 24-31 An indication of the cluster this attribute is part of.</description>
<description>Type = Bits 16-23 For Analog clusters, the physical quantity that the Present Value attribute of the cluster represents. For Binary and Multistate clusters, the application usage domain.</description>
<description>Index = Bits 0-15The specific application usage of the cluster.</description>
</attribute>

<constant class="AnalogInputReliabilityEnum">
<name>Reliability</name>
<value code="0x00" name="No - Fault - Detected">
</value>
<value code="0x02" name="Over - Range">
</value>
<value code="0x03" name="Under - Range">
</value>
<value code="0x04" name="Open - Loop">
</value>
<value code="0x05" name="Shorted - Loop">
</value>
<value code="0x07" name="Unreliable - Other">
</value>
<value code="0x08" name="Process - Error">
</value>
<value code="0x09" name="Multi - State - Fault">
</value>
<value code="0x0A" name="Configuration - Error">
</value>
</constant>
<constant class="AnalogInputStatusFlagsBitmap">
<name>Status Flags</name>
<value code="0x01" name="In_Alarm">
</value>
<value code="0x02" name="Fault">
</value>
<value code="0x04" name="Overridden">
</value>
<value code="0x08" name="Out Of Service">
</value>
</constant>

</cluster>
Loading

0 comments on commit f39ef94

Please sign in to comment.