How To Add Aqara Devices to Home Assistant in 2021

by Danny
8 comments

READING TIME: 6 MINUTES

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

Sale
Aqara Water Leak Sensor, REQUIRES AQARA HUB, Wireless Water Leak Detector, Wireless Mini Flood Detector for Alarm System and Smart Home Automation, For Kitchen Bathroom Basement, Works with IFTTT
  • 【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 the Aqara Smart Plug or Aqara Smart Wall Switch(With Neutral) is required).
  • 【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.
  • 【HOME AUTOMATION】Controls and triggers Aqara connected devices when excess water is detected.
  1. Unbox your Aqara Water Leak Sensor.
  2. Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
  3. Click Configure and then + Add Device.
  4. Place the water leak sensor on a flat surface. Press the water icon on the top of the sensor & hold for 5-10 seconds.
  5. You should see the device flicker blue a few times. This puts the device in “pairing mode”.
  6. 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

Aqara Door and Window Sensor, REQUIRES AQARA HUB, Zigbee Connection, Wireless Mini Contact Sensor for Alarm System and Smart Home Automation, Compatible with Apple HomeKit, Alexa, Works With IFTTT
  • 【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 the Aqara Smart Plug or Aqara Smart Wall Switch(With Neutral) is required).
  • 【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 Hub.
  • 【HOME AUTOMATION】The Aqara Door and Window Sensor can control other Aqara connected devices as the status of the door or window changes.
  1. Unbox your Aqara Door and Window Sensor.
  2. Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
  3. Click Configure and then + Add Device.
  4. 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
  5. 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”.
  6. 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)

Aqara Wireless Mini Switch, Requires AQARA HUB, Zigbee Connection, Versatile 3-Way Control Button for Smart Home Devices, Compatible with Apple HomeKit, Works with IFTTT
  • 【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 the Aqara Smart Plug or Aqara Smart Wall Switch(With Neutral) is required).
  • 【ONE TOUCH CONTROL】A wireless versatile remote to control your smart home devices
  • 【3 CONTROL SETTINGS】Set single press, double press, and long press to control programmable functions, such as turning on/off a device, activating a scene, etc
  1. Unbox your Aqara Wireless Mini Switch. Pull the blue tab.
  2. Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
  3. Click Configure and then + Add Device.
  4. Press the round button located on the top end of the button. (not the large button in the middle).
  5. Press and hold for about 5-10 seconds until you see the light flicker blue rapidly. This puts the device in “pairing mode”.
  6. 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

Sale
Aqara Temperature and Humidity Sensor, REQUIRES AQARA HUB, Zigbee, for Remote Monitoring and Home Automation, Wireless Thermometer Hygrometer, Compatible with Apple HomeKit, Alexa, Works with IFTTT
  • 【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 the Aqara Smart Plug or Aqara Smart Wall Switch(With Neutral) is required).
  • 【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 night light.
  • 【HOME AUTOMATION】The Aqara Temperature and Humidity Sensor can control other connected devices such as Aqara Smart Plug to ensure that your fan or humidifier maintains a constant level of comfort for you and your family.
  1. Unbox your Aqara Motion Sensor. Pull the blue tab.
  2. Open Home Assistant and navigate to Configuration > Integrations > Zigbee Home Automation.
  3. Click Configure and then + Add Device.
  4. If you’re looking at the front of the sensor, there is a small round button on the right side.
  5. Press and hold for about 5-10 seconds until you see the light flicker blue rapidly. This puts the device in “pairing mode”.
  6. In Home Assistant, you should see it begin the initialization phase.
  7. 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.


Smart Home Product Finder

What hub do you currently use?


SmartThings

Home Assistant

Hubitat

Step 1 of 3

What product are you looking to add?


Lights

Locks

Thermostats

Cameras

Garage Door Opener

Switches

Sensors

Motion, Door & Window, Leak

Smart Plugs

Buttons

Step 2 of 3

What protocol?


Z-Wave

Zigbee

Wifi

Step 3 of 3

Retake quiz? Click here!

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.

The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.

8 comments

You may also like

8 comments

ryan May 16, 2021 - 1:47 am

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?

Reply
Danny May 16, 2021 - 2:41 am

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?

Reply
Jimmy June 7, 2021 - 6:10 pm

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.

Reply
Danny June 8, 2021 - 1:54 am

Thanks for the tip, glad you got it working!

Reply
Roy Nash June 30, 2021 - 5:18 am

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.

Reply
Danny June 30, 2021 - 10:37 pm

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.

Reply
Roy Nash July 1, 2021 - 2:27 am

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

Reply
Danny July 6, 2021 - 2:18 pm

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.

Reply

Leave a Comment