Zigbee, Z-Wave and Home Assistant

Zigbee Home Assistant Z-Wave logos

Note: This article has been updated in 1/2019 to reflect changes to Home Assistant and Google Assistant.

Background

If you read my “First 2 Hours with Home Assistant” or my “Home Assistant Customization and Automation From a Beginner” article you’ll know that one of the reasons I chose Home Assistant was to be able to have an alternative to my aging veralite Z-Wave controller. My home office room often gets very hot (might have something to do with the computers in it) and I decided to install a ceiling fan. Long ago I decided any new devices I purchase for the house should be connected and smart, if possible. This led me to look for ceiling fans I can control with Home Assistant. In the end, I decided on a Zigbee fan controller, which required me to buy a Zigbee compatible USB stick (the Linear/Nortek HUSBZB-1) which also has Z-Wave capabilities, which allowed me to pair a couple of Z-wave switches I have laying around.

My journey to this decision and details on how to get Zigbee and Z-Wave working with Home Assistant follow…

Looking for a Connected Fan

It was a frustrating search for a connected fan. Initially, I wanted one that connected directly to my Wifi network and integrates with Google Assistant and Alexa. Direct support in Home Assistant would be great, but, if not, some type of published API (preferable RESTful).  I would have been happy with a connected fan or a smart control that turned a dumb fan into a smart one. I would also be fine a Zigbee or Z-wave fan control.

Models I Considered:

  • Bond Home

    This is a controller that you connect to your network via Wifi for integration with Google Assistant and Alexa. If you already have fans with remotes, it clones the IR or RF signal to control your fans (it can control up to 6 fans) and supposedly has a 2,500 square foot range. It has positive reviews on Amazon. Unfortunately, I don’t have fans or wireless controllers yet, so I’d still have to buy those to have this work. Also, I couldn’t find any published API or any evidence that you can currently integrate this with Home Assistant.

  • Hunter Symphony Ceiling Fan with Wifi Capability

    Hunter makes a few fans like the Symphony that connect directly to your wifi network and integrate with Alexa or Apple Homekit. As of this writing, they don’t integrate with Google Assistant, and I couldn’t find anyone who had integrated it with Home Assistant.

  • Various Z-Wave enabled fan controllers (e.g.the GE Z-Wave Plus Smart Fan Speed Control)

    All the Z-wave controls I looked at only controlled fan speeds, not light. I need one that controls both.

  • Universal Wink Enabled White Ceiling Fan Premier Remote Control

    This is a Hampton Bay Zigbee fan controller that also has an RF remote that integrates with most ceiling fans. Although it says it is for Wink, you can control it with other Zigbee controllers. I was able to confirm this Zigbee device works with Home Assistant, and thus I can use Home Assistant’s cloud integration for Google Assistant ant Alexa support.

  • Gardinier 52 in. LED Indoor Brushed Nickel WINK Enabled Smart Ceiling Fan with Integrated Light Kit with Remote Control

    This is a Home Decorators fan (which I believe is the same company that makes the Hampton Bay fans) that comes with a version of the Hampton Bay Wink enabled remote control, meaning it will likewise integrate with Google Assistant and Alexa via Home Assistant.

See also  Matter: The Future of the Smart Home?

Why I chose the Gardinier Fan

Gardinier Wink Enabled Smart Ceiling Fan
Gardinier Wink Enabled Smart Ceiling Fan

I chose the Gardinier fan because it had direct integration with Home Assistant, and I was already planning on buying a USB Stick to control Z-Wave and or Zigbee devices directly from Home Assistant. I easily could have purchased the Universal Wink Enabled controller and another fan, but I liked the fact that this was an integrated package. Also, the fan looks nice!

Looking for a Zigbee USB Stick

In order to control Zigbee devices, I needed a Zigbee device that could control them. I went with the Nortek HUSBZB-1 (also sold under the brand Linear) as it was the only stick out there I saw that works with Home Assistant and does both Zigbee and Z-weave. If you are looking to get this stick for Zigbee devices be sure you are not getting the HUSBZ-1 model (without the last B) as that one only has Z-wave!

When I plugged this into my Home Assistant machine (Ubuntu 18.04 running in a VM) it created two devices: /dev/ttyUSB0 (Z-Wave) and /dev/ttyUSB1 (Zigbee).  Following the Zigbee and Z-Wave Home Assistant documentation I placed the following in my configuration.yaml file:

zha:
usb_path: /dev/ttyUSB1
database_path: /home/homeassistant/.homeassistant/zigbee.db

zwave:
usb_path: /dev/ttyUSB0

I then restarted home assistant, installed the fan and went to add the fan to Home Assistant…

Adding the Zigbee Fan to Home Assistant

This turned out to be not quite so straightforward. Home Assistant doesn’t have a dedicated UI section or button for pairing Zigbee devices. You have to go the Services tab under developer tools, call the zha.permit service, and then toggle the power to your Zigbee device. After doing this, the fan showed up in the interface, however, the light showed up as a switch.

Home Assistant Services Interface
Calling zha.permit service from Home assistant

After some Googling, I found you can override the ZHA device type, but you need to know the IEEE number of the device. I could not find this identifier anywhere in the Home Assistant interface so I decided to look directly at the zigbee.db SQLite database using sqlitebrowser.

sqlite browsing zigbee database
zigbee.db

Using the IEEE number from the Zigbee database I modified the zha section of configuration.yaml:

See also  Wiring the Shelly Plus 1 Relay

zha:
  usb_path: /dev/ttyUSB1
  database_path: /home/homeassistant/.homeassistant/zigbee.db
  device_config:
    00:22:a3:00:xx:xx:xx:xx-1: #Make switch into a light
      type: 'light'

Note  I added a -1 to the end of the IEEE number in the device_config line. After a restart of Home Assistant, the switch was now a light!

Everything worked in Home Assistant. I noticed, however, that Google Assistant sees the fan control from Home Assistant (not the light) as a switch (it’s a fan in Home Assistant) and thus only turns it on and off, it does not control speeds. Alexa doesn’t have this problem, and I can still change speeds from the RF remote control or the Home Assistant interface.

UPDATE: Later versions of Home Assistant have fixed this problem. These fans now show up as fans in Google Assistant, and now you can control their speed with voice control! The Home Assistant community comes through again!

Adding Z-Wave Devices Home Assistant

Pairing with Z-Wave was much more straightforward. I have a couple of Aeotec Smart Energy Switches that stopped being recognized by my buggy veralite controller to pair with Home Assistant. I simply went to the Configuration->Z-Wave page in Home Assistant and then clicked on the “Remove Node” function to unpair the switches, and then “Add Node” to add them to Z-Wave. They then showed up as switches in the Home Assistant interface.

Z-Wave Home Assistant
Home Assistant Z-Wave Management Interface

Update: Since Z-wave worked so well, I decided to transfer my entire Z-wave network from the Vera to Home Assistant.

Final Thoughts

I’m pretty happy with how all this worked out. My only disappointment is the Google Assistant seeing the fan as a switch, but with the rapid pace of Home Assistant development I’m sure that will get fixed over time, or perhaps there is a way for me to fix that in configuration. It is good to have a Zigbee and Z-wave controller I can use that is directly integrated with Home Assistant. The voice commands and the commands from the Home Assistant interface are about instantaneous.  I liked these so much that when Home Depot had a bundle sale on the Universal Wink Fan Controller and a couple of Hampton Bay fans I bought and installed them for two more bedrooms. Those bedrooms feel much better when there’s hot weather!

See also  Home Assistant Can Control Google Assistant

How are you guys integrating fan control with your home automation? Anyone else doing this with Zigbee and/or Home Assistant? Reach out to me on Twitter or in the comments! Also, please subscribe to this site and share it with your friends!

Editor’s Note: This article contains some affiliate links. For more information, see my disclosures.

Share this:

Zigbee, Z-Wave and Home Assistant

by HomeTechHacker time to read: 6 min