QuietCool AFG SMT PRO-2.0 attic fan with Home Assistant via ESPHome

Fun little weekend project: I got a QuietCool AFG SMT PRO-2.0 attic gable ventilation fan that was “smart” in the sense that it came with a Bluetooth-based, proprietary app for configuring the fan with temperature thresholds, timers, etc. But I have an existing Home Assistant setup in my home, and for “smart” to be useful to me, it needs to show up in Home Assistant as a switch that I can turn on and off in response to the many sensors I already have configured there.

The fan itself

I was pleased to learn that the “smart” controller used for this fan is an ESP32, which means that a robust open-source ecosystem exists to replace its firmware with something that works directly with Home Assistant. Even better, it has a Wifi controller on-board, even though the fan controller is sold as a Bluetooth-only.

I found these excellent instructions for flashing the fan with Tasmota, an open-source firmware that is more general purpose and not natively integrated with Home Assistant.

Instead, I wanted to use ESPHome, a system that uses YAML files to declare what sensors and actuators are available and integrates natively into Home Assistant.

So I used the first instructions to locate the pins I needed to connect the smart controller to a FTDI adapter to back up the factory firmware and flash on ESPHome. First I disconnected the smart control box from the high-voltage supply (important!) and opened it up so I could get to the main PCB. There are six relevant pins: two you short to put the device into “bootloader” mode, and four corresponding to power, ground, transmit, and receive:

Image from the Tasmota guide showing pinouts for the serial connection.

To make things easier, I soldered on headers for these:

I used this USB-to-serial adapter that came with a ribbon cable to connect the board to my Mac. No drivers or anything were required–it showed up as /dev/cu.usbserial-XXXXXXXX.

For safety, I pulled a backup of the factory firmware:

brew install esptool
esptool -b 115200 --port /dev/cu.usbserial-BG01OKCI read_flash 0x000000 0x400000 quietcool_backup_flash_4M.bin

After this, the real magic of Home Assistant started to shine. Using the ESPHome Builder described in the setup guide and a bit of help from Claude, I created a YAML file that described the attic fan, including exposing a ‘fan’ entity. I was able to flash it directly from my browser using Webserial–how cool–even though the Home Assistant server was off in my utility closet.

After the compilation of the firmware and flash (which took about 5 minutes), I pulled the bootloader jumper and power cycled the board, and it was automatically detected by Home Assistant:

Finally I reassembled the smart controller box and connected it back up to high-voltage supply and the inputs to the fan and it all worked like a charm. I’m definitely going to looking for more of these ESP-based devices to incorporate in the future…