<?xml version="1.0" encoding="utf-8"?>
<Templates format="2" protocolVersion="83">
  <Template id="a7f3c2d1-84e5-4b6a-9f0e-1d2c3b4a5e6f" revision="1.1">
    <SuggestedCCUParameters>
      <Baudrate>9600</Baudrate>
      <Parity>None</Parity>
      <StopBits>One</StopBits>
      <DataBits>8</DataBits>
      <UseAsciiCommunication>False</UseAsciiCommunication>
      <ReadWriteTimeout>1000</ReadWriteTimeout>
    </SuggestedCCUParameters>
    <RevisionHistory>
      <Revision id="1">Initial release — CO concentration monitoring with status diagnostics.</Revision>
      <Revision id="1.1">Single CO Concentration variable with sensor-absent error and stale-measurement warning; device configuration moved to module service attributes; removed Set slave ID and Set baud rate actions.</Revision>
    </RevisionHistory>
    <Name>PluraSens E2618-CO-DM</Name>
    <CcuModel>ModbusRtuCCU</CcuModel>
    <Producer>Evikon MCI OÜ</Producer>
    <Model>E2618-CO-DM</Model>
    <Description>Duct-mount carbon monoxide transmitter with RS-485 Modbus RTU interface. Reads CO concentration (0–300 or 0–1000 ppm depending on ordered variant), flags a missing sensor and stale measurements, and exposes device configuration as service attributes.</Description>
    <Category>5</Category>
    <ImportParameters>
      <Parameter>
        <Id>SlaveId</Id>
        <Name>Modbus Slave ID</Name>
        <Value>1</Value>
      </Parameter>
    </ImportParameters>
    <Module>
      <Name>E2618-CO-DM Module</Name>
      <Id>-1</Id>
      <Model>ModbusModule</Model>
      <DeviceProperties>
        <SlaveId>$[SlaveId]</SlaveId>
        <MaxPrefetchGroupSize>100</MaxPrefetchGroupSize>
        <PrefetchModeId>0</PrefetchModeId>
        <InternalPollInterval>30000</InternalPollInterval>
        <ServiceAttributesFormulas>[{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Hardware version&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 1, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Software version&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 2, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Serial number&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 3, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Slave ID - current&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 4, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Baud rate - current&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 5, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Response delay [ms]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 6, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Parity / stop bits&quot;},&quot;ReadFormula&quot;:&quot;SWITCH(MODBUSR(H, 7, UInt16), 1, \&quot;None / 1 stop\&quot;, 2, \&quot;None / 2 stops\&quot;, 3, \&quot;Odd / 1 stop\&quot;, 4, \&quot;Even / 1 stop\&quot;, \&quot;?\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Zero calibration (ADC)&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 165, Int16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Slope calibration&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 166, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT1 assignment&quot;},&quot;ReadFormula&quot;:&quot;SWITCH(MODBUSR(H, 201, UInt16), 0, \&quot;None\&quot;, 2, \&quot;Gas concentration\&quot;, 9, \&quot;Forced Modbus control\&quot;, \&quot;?\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT2 assignment&quot;},&quot;ReadFormula&quot;:&quot;SWITCH(MODBUSR(H, 202, UInt16), 0, \&quot;None\&quot;, 2, \&quot;Gas concentration\&quot;, 9, \&quot;Forced Modbus control\&quot;, \&quot;?\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT1 forced value [%]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 203, UInt16) / 10&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT2 forced value [%]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 204, UInt16) / 10&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT1 scale 0% [ppm]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 261, Int16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT1 scale 100% [ppm]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 262, Int16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT2 scale 0% [ppm]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 263, Int16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;OUT2 scale 100% [ppm]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 264, Int16)&quot;}]</ServiceAttributesFormulas>
        <ServiceActionsScripts>[{&quot;ActionDefinition&quot;:{&quot;Name&quot;:&quot;Restart instrument&quot;,&quot;NumericParameters&quot;:[],&quot;BoolParameters&quot;:[],&quot;EnumParameters&quot;:[]},&quot;Script&quot;:&quot;MODBUSW(SH, 17, UInt16, 42330);&quot;}]</ServiceActionsScripts>
      </DeviceProperties>
      <Devices>
        <Device>
          <Name>CO Concentration</Name>
          <Id>-2</Id>
          <Model>ModbusVariable</Model>
          <DeviceProperties>
            <DeviceType>0</DeviceType>
            <IconId>89</IconId>
            <InternalPollInterval>5000</InternalPollInterval>
            <IsReadOnly>True</IsReadOnly>
            <ReadState>MODBUSR(H, 259, UInt16)</ReadState>
            <ReadScript>var statusBits := MODBUSR(H, 255, UInt16); var dataAge := MODBUSR(H, 17, UInt16); IF(GETBIT(statusBits, 0), ADDERROR(0, &quot;Sensor absent&quot;)); IF(dataAge &gt; 60, ADDWARNING(3, &quot;Stale measurement: &quot; + dataAge + &quot;s old&quot;));</ReadScript>
            <ServiceAttributesFormulas>[{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Status: Analog outputs&quot;},&quot;ReadFormula&quot;:&quot;IF(GETBIT(MODBUSR(H, 255, UInt16), 1), \&quot;Activated\&quot;, \&quot;Deactivated\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Status: OUT1 type detected&quot;},&quot;ReadFormula&quot;:&quot;IF(GETBIT(MODBUSR(H, 255, UInt16), 6), \&quot;Voltage (0-10 V)\&quot;, \&quot;Current (4-20 mA)\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Status: OUT2 type detected&quot;},&quot;ReadFormula&quot;:&quot;IF(GETBIT(MODBUSR(H, 255, UInt16), 7), \&quot;Voltage (0-10 V)\&quot;, \&quot;Current (4-20 mA)\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Status: LED&quot;},&quot;ReadFormula&quot;:&quot;IF(GETBIT(MODBUSR(H, 255, UInt16), 8), \&quot;On\&quot;, \&quot;Off\&quot;)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Raw ADC sensor data&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 257, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Data age [s]&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 17, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Change rate limit (units/s; 0 = off)&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 167, UInt16)&quot;},{&quot;AttributeDefinition&quot;:{&quot;Name&quot;:&quot;Integrating filter time [s] (0 = off)&quot;},&quot;ReadFormula&quot;:&quot;MODBUSR(H, 168, UInt16)&quot;}]</ServiceAttributesFormulas>
          </DeviceProperties>
        </Device>
      </Devices>
    </Module>
  </Template>
</Templates>
