MaxxFan Integration with Home Assistant: A Smooth Setup Journey

Hey everyone! :wave: I wanted to share my recent experience integrating a MaxxFan into my Home Assistant setup. It’s been a fantastic project, and I thought I’d walk through my process in case it helps anyone else looking to do something similar.

My Setup Goals

I’ve been wanting to automate my ceiling fan for a while now, and the MaxxFan seemed like the perfect fit. My main objectives were:

  • Remote Control: Operate the fan via Home Assistant and my existing IR remote.
  • Manual Control: Ensure the fan’s built-in controls still worked seamlessly.
  • Real-Time Status: Have Home Assistant keep track of the fan’s current state, like speed and operation mode.

The Hardware & Software Setup

I decided to go with an ESP32 module for its reliability and versatility. Here’s what I used:

  • Controller: ESP32 D1 Mini
  • Power Supply: 5V tapped directly from the MaxxFan’s electronics
  • Relays: 4x 5V NO relays to simulate manual button presses
  • Current Sensor: INA219 to monitor the motor’s current draw

The INA219 was crucial for calculating the fan’s speed percentage. By measuring the current, I could determine the fan’s speed and send that data back to Home Assistant. For example, a current reading of 720-760mA corresponds to 50% speed. It’s a neat workaround since direct speed feedback wasn’t an option.

Challenges & Solutions

While the setup was mostly smooth, I did run into a few hurdles:

  1. Variable Handling: I needed to figure out how to pass calculated values like the fan’s speed percentage to Home Assistant. After some research, I learned how to define variables in my ESP32 code and ensure they were recognized by Home Assistant.
  2. Automation Logic: To make things easier for myself, I wanted to handle as much logic as possible on the ESP32 side. This meant writing code to interpret the current sensor data and translate it into meaningful states that Home Assistant could display.

Current Status

After a few weeks of tweaking and testing, everything is running smoothly! I can now:

  • Control the fan via my IR remote, the fan’s manual controls, or through Home Assistant.
  • See the fan’s current speed percentage and operational status in Home Assistant.
  • Set up advanced automations, like adjusting the fan speed based on room temperature or occupancy.

It’s been incredibly satisfying to see this project come together. The MaxxFan integration has really taken my smart home setup to the next level!

Looking Forward

I’m already brainstorming ways to expand this setup. Maybe adding voice control through Google Assistant or integrating it with my smart thermostat for even more seamless automation. The possibilities are endless!

If anyone has questions or wants more details about my setup, feel free to ask! I’d love to help others on their smart home journey. :rocket:

Cheers,
Marc