Controlling an AC Infinity Cloudline EC fan using an ESP32 microcontroller and the ESPHome firmware can seem daunting at first, but with the right steps and guidance, it can be achieved even by beginners. Here is an idiot's guide to getting an ESP32 to control AC Infinity Cloudline EC fans using ESPHome and Home Assistant (HA).
Step 1: Gather your materials You'll need the following materials to get started:
- An ESP32 microcontroller
- An AC Infinity Cloudline EC fan
- A breadboard and jumper wires
- A USB cable
- A computer with an internet connection
- Home Assistant installed on your computer
Step 2: Connect your ESP32 to your computer Use your USB cable to connect your ESP32 to your computer. Once connected, open up the Arduino IDE and select the correct COM port for your ESP32.
Step 3: Install ESPHome ESPHome is a firmware that enables you to control your ESP32 devices using Home Assistant. To install it, follow these steps:
- Open Home Assistant on your computer.
- Click on "Supervisor" in the sidebar menu.
- Click on "Add-On Store."
- Search for "ESPHome" and install it.
- Once installed, open the ESPHome dashboard.
Step 4: Configure ESPHome for your fan
- Click "Create a new ESPHome device."
- Enter a name for your device.
- Select "ESP32" as your device type.
- Enter the Wi-Fi information for your network.
- In the "Pinout" section, set the pins that you will be using to control the fan. For example, you might set Pin 12 as your control pin.
- In the "API" section, enable the API for your device.
Step 5: Create a configuration file
- Click on "Edit" to create a new configuration file.
- In the configuration file, add the following code:
yamlCopy code
esphome:
name: my_ac_infinity_fan
platform: ESP32
board: esp32dev
wifi:
ssid: "YOUR_SSID"
password: "YOUR_PASSWORD"
# Configure a web server on port 80
web_server:
port: 80
api:
password: "YOUR_PASSWORD"
output:
- platform: gpio
pin: 12
id: fan_output
fan:
- platform: ac_infinity
output: fan_output
model: 'CLOUDLINE S6'
rotation_speed:
name: "Speed"
speeds:
- low
- medium
- high
This code sets up your ESP32 device and your fan. It sets the fan output to Pin 12 and configures the fan model as "CLOUDLINE S6". It also sets up the fan's speed settings.
Step 6: Upload the configuration file
- Save your configuration file.
- In the ESPHome dashboard, click "Compile."
- Once the compile is complete, click "Upload."
Step 7: Control your fan using Home Assistant
- Open Home Assistant on your computer.
- Click on "Configuration" in the sidebar menu.
- Click on "Integrations."
- Search for "ESPHome" and add it.
- Once added, you should see your fan device.
- Click on the fan device to control it.
That's it! You've successfully controlled an AC Infinity Cloudline EC fan using an ESP32 microcontroller and ESPHome.