In this guide, I’ll show you how to add Xiaomi Aqara devices to Home Assistant in 2021. If you’ve added other devices to Home Assistant using ZHA, then this should pretty straightforward. These are some of the best sensors to add to Home Assistant due to their low cost and appealing looks.
We will be adding Aqara water sensors, aqara motion detectors, aqara door and window sensors, and Aqara mini switch buttons.
Let’s get started!
Prerequisites
This guide assumes you have:
- Home Assistant installed on a raspberry pi
- A Zigbee USB hub added to Home Assistant
If you are new to Home Assistant, or are migrating from SmartThings to Home Assistant, then you can follow my How To Add Zigbee and Zwave decices to Home Assistant guide to get setup.
Once those are configured, you are ready to start adding Aqara devices.
Aqara Devices
A quick FYI regarding Aqara devices. From what I’ve read on Reddit, you should pair the devices near the location of it’s final place. For example, if you are adding a water sensor in the guest bathroom, try pairing it from there instead of directly next to the hub.
I personally didn’t have to do this, but it’s supposed to help keep these devices reporting correctly.
How To Add Aqara Water Leak Sensor to Home Assistant
- ✽【NOTES】An Aqara Hub is required and sold separately. Requires a secured 2. 4 gigahertz WiFi network connection. The Aqara M2 or M1S Hub can connect up to 128 devices(*use of a repeater such as...
- 【FLOOD DETECTION】Whenever the Aqara Water Leak Sensor detects water, it can send an alert to your phone and activate the local alarm on the Aqara Hub to prevent leaks and flooding.
- Unbox your Aqara Water Leak Sensor.
- Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
- Click Configure and then + Add Device.
- Place the water leak sensor on a flat surface. Press the water icon on the top of the sensor & hold for 5-10 seconds.
- You should see the device flicker blue a few times. This puts the device in “pairing mode”.
- In Home Assistant, you should see it begin the initialization phase.
Note: I had to attempt the pairing process 2-3 times before it would detect in ZHA.
That’s it! You can now name your device and assign it to room within Home Assistant!
Aqara leak sensors have two entities: Battery Power and wet/dry status:
How To Add Aqara Door and Window Sensors to Home Assistant
- ✽【NOTES】An Aqara Hub is required and sold separately. Requires a secured 2. 4 gigahertz WiFi network connection. The Aqara M2 or M1S Hub can connect up to 128 devices(*use of a repeater such as...
- 【UNAUTHORIZED ENTRY DETECTION】Whenever the door/window opens unexpectedly, the Aqara Door and Window Sensor will send an alert notification to your phone and activate the local alarm on the Aqara...
- Unbox your Aqara Door and Window Sensor.
- Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
- Click Configure and then + Add Device.
- The sensor will have two parts: a small and a large end. On the sides of both you’ll see a line. Place those two lines together
- Press the round button located on the top of the larger part of the sensor. Press and hold for about 5 seconds until you see the light flicker blue rapidly. This puts the device in “pairing mode”.
- In Home Assistant, you should see it begin the initialization phase.
Aqara Door and Window Sensors have two entities in Home Assistant: Battery Level and open/closed status.
How To Add Aqara Wireless Mini Switch to Home Assistant (button)
- Unbox your Aqara Wireless Mini Switch. Pull the blue tab.
- Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
- Click Configure and then + Add Device.
- Press the round button located on the top end of the button. (not the large button in the middle).
- Press and hold for about 5-10 seconds until you see the light flicker blue rapidly. This puts the device in “pairing mode”.
- In Home Assistant, you should see it begin the initialization phase.
You will only see 1 entity for Aqara mini switches: Battery Level. It will show up as unknown for the first several hours but should start reporting soon.
You will have to manually add automations for the various button clicks. As it stands, the button won’t do anything.
How To Configure Aqara Button Presses
Navigate to Configuration >Automations.
Choose the Button device. Under the Trigger section, you have several options:
- Short button pressed
- Long button pressed
- Long Button released
- Double pressed
Keep in mind, you will have to create 4 different automations for this button, one for each trigger.
For example, if you wanted to create an automation to toggle a lamp from a single short press, that can be created in 1 automation. You’d then have to create another for double press, long press, and long release.
How To Configure Aqara Motion Sensors
- ✽【NOTES】An Aqara Hub is required and sold separately. Requires a secured 2. 4 gigahertz WiFi network connection. The Aqara M2 or M1S Hub can connect up to 128 devices(*use of a repeater such as...
- 【REMOTE MONITORING】When the room temperature reaches above or below a certain threshold, the Aqara Temperature and Humidity Sensor can send a push alert to your phone or trigger the Aqara Hub...
- Unbox your Aqara Motion Sensor. Pull the blue tab.
- Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
- Click Configure and then + Add Device.
- If you’re looking at the front of the sensor, there is a small round button on the right side.
- Press and hold for about 5-10 seconds until you see the light flicker blue rapidly. This puts the device in “pairing mode”.
- In Home Assistant, you should see it begin the initialization phase.
- Give it a name and then add it to a room.
Aqara Motion Sensors have 4 entities available: Power, Illuminance, occupancy, and Zone.
Wrapping Up
Hopefully this guide helps you quickly Xioami Aqara devices to your Home Assistant setup in 2021!
These sensors are inexpensive, pair super easily, and work really well.
My Favorite Home Assistant Devices
Below are some of the Home Assistant-compatible devices I personally use in my home. I highly recommend each of them.
- Zwave/Zigbee hub: Nortek GoControl HUSBZB-1
- Smart Plugs: Sonoff S31 Lite Zigbee
- Motion Sensors: Hue Indoor Motion
- Outdoor Camera: Amcrest IP5M Turret
- Robot Vacuum: Roborock S7
The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.
Hey I just wanted to say that I’m using 100% the same hardware you are in this article, and this straight up does not work. Nor can I find a single other article anywhere online saying this should be this easy. Is there some trick that I and everyone else is missing?
I’m not sure what to tell you, other than I use aqara devices all the time with Home Assistant. Are you using a Nortek GoControl dongle like I am or something else?
Just got it to work on my end, I noticed I had to press the small button a couple of times after Home Assistant first detected the button and then it worked (after one failed attempt). It said something like “initializing” and was blue then after I pressed the button again a couple times it turned green/completed.
Thanks for the tip, glad you got it working!
I am fairly new to Aqara but so far my experience is you may have to try to pair over and over until it works. But one it is pair it works great.
Good Article, I would like to integrate the Agara M2 Hub and Aqara water leak sensor into Synology Docker Home Assistant (HA). These are the only devices I have at the moment. To date, I can see both devices in HA, The M2 hub is regarded as a HomeKit controller and the Aqara leak sensor is regarded as a HomeKit device. The only problem I am seeing is the Agara M2 Hub has only “arm” and “disarm” entities. I cannot use the M2 Hub siren or push notification entities in automation. So as of time of writing, it is useless in HA
Before I go out and buy a Zigbee stick to fulfill my automation requirements. Can you please advise me why you say in your requirements (*use of a repeater such as the Aqara Smart Plug or Aqara Smart Wall Switch (With Neutral)
Why? The Agara Hub M2 supports Zigbee 3.
I put that in my guide based on feedback combined from several forum/Reddit posts. From what I’ve read, some Aqara devices tend to lose connectivity unless a repeater is used to extend the zigbee coverage.
Thank-you for reply. So, it’s due to intermittent connectivity issues and nothing to do with having the full suite of Agaro M2 hub entities available for you to use. Can you can you confirm if you have the Agara M2 Hub Speaker and Push Notification entities available to you in HA when using the Zigbee stick? Kind regards, RN
I don’t use the Aqara hub; I paired my Aqara devices directly to Home Assistant, so I’m not sure if those entities would be available or not.
I have tried multiple times, and I can not get the Zigbee Coordinator to see this Aqara Mini Switch. I hold the button down while the ZHA searches…. I never see any light on the button and the search eventually fails. I pulled the blue tab out so the battery should be active. I have sylvania bulbs installed, no problem. I am using the nortek husbzb-1.
Question: is there a key press sequence to begin paring mode? or is it just hold it down? Or do I have to hold it in the up direction, or the center, or what?
I had a hard time getting the button paired but eventually, it work. A few tips I’ve read and learned is that you don’t need to hold down the pair button. It seems to work better by just pushing it once.
That Zigbee USB hub is over C$100 on Amazon. Is there a cheaper option?
The GoControl one? In the US, I never see it go over $55.