#4: Complicated Ceiling Fan Automation
Hardware Review Home Assistant

#4: Complicated Ceiling Fan Automation

William Zink

Introduction

As I renovated something kept slowing me down and that was ceiling fans. I didn't know what to go with. There were so many options but the community didn't have a great answer. They said I could go with an RF transmitter and mimic the controller, but I didn't really want a device laying around. Although if you are considering this, it's an option. Fanimation supports Google Assistant, but if you haven't been following I'm not much of a voice activated guy... But...

TL;DR - I purchased Fanimation ceiling fans through Amazon praying they would have a local API, they didn't. IFTTT wanted to charged me so I figured out another way.

What Ceiling fan did you go with?

I took a gamble and with the Fanimation Odyn. I did as much research as I could to prepare me for what this fan was capable of and I was completely and utterly wrong. So let me start with what came in each of the boxes.

Amazon - Fanimation Odyn Motor

  1. Comes with the motor obviously
  2. LED light kit
    • The light is white only but is dimmable
  3. A decerative cap for the LED use LED light
  4. Bluetooth controller (through their dumb app) - NOT WIFI
  5. A Radio-frequency (RF) remote that detaches if you want to attach it to the wall.

Amazon - Wi-Fi Module

  1. Replacement piece for the Bluetooth controller that allows you to control via Wi-Fi

Amazon - Fan Blades

  1. Blades to install, now I went with the 72" just as a statement piece but this motor can support many different sizes of blades. I thought that was an amazing feature in case 72" wasn't the right size.

Total cost per fan: ~$750.00

Now you can see why I was very hesitant to go with this option, but I thought. Heck it's Amazon, I could always return it. Installation went pretty swimmingly although notice if you do get this setup, INSTALL THE BLADES BEFORE SETTING UP THE MOTOR. I made this mistake and had called support... It's literally the first thing in the setup guide. I felt like an idiot. Anyways, so I fired up the Fanimation iOS app and I'll just flat out say it's pretty garbage. But it get's the job done... I guess...

Fully installed setup:

Ceiling fan with light on
RF Remote
RF remote separated if you want to disconnect it from the wall

Automation

Much to my chagrin after I get everything setup there is no local API support. Oh no! The defeat I felt was palpable.  How can I fix this I don't want two apps managing my house (Home Assistant and fanSync)... UGHH. I emailed support asking for local control, they kept telling me they didn't support it or plan to. DANG IT. Well maybe I could sniff the traffic using WireShark. No avail...
Well they do support IFTTT, so I'll hook up IFTTT in the fan and Home Assistant and i'll be good to go! It was a little slow but got the job done. End of story right?

Then the worst news dropped! IFTTT was switching to a paid subscription model. NOOOO! Almost 70 integrations I had using this integration and had less than a month to get rid of them. I'm not succumbing to the subscription model!

Okay I thought, what are my other options. This fan does support Alexa and Google Assistant. Maybe I should just cave and get a voice assistant. And then I came across the most amazing solution. Google Assistant Relay and even better someone wrapped this into a Docker Image! (Google Assistant Relay Docker)

What does Google Assistant Relay do?

It gives you an API (Application Programming Interface) to send a command to Google Assistant without you needing to speak the command. ELI5 - I can use Google enabled devices with a command rather than my voice. To set it up, I created a ReST command in Home Assistant to set the fan speed and control the lights. Wow! REDEMPTION!! This basically gives me local API control for any Google enabled devices. I am so happy I found this and it's expanded my search for devices. Hope it can save you too.

payload: '{"command": "turn on bedroom fan to {{ speed }}", "user": "home-assistant-relay"}'

Solution. How did you do it?

  1. Install Google Assistant Relay (I choose the Docker Image)
  2. Setup ReSTFul Commands
  3. Setup Input Booleans
    • In Home Assistant you want to be able to track the state of the fan. Since these commands only send our request Home Assistant doesn't know what state the fan is in. This will let us track it.
    • My Setup
    • Input Boolean Integration Page
  4. Setup Input Selects
    • Similar to above, when you request that you want your fan speed low, Home Assistant doesn't know what you last requested. So let's setup an input select to track that as well.
    • My Setup
    • Input Select Integration Page
  5. Setup Scripts
    • Unfortunately we are unable to interact with our ReST commands directly so we will need a layer of script to sit on top. Separation of concerns I guess. No worries.
    • My Setup
    • Script Integration Page
  6. Setup Fan Templates
    • Now arguably the hardest part. Putting all of it together. This is where you will define a fan in Home Assistant.
    • My Setup
    • Integration Page

Node-Red interaction with the fan template

Did you handle the LED lights as well?

I did. I wanted seamless integration between my light switch and two disparate systems (Philips Hue and fanSync). So when I turn on my Hue switch in my bedroom it will turn on my fan light as well. It also handles dimming functionality as well! Wow? So how?

  1. Setup ReSTFul Commands
    • This allows me to quickly interact with each of these commands in Home Assistant. As you can see in my rest_command for each fan there are two for lights and two for fans.
    • My Setup
    • ReST Command Integration Page
  2. Setup Input Numbers
  3. Setup Light Template
    • Similar to above, when you request that you want your fan speed low, Home Assistant doesn't know what you last requested. So let's setup an input select to track that as well.
    • My Setup
    • Input Select Integration Page

Conclusion

This solution took me several weeks to get solid. I'm very happy that I am able to control my 'smart' fans in Home Assistant and Node-Red like they are native fans. Thankfully with the IFTTT news it prompted me to find a better solution. When I found Google Assistant Relay it was a match made in heaven. As an added benefit, now I am able to search for supported Google Assistant devices and open up my options even more!

Question

What is your most complex solution in your home automation setup? This one took me several weeks but I am so happy with the end result.