Difference between revisions of "MODBUS AIO"

From OpenMotics
Jump to navigation Jump to search
 
Line 199: Line 199:
 
** With API Instruction "CD", all CAN details can be requested
 
** With API Instruction "CD", all CAN details can be requested
 
** With API Instruction "mR", Modbus setpoint, Modbus mode, Temperature, Humidity and CO2 can be requested
 
** With API Instruction "mR", Modbus setpoint, Modbus mode, Temperature, Humidity and CO2 can be requested
 +
** When a change in Setpoint happens, the Master will send an event, see [[AIO API Event Codes]] code 20.

Latest revision as of 10:10, 26 October 2020

Introduction

The AIO design also supports Modbus thermostats directly connected to the Micro CAN. This enables physical Modbus thermostats to be seamlessly integrated in the Openmotics system and allow users to control their thermostats online, by mobile app and by physical thermostats.

These are the possibilities of the physical thermostat supported by Openmotics:

  • Allows to set the setpoint of a room
  • Allows to change the mode (vacation, auto, party etc)
  • Change between heating and cooling
  • Uses the internal temperature sensor as sensor probe for the Openmotics system

Supported Modbus thermostats

Today, only Openmotics Modbus thermostats are supported but more thermostats will be supported in the future.

How to connect the Modbus thermostat

Following is needed to connect a Modbus thermostat:

  • An installed Micro CAN
  • An Openmotics Modbus Adapter Cable
  • An Openmotics Modbus thermostat

The Modbus thermostat will be connected to the Openmotics Micro CAN by using the Openmotics Modbus Adapter Cable that converts the UART output of the Micro CAN to a modbus signal.

The Micro CAN will communicate with the Modbus thermostat and will read the temperature of the thermostat, is able to read and set the thermostat setpoint and read/set the thermostat mode.

How to configure the system after connecting a Modbus Thermostat

Step1: Find the Micro CAN ID

In the following steps, we need to know the ID of the Micro CAN on which the Modbus thermostat is connected. Each Micro CAN needs at least 1 switch.

First, use following CLI instruction:

input debug on

Press the switch connected to the Micro CAN that has the connected Modbus thermostat. In this example, I got following CLI return:

Input Nr 13 has been pressed 

Now, do the following CLI instruction:

input search can id 13

You will get following return:

ID 100.166.094

You can also verify the above manually by using CLI instruction:

can ping list

Following return:

Nr-ID2.ID1.ID0--Inp.link0-Inp.link1-Inp.link2-Inp.link3-Inp.link4-Inp.link5-Tem.link0-Tem.link1-Type-Firmware-Boot-ID_NE-Modbus-Type-Model-Speed-Status-Min-MAX-delay--Volt--
00 008.228.145  008(000)  255(255)  255(255)  255(255)  255(255)  255(255)  008(000)  255(255)  044  F2.0.44  255   069   255   255   255   255   000   000 255  015ms 12.14V
01 100.166.094  013(005)  014(006)  255(255)  255(255)  255(255)  255(255)  255(255)  255(255)  000  F2.0.54  255   069   255   255   255   255   000   000 255  019ms 11.98V

In the above example, check for all Micro CAN's the Inp.link0..5 and look for 13 (value not between brackets). In our example, we've found ID 100.166.94 containing input 13 which we also found by using the CLI instruction "input search can id".

Note:

  • The above can also be done over the API interface
    • When an input is pressed, an Event will be thrown
    • With API Instruction "CS", the link between input_nr and ID can be made

Step 2: Configure the Modbus ID

We're using a thermostat that responds to Modbus ID 1.

For Modbus Parameter explanation, See Modbus Parameters

This needs to be programmed in the Micro CAN by using following CLI instruction:

basic action activate 20 26 100 166 94 1

To check if the instruction has been programmed in the Micro CAN, use again the CAN ping instruction:

ping can list

Return:

Nr-ID2.ID1.ID0--Inp.link0-Inp.link1-Inp.link2-Inp.link3-Inp.link4-Inp.link5-Tem.link0-Tem.link1-Type-Firmware-Boot-ID_NE-Modbus-Type-Model-Speed-Status-Min-MAX-delay--Volt--
00 008.228.145  008(000)  255(255)  255(255)  255(255)  255(255)  255(255)  008(000)  255(255)  044  F2.0.44  255   069   255   255   255   255   000   000 255  017ms 12.12V
01 100.166.094  013(005)  014(006)  255(255)  255(255)  255(255)  255(255)  255(255)  255(255)  000  F2.0.54  255   069   001   255   255   255   000   000 255  022ms 11.96V

As you can see, in the column Modbus, you see address 1 for our Micro CAN

Note:

  • The above can also be done over the API interface
    • A Basic Action can be execute over the API with instruction "BA"
    • With API Instruction "CD", all CAN details can be requested

Step 3: Configure the Modbus Speed

We're using a thermostat in this example that works at a Modbus speed of 9600 baud.

For Modbus Parameter explanation, See Modbus Parameters

This needs to be programmed in the Micro CAN by using following CLI instruction:

basic action activate 20 27 100 166 94 1

To check if the instruction has been programmed in the Micro CAN, use again the CAN ping instruction:

ping can list

Return:

Nr-ID2.ID1.ID0--Inp.link0-Inp.link1-Inp.link2-Inp.link3-Inp.link4-Inp.link5-Tem.link0-Tem.link1-Type-Firmware-Boot-ID_NE-Modbus-Type-Model-Speed-Status-Min-MAX-delay--Volt--
00 008.228.145  008(000)  255(255)  255(255)  255(255)  255(255)  255(255)  008(000)  255(255)  044  F2.0.44  255   069   255   255   255   255   000   000 255  033ms 11.86V
01 100.166.094  013(005)  014(006)  255(255)  255(255)  255(255)  255(255)  255(255)  255(255)  000  F2.0.54  255   069   001   255   255   001   000   000 255  021ms 11.85V

As you can see, in the column Speed, you see speed 1 for our Micro CAN

Step 4: Configure the Modbus Model

We're using thermostat Model 0 in this example.

For Modbus Parameter explanation, See Modbus Parameters

This needs to be programmed in the Micro CAN by using following CLI instruction:

basic action activate 20 29 100 166 94 0

To check if the instruction has been programmed in the Micro CAN, use again the CAN ping instruction:

ping can list

Return:

Nr-ID2.ID1.ID0--Inp.link0-Inp.link1-Inp.link2-Inp.link3-Inp.link4-Inp.link5-Tem.link0-Tem.link1-Type-Firmware-Boot-ID_NE-Modbus-Type-Model-Speed-Status-Min-MAX-delay--Volt--
00 008.228.145  008(000)  255(255)  255(255)  255(255)  255(255)  255(255)  008(000)  255(255)  044  F2.0.44  255   069   255   255   255   255   000   000 255  023ms 12.05V
01 100.166.094  013(005)  014(006)  255(255)  255(255)  255(255)  255(255)  255(255)  255(255)  000  F2.0.54  255   069   001   255   000   001   000   000 255  027ms 12.00V

As you can see, in the column Model, you see Model 0 for our Micro CAN

Step 5: Configure the Modbus Type

The Modbus Type represents 8 bits, those 8 bits will tell you which data (temperature, humidity etc) will be taken from the Modbus thermostat or from the Micro CAN connected sensors.

For Modbus Type explanation, See Modbus Parameters

We've a thermostat that uses temperature, humidity and CO2. However, we will only use temperature and humidity from the Modbus thermostat (thus thermostat type = 0d11001111 = 207). This needs to be programmed in the Micro CAN by using following CLI instruction:

basic action activate 20 27 100 166 94 207

To check if the instruction has been programmed in the Micro CAN, use again the CAN ping instruction:

ping can list

Return:

Nr-ID2.ID1.ID0--Inp.link0-Inp.link1-Inp.link2-Inp.link3-Inp.link4-Inp.link5-Tem.link0-Tem.link1-Type-Firmware-Boot-ID_NE-Modbus-Type-Model-Speed-Status-Min-MAX-delay--Volt--
00 008.228.145  008(000)  255(255)  255(255)  255(255)  255(255)  255(255)  008(000)  255(255)  044  F2.0.44  255   255   255   255   255   255   000   000 255  015ms 12.14V
01 100.166.094  013(005)  014(006)  255(255)  255(255)  255(255)  255(255)  255(255)  255(255)  000  F2.0.54  255   069   001   207   000   001   002   000 255  019ms 11.98V


As you can see, in the column Type, you see Type 207 for our Micro CAN

Step 6: Add sensor in the Master processor

Once the above steps are performed, the uCAN is programmed and now the uCAN must request a sensor number from the master. This is done by pushing one of the switches connected on the uCAN. To see if this has been successfully executed, do the following:

To check if the instruction has been programmed in the Micro CAN, use again the CAN ping instruction:

ping can list

Return:

Nr-ID2.ID1.ID0--Inp.link0-Inp.link1-Inp.link2-Inp.link3-Inp.link4-Inp.link5-Tem.link0-Tem.link1-Type-Firmware-Boot-ID_NE-Modbus-Type-Model-Speed-Status-Min-MAX-delay--Volt--
00 008.228.145  008(000)  255(255)  255(255)  255(255)  255(255)  255(255)  008(000)  255(255)  044  F2.0.44  255   255   255   255   255   255   000   000 255  029ms 12.04V
01 100.166.094  013(005)  014(006)  255(255)  255(255)  255(255)  255(255)  010(002)  255(255)  000  F2.0.54  255   069   001   207   000   001   002   000 255  028ms 11.88V

As you can see, in the column Temp.Link0, you see that sensor 10 has appeared in our uCAN. So Sensor 10 will be used to display the Thermostat Modbus data.

Please also have a look at the status column, you can see 2 which means the thermostat is responding to the messages of the Micro CAN, see See Modbus Parameters.

You can use the below instruction to display the Sensor data:

sensor list

Return:

sensor list

-Sensor---Temp-----Hum------Bright---CO2-------VOC----Dali--Setpoint--Th Mode--Name-----------
000 (t)    NC       NC       NC      NC       NC       001    NC      000     Dali sensor
001 (t)    NC       NC       NC      NC       NC       012    NC      000     sensor 1 test
002 (t)    NC       NC       NC      NC       NC       255    NC      000
003 (t)    NC       NC       NC      NC       NC       255    NC      000
004 (t)    NC       NC       NC      NC       NC       255    NC      000
005 (t)    NC       NC       NC      NC       NC       255    NC      000
006 (t)    NC       NC       NC      NC       NC       255    NC      000
007 (t)    NC       NC       NC      NC       NC       255    NC      000
008 (s)  +23.0'C   049%     00835   1073ppm   NC       255    NC      000     CAN sensor
009 (s)    NC       NC       NC      NC       NC       255    NC      000
010 (s)  +22.5'C   041%     00255    NC       NC       255  +20.0'C   000     Modbus Thermost.
011 (s)    NC       NC       NC      NC       NC       255    NC      000
012 (s)    NC       NC       NC      NC       NC       255    NC      000
013 (s)    NC       NC       NC      NC       NC       255    NC      000
014 (s)    NC       NC       NC      NC       NC       255    NC      000
015 (s)    NC       NC       NC      NC       NC       255    NC      000
016 (T)    NC       NC      00255    NC       NC       255    NC      000
017 (T)    NC       NC      00255    NC       NC       255    NC      000
018 (T)    NC       NC      00255    NC       NC       255    NC      000
019 (T)    NC       NC      00255    NC       NC       255    NC      000
020 (T)    NC       NC      00255    NC       NC       255    NC      000
021 (T)    NC       NC      00255    NC       NC       255    NC      000
022 (T)    NC       NC      00255    NC       NC       255    NC      000
023 (T)  +20.5'C   058%     00255    NC       NC       255    NC      000     I2C sensor 

As you can see in the above example, our sensor 10 appears with the values retrieved from the Modbus thermostat. You also have a setpoint column. When the user changes the setpoint on the Modbus thermostat, the setpoint will change, when a BA is used to change the setpoint, the setpoint will change on the Modbus thermostat as well.

Changing the setpoint can be done as follows (change setpoint sensor 10 to mode 0 and 19.5 degree Celsius):

basic action activate 20 23 10 0 19 5

Note:

  • The above can also be done over the API interface
    • A Basic Action can be execute over the API with instruction "BA"
    • With API Instruction "CD", all CAN details can be requested
    • With API Instruction "mR", Modbus setpoint, Modbus mode, Temperature, Humidity and CO2 can be requested
    • When a change in Setpoint happens, the Master will send an event, see AIO API Event Codes code 20.