Xiaomi (Aqara) Curtain Motor Integration

Hello. Just got a new SmartThings hub and am trying to get it to connect to an Xiaomi (Aqara) curtain motor. Prior to purchasing, I had seen several posts on this site referencing that it worked using custom device handlers.

I’ve tried searching and adding the Xiaomi outlet device handler from @a4refillpad, but that doesn’t seem to be working. Have also tried using a basic ZigBee switch device handler. Nothing has worked yet.

I’ve seen videos of these working on SmartThings, but no real explanation of how anyone got it working. If anyone can help, I’d greatly appreciate it. Thanks!

Safe to assume you read this post?

Have you been able to pair the Aqara curtain motor to add it as a “thing” in the SmartThings app yet?

That post explains that the motor button must be held for 5 seconds to put it into pairing mode, indicated by the rapid flashing blue LED.

If you need more detailed steps to get through it all, let me know.

@veeceeoh Thanks for the reply.
I’ve seen that post and have been able to pair the motor to my hub.

Unfortunately, so far as I can tell, erocm1231’s Xiaomi Outlet device handler doesn’t exist.

That user has a couple other device handlers, but not one for an outlet.

Do you have the motor working? Can you point me to the code you’re using for a device handler?

I was able to get this working by deleting it and re-adding it.
I think the issue may have been that I had added it using the new app.
Added it using the old app this time, and it worked immediately.
Just wish it sent the state back so you’d know whether it was open or closed.

John, you could potentially do that with a Contact sensor. You need to position the contact sensor in such a way the sensor is closed when the curtain is closed and voila. Xiaomi contact sensors are small enough for it to work nicely.

I may have found it. When it opens or closes, even if triggered manually, it sends a message with the present state. Just having a bit of trouble reading the value. Per the spec, it should be single precision floating point, but it doesn’t appear to convert to that.

I don’t have one, and don’t plan to buy one anytime soon. But not having a device hasn’t stopped me from helping create a device handler. :wink:

We could start with this Xiaomi Zigbee Outlet DTH.

The new ST App doesn’t fully support local devices using custom DTHs yet. It’s best to stick with the “classic” app for now.

After installing and assigning that Xiaomi Outlet DTH, then I’d need the log messages seen in the live logging window when it sends the open / close status. Also, does the motor open or close when you turn it “on” in the ST mobile app?

Thank you for offering to look at it. I’ve actually made a new post in the development forum for figuring out this new question.

Will update that post with one of the values. Also, on = open.

I have created a beta DTH, which will be always be accessible on GitHub here, until it’s finalized.

As of now, it’s just the Xiaomi Outlet DTH with the temperature function removed, and some specific information that can be used for pairing the curtain motor in SmartThings and have this DTH automatically selected.

That’s cool. How did you get the info so it knows to pair with that DH, especially when you don’t have the physical device.

Link to other thread, below.

https://community.smartthings.com/t/issue-with-single-precision-not-converting-analog-output-present-value/126515?u=johntarr

How? There are other people out there trying to get it work with other platforms. :grin:

As it stands now, I can’t guarantee that it will automatically chose the DTH with SmartThings, but if it does then the list of Zigbee inclusters and outclusters would then be listed on the device details page in the IDE, for example like this:

That Raw Description tells us the rest of what we need to know to add a “fingerprint” in the DTH that helps SmartThings match the device to the DTH automatically.

Of course, auto-selecting the DTH is just to be nice to other people who get the curtain motor. You can always pair it and then manually change to the DTH you want to use.

Hi Guys, I am new here. Today I just received my SmartThings hub and tried to pair it with my Aqara motors using your device handler. It found it without any issues and On rotates on one side and off to the other side I guess. If I can provide any info that will help you with the development let me know. Would really love to see the functionality to be able to stop motor as right now it is either rotating on one side or the other. Do you think taht is possible?

Note: I just have the motors, have not mounted them on the rails yet because the apartment is not ready. I have the rails as well though.

The first time you run the motor, it will run until it encounters resistance, and that is how it knows how far to open or close. When running it off the rails, there is no resistance, so it doesn’t know when to stop.

Once you install it, if you find it doesn’t fully open or close, you’ll need to reset it.
I had to play around a bit to do this, but here is what seemed to work for me:

  • Fully open the curtain manually
  • Hold the button on the bottom of the motor for maybe 10 seconds to reset the curtain
  • Now, you can pair and close the curtain, and it should open/close fully

Let me know if you have trouble once you get it installed.

1 Like

any recommended sellers on aliexpress or other vendors for xiaomi curtain motors/rails?

how has the performance being so far of the integration with smartthings (outside of the usual smartthings meltdowns here and there) and how about the actual motors (reliable/ quiet/ loud)?

Sorry for the delayed reply.

I got the motor from Mi Home Store. Motor

The rails came from Fancy Blinds Store. Rails

The performance and integration have been excellent, knock on wood. It opens up every morning and closes every night. Motor and rails aren’t silent, but they are pretty quiet. I have them in my bedroom, and they don’t wake me up.

Hi

I’m using your handler and the motor intergrates fine with smartthings. unfortunately, I am unable to use it as a scene or have alexa discover it (through smartthings). Is it at all possible for alexa to control the motor?

Thank you

It is possible. I think I had to create a routine in smart things and then have Alexa control that routine. Can you look and see is that works? Let me know either way.

Hi Guys,
I was finally able to install the curtains and managed to pair the motor with the device handler from this post. It is working fine if I want to fully open or close the curtains. Any chance to make a pause button to open/close to a certain pint?
I also have the Xiaomi app and gateway and there you can do that.

Sorry for the delayed reply.
Check out this post. It should be exactly what you need. Reply back if not.

https://community.smartthings.com/t/xiaomi-curtain-dth-partially-openable-added-stop-button/126972

1 Like

Thanks, it seems exactly what I am looking for. I will test it these days when I get a chance.