Aqara Contact Sensors in Home Assistant without a Hub

My journey into smart home setup started with being gifted a Wyze camera many years ago. Wyze makes nice devices and this gift was when Wyze was in it’s infantancy. But as they grew as a company, they have been moving more into an “ecosystem” with (forced) subscription options. And my mindset has moved more into keeping my data in house as much as possible. So as I’ve leaned more on Home Assistant and keeping my data at home, the more the Wzye devices don’t fit into my long term goals. Additionally the Wyze equipment doesn’t play very nice with Home Assistant. There is an unofficial integration that offers limited functionality at the time of witting.

There is a very annoying flaw with the Wyze Sense V1 (no longer offered, not sure if this affects V2 or not). If the battery dies, the entire device dies. Replacing the battery doesn’t revive the sensor. I know this from first hand experience. [source] To make matters worse, they now only offer Wyze Sense V2 which requires a home monitoring subscription. And with that – I’m out! This is just another strike against Wyze. Sad as I really liked their products at first.

This lead me on a venture to look for new options. I’ve analyzed many many options out there, done (far too much) research, and found Aqara. This company feels like what I was hoping Wyze was going to be – cost friendly smart devices that aren’t part of a closed ecosystem and/or subscription based. Aqara has a large offering of products which is great! So the next step is to give Aqara a test. This might be confusing as their products all say Hub Required, but read on as that’s not true.

Aqara Contact Sensor in Home Assistant Without a Hub

Why I Chose Aqara

Why Aqara? First off, their name comes up over an over in the Home Assistant forums. Aqara seems to be well liked by the community.

Aqara uses the open Zigbee protocol which is an open standard that other manufacturers use as well. This means that despite them saying you need to use their hub, you can connect their devices to Home Assistant so long as you have a Zigbee antenna setup. If this is something you need to do, you can follow my tutorial on adding Zigbee to Home Assistant on a QNAP NAS.

Price was certainly a factor for Aqara. They offer good technology at a fair price comparative to the market.

The size of their devices is another factor. They are small enough to not stand out in my house. Some of the competitors have rather large devices.

Aqara Contact Sensor

This is the Aqara contact sensor I am using – it’s called the Aqara Door and Window Sensor [model MCCGQ11LM].

In the United States they are sold via Amazon, and when I purchased them you could find a bundle if you need more than one. The bundles seemed cheaper at first, but there was an Amazon coupon I could apply and it’s actually cheaper buying them separately with the coupon than in the bundle. So do some math and see if you can save yourself a few bucks like I did.

Aqara Door and Window Sensor MCCGQ11LM

Adding Aqara Contact Sensor to Home Assistant without a Hub

There are many Zigbee gateways on the market. Below are instructions or adding the Aqara contact sensor using two popular Zigbee coordinators and links to tutorials on how to add those integrations to Home Assistant on QNAP.

Both integration methods work. In my experience however, the deCONZ integration has been far more reliable. The contact sensors would loose their connection on the ZHA integration. That was my main motivation for switching to the deCONZ setup.

Instructions to Add Aqara Contact Sensors with ZHA Home Assistant Integration and HUSBZB-1 Zigbee Coordinator

  1. Click on Configuration
  2. Click on Integrations
  3. Click on CONFIGURE for the HubZ Smart Home Controller integration (or similarly named Zigbee integration if Zigbee is integrated differently in your Home Assistant)
  4. Click the ADD DEVICE button
  5. A screen will show indicating that Home Assistant is scanning for a new device.
  6. Press the button on the bottom of the Sensor Unit for about 3 seconds. The lights will flash indicating it is in pairing mode. Let go of the button.
Press and hold the pair button on the Aqara contact sensor for 3 seconds
Press and hold the pair button on the Aqara contact sensor for 3-5 seconds until the lights flash
  1. Wait as Home Assistant connects to the device.
    • This often will take more than one attempt. (this is noted in the ZHA documentation)
    • I’m not sure if it technically helps or not, but if you’re having issues connecting I found that pressing the button every 5 seconds or so will ensure the device stays awake during the connection step
    • Ensure you aren’t “too far away” from the Zigbee radio on the Home Assistant device.
    • I suggest NOT changing the name at this step. See below in the Connection Stability section for how and why I do my device naming.
    • I like to set these up at the location they will be used. If they can connect when right next to the Zigbee radio it’s not very helpful in knowing if the radio can reach the final destination of where this will live. There is one “dead spot” in an upstairs bedroom in my house that must be perfectly blocked by ductwork, floors, and walls from where my radio is.
Aqara Window and Door Sensor paired with Zigbee to Home Assistant without a hub
Aqara Window and Door Sensor paired with ZigbBe to Home Assistant without a hub

If all goes as planned, you’ll be all setup with a Aqara Window and Door Sensor connected directly to Home Assistant via the Zigbee protocol and NO Aqara Hub was needed!

Zigbee showing two entities from Aqara contact sensor

Two entities are now added to the Zigbee integration.

Aqara Window and Door Sensor adds two entities to Home Assistant

A sensor entity is added for the battery level.

A binary_sensor entity is added for detecting if the door/window is open or closed.

Sensor Action statetype
Open (two pieces apart)onopened
Closed (two pieces next to eachother)offclosed
Aqara Contact Sensor binary_sensor

Troubleshooting Aqara Contact Sensor ZHA Connection Issues in Home Assistant

I’ve seen a lot of conversation across the internet about using Aqara devices with the HUSBZB-1 device and the ZHA integration and how one person says it’s awesome and the next person says the devices don’t stay connected and back and forth. This makes it hard to know if this should be the right integration method or not. And I’ll be honest – I’ve had some stability issues myself. Some of it might be my own fault, but other times devices just drop off. A bit strange.

From what I’ve read, the Aqara devices didn’t follow the Zigbee spec 100%, and the HZA integration is still growing. So those are some factors. Your home layout, interference, etc. are also factors of course.

But one trick that I think is critical here is how you name your devices when you add them through ZHA. On step 7 above when the device is connected, you can rename the device there. I personally suggest NOT doing that. I have a theory that the naming of a device there will cause instability.

do not rename a zigbee zha device when adding the device
Do not change the name when adding a new Zigbee device in ZHA

I go back to Configuration -> Integrations, click on the Devices link in ZHA, and then click into a newly added device. In the Entities section, I’ll click into each Entity and set the Name field only. I do NOT change the Entity ID field.

Set the name on a zigbee zha entity
Set the name of each ZigBee ZHA entity for ease of use in Home Assistant

After naming the entities, I’ll click the pencil icon at the top of the device page to rename the device itself. When it prompts you asking if you want to rename the entity ID’s choose NO.

set the name of the zigbee zha device in home assistant
Set the name of the Zigbee ZHA device for ease of use in Home Assistant
Do not rename the entities when naming the device
Choose NO when renaming the device. Name the entities manually instead.

If you have a device that isn’t connecting well, click the REMOVE DEVICE button, go through the process to re-add the device, and ensure you follow this naming process and you should be all set to go. If you’ve never changed the Entity ID for the device, the re-added devices should connect back into your automations and dashboards without issue. At least that’s been my experience.

Again, this sequence is a theory but so far it’s been working for me.

Instructions to add Aqara Contact Sensors with deCONZ Home Assistant Integration and ConBee II Zigbee Coordinator

Phoscon App

  1. Click the three lined hamburger menu to expand it
  2. Click on Sensors
  3. Click the Add new sensor button
  4. Choose the Other button
  5. Press and hold the button on the bottom of the Aqara contact sensor for about 3 seconds, until the light flashes indicating it is in pairing mode and let go of the button.
  6. The Phoscon App should show a green bar saying Sensor Ready.
    1. If after about ten seconds the Phoscon App doesn’t show Sensor Ready, repeat step 5.

Home Assistant

Now that the Aqara contact sensor is connected to deCONZ in the Phoscon App, confirm that it is connected to the deCONZ Home Assistant integration.

  1. Click on Configuration
  2. Click on Integrations
  3. Click on the device ID
  4. Click on the x devices link
  5. The Aqara contact sensor should show in the list (depending on configuration)
Home Assistant deCONZ Configuration: Automatic Connection of New Devices

Within the Home Assistant deCONZ integration configuration section, an option of Allow automatic addition of new devices is available. With this checked, there isn’t an extra effort needed to ensure that new devices show in Home Assistant.

Home Assistant deCONZ configuration options

References:

This post may contain affiliate links, which means I'll receive a commission if you purchase through my links, at no extra cost to you. Please read full disclosure for more information.