Let me introduce a solution to build a universal air conditioner controller at extremely low hardware cost here. It will control any air conditioner without relying on any external IR libraries and require nearly zero programming. Upon power-on, it can be directly discovered by Home Assistant (requires MQTT plugin) and be recognized as an air conditioner controller. Without any configuration, you can directly control the air conditioner in Home Assistant.
If appropriate plugins are installed, it can connect to various voice assistants, such as Google Assistant, Alexa, Apple Siri, Xiaomi AI Speaker etc.
Compared to those network-relied “universal IR remotes” sold on the market, this project has the distinct advantage of receiving and decoding IR commands and synchronizing them to HA, in addition to not requiring internet access or dedicated applications. This means that besides controlling the air conditioner through Home Assistant, you can continue using the original IR remote. Any new changes will be synchronized to HA, preventing the state displayed in HA from being out of sync with the actual air conditioner status.
Solution Highlights:
- 1-press pairing with any brand/model of air conditioner, no need to select through thousands of brands and models and test one by one
- Automatic integration with Home Assistant
- Comes with an LCD display and buttons, allowing direct operation and control of the air conditioner (ESP32 solution)
- Receives and decodes IR remote control signals and relay them to HA, keeping HA synchronized with the air conditioner status
- Hardware is simple and easy to build,
Required Hardware:
- Arduino module, with a choice between ESP32 and ESP8266. The selected ESP32 TTGO T-Display module comes with an LCD and has buttons that can be used as an air conditioner remote control itself; if seeking low cost, the ESP8266 NodeMCU module without a display can be used.
- BC7215A IR module, which provides universal IR transmission and reception functionality.
Here’s the price of the modules used in this project on Aliexpress:
- ESP32 TTGO T-Display : $5
- ESP8266 NodeMCU : $1
- BC7215A module : $3
So the total cost can be just under $5
Software Environment:
- Home Assistant must already be installed
- The MQTT plugin installed
- A local MQTT server is required. Although a free public MQTT server can be used, using a local server allows for non-encrypted communication and extremely low latency. The MQTT server is very small, only a few hundred kilobytes, and does not increase server load, so local installation is strongly recommended.
- Arduino IDE, used for compiling and flashing the firmware. The following three Arduino libraries need to be installed:
- TFT_eSPI – LCD driver (only required for ESP32)
- PubSubClient – MQTT driver
- BC7215AC – Universal air conditioner driver
All three libraries can be installed directly from the IDE’s Library Manager.
Solution System Block Diagram:
Hardware Connection:
ESP32 Board:
ESP8266 Board:
Software Environment Preparation:
MQTT Server: Mosquitto
The installation method depends on whether you install it directly or use Docker. Please search online for the installation method based on your specific situation.
HA MQTT Plugin
The Mosquitto server is set to use unencrypted anonymous account by default, that is good enough for our local application. So configure the MQTT plug-in as follows:
- Broker: Enter the IP address or domain name of your MQTT server (e.g., 192.168.1.100).
- Port: Default is 1883.
- Username: Leave blank
- Password: Leave blank
- Client ID: Leave blank
The HA side is now ready to use.
Arduino Board Preparation
Hardware
Choose ESP32 or ESP8266 based on your needs. The BC7215AC Universal Aircon Control Library already provides two working examples, which can be downloaded to the board to immediately and works with HA right away.
The difference between the two examples is: The ESP32 solution uses a module with an onboard LCD screen, which can display temperature and AC mode etc, it also has two buttons, allowing the ESP32 board itself to be used as a remote control; while the ESP8266 solution has no display, it is the most minimalist solution, using only an onboard LED and one button for necessary operations.
After selecting the ESP module, connect it to the BC7215A module according to the circuit diagram above, and the hardware is ready.
Software
Open the Arduino IDE, search for the BC7215AC Universal AC control Library in the Library Manager or install it directly via a zip file. Then, open the example programs that come with the library. The two HA examples are called ESP8266_MQTT_HA and ESP32_MQTT_HA.
However, they cannot be compiled directly after opening because the parameters for WIFI and the MQTT IP address are hardcoded in the program. Therefore, you need to change them to your own before they can be compiled. The definitions are at the very beginning of the program:
#define MY_WIFI_SSID
#define MY_WIFI_PASSWORD
#define MY_MQTT_IP
Once these parameters are filled in, the program can be compiled and downloaded.
Pairing with the Air Conditioner
The final step before controlling the air conditioner is that the ESP32/8266 board must be paired with your air conditioner. The pairing operation is also very simple, requiring only one step regardless of the air conditioner brands.
1. Prepare the original IR remote control and set it to “Cooling mode, 25°C”, or “Cooling mode, 78°F”
2. Depending on the ESP board you are using, follow different procedures to finish pairing
ESP32 Board:
After the first time flashing and powering on, it will automatically enter the main menu. If it has been paired before and you need to re-pair, long-press both keys simultaneously for 3 seconds to enter the main menu. Once in the menu, set the temperature unit (°C/°F) first then use the left key to choose the second item, “Pair with A/C,” and press the right key OK. A prompt will appear, asking you to prepare the A/C remote to “Cooling mode 25 degrees.” Since we have already prepared it, press OK to enter pairing mode.
The blue light on the BC7215A module will turn on, indicating it is in receiving mode. At this point, aim the IR remote control at the IR receiver of the BC7215A module and press the “Fan Speed” button. Normally, the blue light will subsequently turn off, and the LCD will display “Pairing OK.” Pressing the OK button returns to the main screen, and you can control the air conditioner now! If your MQTT configuration is correct, the “MQTT” icon will also appear on the LCD.
ESP8266 Board:
The ESP8266 board does not have an LCD and relies only on an onboard LED and one button for interaction, making the operation less straightforward than the ESP32 board. The board has an RST (reset) button and a FLASH button. Long-press the FLASH button for 3 seconds, and the onboard LED will start flashing, waiting for pairing.
At this time, simply aim the IR remote control at the BC7215A module and press the “Fan Speed” button to complete the pairing. (Remote must be set to “Cooling mode 25 degrees”. For ESP8266 temperature unit is set to Celsius by default, For Fahrenheit ACs you must add a line ac.setFahrenheit() in the code before pairing.)
When pairing is successful, the ESP8266 onboard LED will briefly flash every 3 seconds to indicate the working status.
Unlike the ESP32 board, after successful pairing, the ESP8266 program keeps the BC7215A module in receiving mode to continuously receive IR remote control signals to synchronize the air conditioner status to HA. It only switches to transmitting mode when it receives a command from HA to change the air conditioner status.
HA Operation
After successful pairing, and if the MQTT settings are correct, our BC7215 air conditioner controller will automatically appear in HA. Without further settings, you can directly use it to control the air conditioner. If you are using the ESP8266 board, you can still control the air conditioner with the IR remote, while keeping the air conditioner status updated in HA, that’s cool! For the ESP32 board, you need to set the board to “Parse” mode via the menu to synchronize IR remote actions to Home Assistant, or modify the code a bit by yourself.
Notes
Similar to using a regular remote control, the IR transmitter on the board should be roughly aimed at the air conditioner for best effect. Enthusiasts can modify the circuit to use multiple infrared emitters pointing in different directions, so that no matter how the device is placed, it does not affect the air conditioner’s reception.
Similarly, for the ESP8266 board’s receiving function, the BC7215 board’s receiver should be placed in a position where it can receive the IR signal.
Voice Control
Voice control can be easily achieved by using plug-ins, I have tested successfully with Google Assistant, Alexa, and Xiaomi, but this topic is beyond the scope of this post, will discuss about it in a new post if necessary.







