Skip to content

Repository files navigation

Universal A/C IR Control For Home Assistant (ESPHome Project)

This ESPHome project turns an ESP32 module combined with a BC7215 module into a universal A/C IR remote control that integrates seamlessly with Home Assistant. It supports one-step pairing with almost any air conditioner.

You can control your air conditioner through Home Assistant if:

  • Your air conditioner uses an IR remote control.

  • The original AC remote features an LCD screen that displays the temperature.

Bonus: Any operations made using the original IR remote will also be synchronized back to Home Assistant in real time!

This project has also been ported to Matter protocol, which will not only work with Home Assistant, but also directly with Apple Home, Google Home etc, any system that supports Matter in theory. Link: https://github.com/timj-code/bc7215_ac_matter

A casing 3D model is provided, if you have a 3D printer, you can make this device look like a real product. The casing is designed to be placed somewhere near the AC unit, such as at a desk top beneath the AC, so you can adjust the angle to let the IR LED and receiver to both face to the correct direction. Let the IR LED point to the AC unit while the receiver is facing towards the remote control.

More details about casing is here.

This graph explains how this device works:

Installation Methods

There are two ways to install the firmware on your ESP32:

Method 1: Web Install (Recommended)

This is the easiest and fastest way to get your device up and running. No ESPHome installation or command-line operations are required—everything is done directly in your web browser.

*Note: The only limitation is that your hardware setup must match the default configuration. *

Many people including myself found the Super Mini modules bought on market often have WiFi problems(PRO version is much better), so I changed the design a bit so it can be compatible with both ESP32C3 XIAO and Super Minit, and also a version for classic ESP32 is provided.

XIAO is recomended as I found it has very good WiFi reception. As the boards are slightly different in dimensions, there are 3 files for the bottom part of the casing: For XIAO, for Super Mini, and for Mini Pro version.

Connections for the ESP32-C3 XIAO:

Connections for the ESP32-C3 Super Mini (PRO) :

*Note: It's different from the original (V1.4 or earlier), the support for the old connection has been removed since V1.6.

Connections for the Classic ESP32:

Once the hardware is ready, open the following page and follow the on-screen instructions:

https://timj-code.github.io/bc7215_ac_esphome/

Trouble Shooting:

Some users may experience issues configuring Wi-Fi after installation. This is most likely because the download serial port of the ESP32-C3 module is emulated by its internal USB peripheral. After firmware flashing and a subsequent reboot, the USB re-enumerates, which causes the host computer to detect a change in the COM port.

If you encounter this issue, the easiest way to connect is via AP mode:

  1. Power on the device and wait for about 1 minute.

  2. On your computer or mobile phone, connect to the Wi-Fi hotspot named "BC7215_AC_Setup_psw_12345678".

  3. Enter the password "12345678".

  4. Follow the on-screen prompts to complete the Wi-Fi setup.

Method 2: Clone and Compile (Custom Setup)

This method allows you to use any ESP32 variant and customize the GPIO pins to your preference. You will just need to modify the hardware configurations in the bc7215_ac_ctrl.yaml file.

Platform definition section:

esp32:
  variant: esp32c3

BC7215 module pin definition section:

climate:

- platform: bc7215_ac
  id: ac_controller
  name: "Air Conditioner"

  bc7215_uart_num: 1
  bc7215_tx_pin: GPIO4
  bc7215_rx_pin: GPIO3
  bc7215_busy_pin: GPIO5
  bc7215_mod_pin: GPIO6

**Important Note: Do not select a UART port that conflicts with the download/programming port. Also, avoid using GPIO pins that are already assigned to other hardware components (such as LCDs, LEDs, or buttons).

Step 1: Clone the project

Because this project relies on git submodules (the AC control library and examples from GitHub - bitcode-tech/bc7215_ac_lib · GitHub), do not download it as a ZIP file. You must use the git clone --recursive command to fetch all required dependencies:

git clone --recursive https://github.com/timj-code/bc7215_ac_esphome.git

Step 2: Modify hardware settings

Open bc7215_ac_ctrl.yaml and adjust the processor type and I/O pin configurations to match your specific hardware setup.

Step 3: Configure Wi-Fi

Rename the secrets.yaml.template file to secrets.yaml, then open it and enter your Wi-Fi SSID and password.

Step 4: Compile & Install

Run the following command in the project root directory:

esphome run bc7215_ac_ctrl.yaml

Alternatively, you can launch the ESPHome Device Builder:

esphome-device-builder .

And complete the installation via your browser.

Note: The first installation must be done via a physical USB-to-serial connection. Subsequent updates can be done over-the-air (OTA), so you won't need to plug the device into your computer again.

Usage & Pairing Guide

Once the hardware is connected and the firmware is flashed, a new air conditioner device will appear in Home Assistant. This device includes:

  • A climate control entity (A/C controller)

  • Two action buttons

  • A Text Sensor to display real-time status info

How to Pair

Before you can control your A/C, you must pair the module with your unit. This is a simple one-step process that doesn't require knowing your A/C's brand or model, as the underlying library automatically detects the IR protocol.

To pair, you need to transmit a specific IR signal from your original remote to the BC7215 module. The remote must be set to Cooling Mode at 25°C.

(Note for Fahrenheit users: If your A/C uses Fahrenheit, set it to 78°F. You may also need to adjust the configuration in your YAML file. Since I don't own a Fahrenheit-based A/C, this mode is currently untested—feedback is highly welcome!)

Pairing Steps:

  1. Set your original A/C remote to Cooling Mode at 25°C.

  2. Look at your device's interface in Home Assistant (it should look similar to the image below):

    Buttons and status display

  3. Click the Pair Button in Home Assistant. The Text Sensor will update to:

    Pairing: press Fan with 25°C/Cool mode

  4. The blue LED on the BC7215 module will light up. Now, point your original remote at the module and press the Fan Speed button.

  5. Pairing is usually instantaneous (though Home Assistant might take a brief second to reflect the state). Once successful, the status will update to:

    1. AC Paired

You can now fully control your air conditioner via Home Assistant! The blue LED on the BC7215 module will remain illuminated, indicating it is continuously listening for IR signals. This allows Home Assistant to stay perfectly in sync whenever you use the original physical remote.

Configure User Button

The basic code can let you control the most frequently used Temperature, Working Mode and Fan Speed of the AC, however, there are many other functions on the AC, the user button will let you to control an extra function of your choice, for example "Swing" or "Sleep" etc.

How Does it work?

Unlike the IR for an A/V device, the IR for the AC contains all the control information in a single IR frame. In the pairing step, the ESP32 stores an IR frame as the 'base', then when you change settings, it will edit the corresponding part of the base to generate a new IR signal. The control for 'Swing' or 'Sleep' was already in there, but kept unchanged.

The user button let you to record an extra IR frame with the desired control information in and use it to replace the normal 'base' when you want to control that function.

Steps:
  1. Pair the device with AC as described above, but keep in mind you are going to setup the "User Button" later, so let the extra function be "OFF" when you do the pairing. We'll use 'Swing' as example below.

  2. Press "Pair Button" again, the text area will show "Press User Button to learn a user function, or send 25°C Cool to re-pair."

  3. Now press the "User Button" in HA, the text message will show "User function learning: Press the remote button to be learnt."

  4. Press the 'Swing' button on the remote, after this, the 'Swing' function will "ON" on the remote, and you finished the configuration.

  5. When you want to turn the swing on, you press the "User Button" in Home Assistant, and the swing will keep "ON" no matter what Temperature or Mode your set until you press the "User Button" again.

Tips & Cautions
  1. The title of the button in Home Assistant can be changed, so you can change the "User Button" to a more meaningful name.

  2. You can let it control more than 1 function if you like, for example, if there are both "Swing horizontally" and "Swing Vertically" functions, you can control them simultaneously by setting them both OFF and ON during setup.

  3. As ESP32 will keep listening to the IR and replace the base to sync status with the remote, if you operated the "User Button" controlled function from the remote, you must change it back by the remote too, otherwise the working base and the user button replaced base may have the same status and this will make the button looks like stop working.

What does the "Alt Button" do?

According to the BC7215 AC library documentation, a small number of air conditioners may fail to pair, or may pair successfully but still cannot control the AC. This button is only intended to be used in such situations. In my program design, each press switches to another built-in special protocol and sends a test signal. If you find that the air conditioner responds after switching to a certain protocol, that should be the setting capable of controlling your air conditioner. Since I have not encountered an air conditioner that cannot be controlled, I have not been able to test this feature myself. Feedback from users who encounter this situation would be appreciated.

About

Using BC7215 module turn any air conditioner with IR remote to a smart AC and connect into Home Assistant immediately.

Resources

Stars

138 stars

Watchers

9 watching

Forks

Releases

Packages

Contributors

Languages