Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here we have an example of an DI. This snippet has been taken from a configuration of an ADAM-4051, which has 16 DI's and is accessed via ModBusRTU. For the device configuration, please click here.


Code Block
<component_template config_version="1.0" schema_version="1.0">
  <description>template_Adam_4051</description> 					# This is the general description respectivly the name of the Template.
  <vendor>azeti</vendor> 
  <version>2</version> 
  <class>multi-sensor</class>
    <sensors>
        <sensor sensor_id="DI00"> 									# This is the name of the sensor as it will be shown in the Dashboard.
            <sensor_class>boolean</sensor_class> 					# Sensor class describes the type of measurement, for example boolean, power or temperature.
            <state_evaluation_expressions> 							# The etate evaluation allows the definition of differents states which the sensor can get. 
                <state_evaluation_expression>
                    <expression>value == 0</expression>				# If the value equals 0, then
                    <true>OK</true>									# the state of the sensor will be OK.
                </state_evaluation_expression>
                <state_evaluation_expression>
                    <expression>value == 1</expression>				# If the value equals 1, then
                    <true>CRITICAL</true>							# the state of the sensor will be CRITICAL.
                </state_evaluation_expression>
            </state_evaluation_expressions>
            <sensor_gateway sensor_gateway_id="ADAM-4051">			# Here the gateway is defined, wwhich is configured under the device section of the XML.
                <demux>												# See the device page for more information.
                    <keys>
                        <key>1</key>								# Under demux we define which register from the gateway has to be read. 
                    </keys>
                </demux>
            </sensor_gateway>
        </sensor>
        <sensor sensor_id="DI01">
            <sensor_class>boolean</sensor_class>
            <state_evaluation_expressions>
                <state_evaluation_expression>
                    <expression>value == 0</expression>
                    <true>OK</true>
                </state_evaluation_expression>
                <state_evaluation_expression>
                    <expression>value == 1</expression>
                    <true>CRITICAL</true>
                </state_evaluation_expression>
            </state_evaluation_expressions>
            <sensor_gateway sensor_gateway_id="ADAM-4051">
                <demux>
                    <keys>
                        <key>2</key>
                    </keys>
                </demux>
            </sensor_gateway>
        </sensor>
		.
		.
		.
	<devices>
		<device device_id="ADAM-4051">
        .
		.
		.
		</device> 
    </devices>
</component_template>

...