We configure IR control of the air conditioner from gadgets or “Prepare the cart in the summer”
In modern home automation systems, climate control most often in the list of tasks to be solved is in second place after working with lighting fixtures. The range of equipment used in this scenario is very wide. The top lines are occupied by professional devices for HVAC (Heating, Ventilation, & Air Conditioning - heating, ventilation and air conditioning), including underfloor heating, air recirculation systems and cold ceilings. In the accessible segment, we see traditional household air conditioners and numerous electric heaters and gas boilers, and ventilation tasks are most often solved by the “manual” method of opening windows.
The most convenient way to control the air conditioner is to connect to it via a specialized interface that provides not only the sending of commands, but also status monitoring, as well as information on the status and possible malfunctions. However, this option is available only in certain models, it may require the purchase of additional units and it can hardly be called affordable. However, today, with the proliferation of standards such as AllJoyn, HomeKit, and SmartThings, similar models are beginning to appear in the more mass segment.
Fortunately, there is another way to control the air conditioner - using the infrared channel. The advantages of this approach include versatility (one IR transmitter can simultaneously serve various equipment in the room) and low cost. The downside is the complete lack of feedback from the managed device. In addition, this solution does not even guarantee the delivery of commands. How suitable this method is for you to decide, however, in our opinion, the availability of such an option is better than a complete lack of control.
Let's see what options are there for sending IR commands. One of the most popular and universal today can be called devices manufactured by Global Cache. The product line includes a dozen models that provide control and management via IR, RS-232 and dry contacts. We recommend these reliable solutions for this task as part of a professional installation, for which you will have to bear responsibility.
To work with all transmitters, a network interface (wired or wireless) and a protocol based on TCP / IP are used. Having detailed documentation makes it easy to integrate these solutions into your automation system. Note that the iRidium software package has a built-in configuration database for Global Cache equipment, which simplifies working with them even more.
The downside of the devices of this manufacturer is their rather high cost. As a more affordable alternative, especially for those who like to do everything with their own hands, we can call the manufacture of a transmitter based on a microcontroller. The well-known Arduino platform is well suited for training and breadboard assembly. You will need any board (the requirements for inputs and outputs in this project are minimal), an appropriate network interface or module for providing remote access, an infrared LED and just a couple of additional details. Examples of such devices on the network can be easily found and adapted for your tasks (see, for example, an option from SparkFun ).
It is also advisable to purchase an IR receiver module, which is required to study the protocol of your air conditioner. Note that one of the main parameters of the physical IR protocol is the modulation frequency (the most common values are 38 and 36 kHz). It is possible to “teach” one device to transmit data at different frequencies, but the receivers are tuned to a fixed value, so it may take several.
The next step is to decrypt the control protocol of your air conditioner. On the remote control there is usually a basic set of buttons - increase and decrease the temperature, select a mode, control the fan, select the direction of the air outlet, turn off.
Unlike audio-video equipment, the air conditioner remote control in each command sent uses a complete set of all parameters. So the traditional option of “pushing buttons, recording all commands, playing back recordings”, which generally does not require knowledge of the protocol details, is not suitable here.
In our case, first you need to make records in which only one parameter changes, for example, temperature. Then fix it and try to change another parameter by writing data to the second group. Note that if you use Arduino, then, most likely, you need to fix the files of the standard library to increase the maximum duration of the recorded command in RAW mode.
Without going into details, we show a few examples. The output from Global Cache in the iLearn proprietary utility might look like this:
For the IRremote library in Arduino, the output format is different:
By simple manipulations from the data of the recorded lines (for example, materials from this site can help here ), we get binary codes, which, in our case, are nine bytes in size. Having studied all the parameters, it was possible to find out the coding used by our air conditioner, produced by not the most famous brand, fields:
Based on these data, it is already easy to write a program for creating the required binary codes for air conditioning control for both Global Cache and Arduino. In this case, it is advisable to use a controller or a panel with programming support, which will allow you to generate the necessary commands "on the fly", recording all the parameters in them, as the original remote control does. In particular, in iRidium Mobile for this purpose you can use the ability to program in JavaScript, and for sending to the executive device via a local network, you need the AV & Custom Systems driver.
Note that here you can also implement the display of the current mode of the air conditioner. However, one must be aware that the information will be taken from the internal variables of the control panel, and not directly from the air conditioner, since the IR control is in this case one-sided.
In the case of using several air conditioners in one room, as well as for more reliable delivery of IR commands, it may be necessary to install IR LEDs directly on the windows of the receivers of each device.
If there is only one air conditioner in the room, one correctly installed IR transmitter may be sufficient, which is also useful for controlling other equipment, such as a fan or a music center.
If necessary, the control system can be supplemented with real temperature sensors, an air conditioner consumption sensor (to control its inclusion), a window sensor to block operation, automatic control modes, taking into account the dynamics of street temperature, a schedule and other features.
The most convenient way to control the air conditioner is to connect to it via a specialized interface that provides not only the sending of commands, but also status monitoring, as well as information on the status and possible malfunctions. However, this option is available only in certain models, it may require the purchase of additional units and it can hardly be called affordable. However, today, with the proliferation of standards such as AllJoyn, HomeKit, and SmartThings, similar models are beginning to appear in the more mass segment.
Fortunately, there is another way to control the air conditioner - using the infrared channel. The advantages of this approach include versatility (one IR transmitter can simultaneously serve various equipment in the room) and low cost. The downside is the complete lack of feedback from the managed device. In addition, this solution does not even guarantee the delivery of commands. How suitable this method is for you to decide, however, in our opinion, the availability of such an option is better than a complete lack of control.
Choose equipment
Let's see what options are there for sending IR commands. One of the most popular and universal today can be called devices manufactured by Global Cache. The product line includes a dozen models that provide control and management via IR, RS-232 and dry contacts. We recommend these reliable solutions for this task as part of a professional installation, for which you will have to bear responsibility.
To work with all transmitters, a network interface (wired or wireless) and a protocol based on TCP / IP are used. Having detailed documentation makes it easy to integrate these solutions into your automation system. Note that the iRidium software package has a built-in configuration database for Global Cache equipment, which simplifies working with them even more.
The downside of the devices of this manufacturer is their rather high cost. As a more affordable alternative, especially for those who like to do everything with their own hands, we can call the manufacture of a transmitter based on a microcontroller. The well-known Arduino platform is well suited for training and breadboard assembly. You will need any board (the requirements for inputs and outputs in this project are minimal), an appropriate network interface or module for providing remote access, an infrared LED and just a couple of additional details. Examples of such devices on the network can be easily found and adapted for your tasks (see, for example, an option from SparkFun ).
It is also advisable to purchase an IR receiver module, which is required to study the protocol of your air conditioner. Note that one of the main parameters of the physical IR protocol is the modulation frequency (the most common values are 38 and 36 kHz). It is possible to “teach” one device to transmit data at different frequencies, but the receivers are tuned to a fixed value, so it may take several.
We study the protocol
The next step is to decrypt the control protocol of your air conditioner. On the remote control there is usually a basic set of buttons - increase and decrease the temperature, select a mode, control the fan, select the direction of the air outlet, turn off.
Unlike audio-video equipment, the air conditioner remote control in each command sent uses a complete set of all parameters. So the traditional option of “pushing buttons, recording all commands, playing back recordings”, which generally does not require knowledge of the protocol details, is not suitable here.
In our case, first you need to make records in which only one parameter changes, for example, temperature. Then fix it and try to change another parameter by writing data to the second group. Note that if you use Arduino, then, most likely, you need to fix the files of the standard library to increase the maximum duration of the recorded command in RAW mode.
Without going into details, we show a few examples. The output from Global Cache in the iLearn proprietary utility might look like this:
sendir, 1: 1,24,37914,1,1,116,115,116,168,22,62,21,20,22,62,21,20,22,20,21,62,22,20,21,62,21,20, 21.63,21.62,21,21,21,20,21,21,21,62,21,62,21,20,22,20,21,62,22,62,21,20,22, 20,21,62,21,21,21,20,22,20,21,21,21,62,21,21,21,62,21,62,21,21,21,20,21,21, 21,21,21,20,21,63,21,62,21,20,21,21,21,62,21,63,21,20,21,21,21,21,21,20,21, 21,21,20,21,21,21,21,21,62,21,21,21,20,21,21,21,20,21,21,21,21,21,20,21,21, 21,21,21,20,21,21,21,20,21,21,21,21,21,20,21,63,21,62,21,62,21,63,22,20,21, 21,21,3700
For the IRremote library in Arduino, the output format is different:
Raw (150): 4316 3050 -3000 3050 -4350 600 -1600 550 -550 550 -1600 600 -500 550 -550 550 -1600 600 -500 600 -1550 550 -550 650 -1500 600 -500 650 -450 550 - 550 600 -1550 550 -1600 600 -500 650 -450 650 -450 600 -1550 650 -450 600 -500 600 -500 600 -450 650 -450 600 -500 600 -450 650 -1550 550 -550 600 -1550 550 -550 600 -500 600 -450 650 -450 650 -450 600 -500 600 -500 600 -1550 600 -1550 600 -500 650 -450 600 -500 600 -500 550 -500 600 -500 600 -500 600 -500 600 -450 650 -450 600 -450 650 -450 650 -1550 600 -500 600 -500 600 -450 650 -450 600 -450 650 -450 600 -500 600 -500 600 -500 550 -500 650 -450 650 - 450 600 -450 650 -450 600 -1600 600 -500 500 -1650 600 -1550 650 -1550 600 -1550 650 -1550 600
By simple manipulations from the data of the recorded lines (for example, materials from this site can help here ), we get binary codes, which, in our case, are nine bytes in size. Having studied all the parameters, it was possible to find out the coding used by our air conditioner, produced by not the most famous brand, fields:
10100101 tttt011p dd100000 00101000 00001100 ff000000 mmm00000 00000000 ssssssss tttt: preset temperature -16 (adjustment - from 16 to 30 degrees) p: 0 - enable, 1 - disable dd: swing (00 - auto, 01 - up, 10 - down, 11 - movement) ff: fan (00 - auto, 11 - first speed, 10 - second speed, 01 - third speed) mmm: mode (000 - auto, 001 - cooling, 010 - drain, 011 - heating, 100 - fan) ssssssss: checksum (the sum of the first eight bytes modulo 256)
We manage
Based on these data, it is already easy to write a program for creating the required binary codes for air conditioning control for both Global Cache and Arduino. In this case, it is advisable to use a controller or a panel with programming support, which will allow you to generate the necessary commands "on the fly", recording all the parameters in them, as the original remote control does. In particular, in iRidium Mobile for this purpose you can use the ability to program in JavaScript, and for sending to the executive device via a local network, you need the AV & Custom Systems driver.
Note that here you can also implement the display of the current mode of the air conditioner. However, one must be aware that the information will be taken from the internal variables of the control panel, and not directly from the air conditioner, since the IR control is in this case one-sided.
In the case of using several air conditioners in one room, as well as for more reliable delivery of IR commands, it may be necessary to install IR LEDs directly on the windows of the receivers of each device.
If there is only one air conditioner in the room, one correctly installed IR transmitter may be sufficient, which is also useful for controlling other equipment, such as a fan or a music center.
If necessary, the control system can be supplemented with real temperature sensors, an air conditioner consumption sensor (to control its inclusion), a window sensor to block operation, automatic control modes, taking into account the dynamics of street temperature, a schedule and other features.