Transforming an Old Ceiling Fan into a Smart Device: A DIY Success Story

I’m thrilled to share my recent success in transforming an old Westinghouse ceiling fan into a smart device using ESPHome and a few components from AliExpress. This project was a labor of love, combining my passion for DIY electronics and smart home automation. Here’s how I did it and what I learned along the way.**The Challenge:**The fan, which had been in my home for years, was controlled by an old remote that was losing its functionality. I wanted to integrate it into my smart home ecosystem without replacing the entire unit. The goal was to make the fan fully controllable through my Home Assistant setup, allowing me to adjust speed, toggle the light, and automate its operation.**The Solution:**I decided to use ESPHome as an IR blaster. After some research, I purchased an IR receiver and transmitter module, along with a small transistor to ensure proper power supply to the IR LEDs. The transmitter was connected to an ESP32 board, which I programmed using ESPHome.**The Process:**1. Capturing IR Codes: The first step was capturing the IR codes from the original remote. This was a bit tricky because the remote sent codes rapidly upon button press. I had to press the buttons briefly to get a single code. After several attempts, I managed to capture all the necessary codes for toggling the light, adjusting brightness, and controlling fan speed.2. Setting Up ESPHome: I configured the ESP32 to act as an IR transmitter. The code was added to my ESPHome setup, and I created buttons in Home Assistant to trigger the IR codes. This involved setting up remote_transmitter in the ESP32 configuration and defining buttons for each function (toggle light, adjust brightness, change fan speed).3. Creating a Virtual Fan in Home Assistant: To make the fan fully integrated into Home Assistant, I used the template fan integration. This required setting up two helper entities: an input_boolean to track the fan’s on/off state and an input_number to control the fan speed. The configuration involved mapping the virtual fan’s states and actions to the appropriate IR codes.4. Testing and Fine-Tuning: The initial setup worked, but I noticed that the brightness control wasn’t as responsive as I hoped. Sending the IR code multiple times was necessary to achieve a noticeable change. While this wasn’t ideal, it was still functional and met my basic needs.Challenges Faced:- IR Signal Strength: The first IR transmitter I bought didn’t have enough power to reach the ceiling fan. Upgrading to a module with a small transistor solved this issue.- Code Capture: The remote’s rapid firing of IR codes made capturing individual codes challenging. Patience and multiple attempts were key.Lessons Learned:- Documentation is Key: Having detailed logs of the IR codes and their functions was crucial for troubleshooting.- Community Support: The ESPHome and Home Assistant communities were invaluable resources. Forums and documentation provided the guidance I needed when I got stuck.**Final Thoughts:**This project was a rewarding experience. It not only saved me from replacing an otherwise functional fan but also deepened my understanding of IR blasters and smart home integration. The satisfaction of seeing an old device come to life with new smart features is unparalleled.If you’re considering a similar project, my advice is to start small, document everything, and don’t hesitate to reach out to the community for help. The learning curve is worth it, and the results are truly satisfying.Happy tinkering! :rocket: