﻿<?xml version="1.0" encoding="utf-8"?>
<Templates format="2" protocolVersion="54">
  <Template id="aa543f4f-800e-491e-8b5e-2cf6df80af1c" revision="1.0">
    <Name>Domat UC100 Thermostat</Name>
    <CcuModel>ModbusRtuCCU</CcuModel>
    <Producer>Domat</Producer>
    <Model>UC100</Model>
    <Category>11</Category>
    <Description></Description>
    <RevisionHistory>
      <Revision id="1.0">Initial version</Revision>
    </RevisionHistory>
    <SuggestedCCUParameters>
      <Baudrate>9600</Baudrate>
      <DataBits>8</DataBits>
      <Parity>None</Parity>
      <StopBits>One</StopBits>
    </SuggestedCCUParameters>
    <ImportParameters>
      <Parameter>
        <Name>${device_SlaveId}</Name>
        <Value>1</Value>
        <Id>SlaveId</Id>
      </Parameter>
      <Parameter>
        <Name>${ipAddress}</Name>
        <Value>192.168.0.1</Value>
        <Id>IpAddress</Id>
      </Parameter>
    </ImportParameters>
    <Module>
      <Name>Domat UC100 Thermostat</Name>
      <Id>-1</Id>
      <Model>ModbusModule</Model>
      <DeviceProperties>
        <SlaveId>$[SlaveId]</SlaveId>
        <IpAddress>$[IpAddress]</IpAddress>
        <WriteScript>MODBUSWNE(H, 20, Int16, (1 &lt;&lt; Mu3) | ((1 &lt;&lt; Mu4) &lt;&lt; 8))</WriteScript>
        <Variables>[{"DeviceId":-3,"ValueLogType":49,"ValueAggregation":null,"Abbreviation":"Mu3","ValueLogTypeFlavourId":1},{"DeviceId":-4,"ValueLogType":49,"ValueAggregation":null,"Abbreviation":"Mu4","ValueLogTypeFlavourId":1}]</Variables>
      </DeviceProperties>
      <Devices>
        <Device>
          <Name>Domat Thermostat</Name>
          <Id>-2</Id>
          <Model>ModbusThermostat</Model>
          <DeviceProperties>
            <ReadCurrentTemperature>MODBUSR(H, 16, Int16) / 100</ReadCurrentTemperature>
            <ReadDesiredTemperature>MODBUSR(H, 10, Int16) / 100</ReadDesiredTemperature>
            <WriteDesiredTemperature>MODBUSW(H, 10, Int16, Se * 100)</WriteDesiredTemperature>
          </DeviceProperties>
        </Device>
        <Device>
          <Name>Fan mode</Name>
          <Id>-3</Id>
          <Model>ModbusMultiValueSwitch</Model>
          <DeviceProperties>
            <ReadSwitchState>SWITCH(MODBUSR(H, 20, Int16) &amp; 0x00FF, 1, 0, 2, 1, 4, 2, 8, 3, 16, 4, 0)</ReadSwitchState>
            <Value5Index>69</Value5Index>
            <Value6Index>70</Value6Index>
            <Value7Index>71</Value7Index>
            <Value8Index>72</Value8Index>
            <Value9Index>73</Value9Index>
          </DeviceProperties>
        </Device>
        <Device>
          <Name>Heating/cooling mode</Name>
          <Id>-4</Id>
          <Model>ModbusMultiValueSwitch</Model>
          <DeviceProperties>
            <ReadSwitchState>SWITCH(MODBUSR(H, 20, Int16) &gt;&gt; 8, 1, 0, 2, 1, 4, 2, 8, 3, 16, 4, 0)</ReadSwitchState>
            <Value5Index>69</Value5Index>
            <Value6Index>70</Value6Index>
            <Value7Index>71</Value7Index>
            <Value8Index>72</Value8Index>
            <Value9Index>73</Value9Index>
          </DeviceProperties>
        </Device>
        <Device>
          <Name>Domat DO1</Name>
          <Id>-6</Id>
          <Model>ModbusSwitch</Model>
          <DeviceProperties>
            <ReadSwitchState>MODBUSR(H, 6, Bool)</ReadSwitchState>
            <WriteSwitchState>MODBUSWNE(H, 6, Bool, St)</WriteSwitchState>
          </DeviceProperties>
        </Device>
        <Device>
          <Name>CO2</Name>
          <Id>-7</Id>
          <Model>ModbusVariable</Model>
          <DeviceProperties>
            <InternalPollInterval>300000</InternalPollInterval>
            <ReadState>MODBUSR(H, 199, Int16) / 1</ReadState>
            <WriteState></WriteState>
          </DeviceProperties>
        </Device>
      </Devices>
    </Module>
  </Template>
</Templates>