Integrating Casafan Ceiling Fan Controller with Home Assistant

I recently came across the Casafan 433MHz ceiling fan controller and was curious about integrating it into my Home Assistant setup. After some research, I found that there isn’t a built-in integration for this specific controller, but I discovered that with some tinkering, it’s possible to make it work using MQTT and a Raspberry Pi. Here’s how I approached it:

  1. Hardware Setup: I connected the Casafan controller to a Raspberry Pi using a GPIO-to-433MHz module. This allowed me to send and receive signals from the controller.

  2. Software Configuration: I installed the MQTT integration in Home Assistant and set up a custom component to handle the communication between the controller and the MQTT broker. This involved writing a small Python script that listens for commands from Home Assistant and translates them into the appropriate 433MHz signals.

  3. Testing: Initially, I faced some challenges with signal interference, but after adjusting the GPIO settings and ensuring proper grounding, everything started working smoothly. I was able to control the fan speed, toggle the light, and even set up scenes for different modes (e.g., ‘Reading’, ‘Sleeping’).

  4. Integration with Automations: I integrated the fan controller into my existing automations. For example, when I leave the room, the fan automatically turns off, and when I turn on the lights in the evening, the fan adjusts to a preset speed.

This project was a great learning experience, and I’m thrilled to have a fully integrated ceiling fan system that works seamlessly with my smart home setup. If anyone has questions or needs help with a similar project, feel free to reach out!