Hi everyone, I wanted to share my recent DIY project where I successfully integrated my ceiling fan with voice control using Google Mini. It was a fun challenge and I hope this post can inspire others to tackle similar projects!
The goal was to control my ceiling fan’s speed using voice commands. The fan is operated by an IR remote with three speed settings, which I wanted to automate. Here’s how I approached it:
1. Hardware Setup
I started by flashing an ESP8266 module with Tasmota IR firmware. This was crucial as it allowed me to handle IR signals wirelessly. I also built a simple circuit using an IR transmitter LED, which I sourced from an old remote control. The setup included a 5V adapter and a case to keep everything neat.
2. Tasmota Configuration
After setting up the hardware, I configured Tasmota to handle IR signals. I used pin D1 for IR RX and pin D5 for IR TX. The MQTT settings were a bit tricky, but I managed to connect it to my Synology NAS broker. Setting up the correct MQTT topic was essential for communication between the ESP8266 and Homey.
3. Virtual Switches and Automation
To handle the voice commands, I created four virtual switches in Homey. Each switch corresponds to a specific fan speed. When Google Assistant receives a command like “Okay Google, Fan speed 2 on,” it triggers the corresponding switch, sending the appropriate IR command to the fan.
4. Challenges and Solutions
One hurdle was getting consistent IR codes. Initially, all buttons on my remote gave the same code, so I had to switch to RAW IR commands. This involved modifying the Tasmota settings and carefully capturing the raw codes from the remote. Once I had the codes, I formatted them correctly and tested them through MQTT.
5. Final Setup
The final setup involved creating an advanced flow in Homey. When a virtual switch is triggered, it sends the correct IR command to the fan and updates the speed logic. This ensures that the fan starts at the last used speed when turned on again.
Tips for Success
- Test Each Component: Before integrating everything, test each part individually. This helps identify issues early.
- Use RAW IR Commands: If standard codes don’t work, switching to RAW commands can provide more flexibility.
- Document Everything: Keep a record of your settings, codes, and configurations. It will save you time if you need to troubleshoot later.
This project has been a great learning experience, and I’m excited to see how others might adapt this setup for their homes. If you have any questions or suggestions, feel free to reach out!
Happy tinkering! ![]()