[OBSOLETE] Xiaomi Curtain DTH(Partially openable) added Stop button

Xiaomi Curtain DTH

It works almost perfectly.
You can adjust the level.
Partially openable

Control with Smartthings App

Control with Homekit

Synchronize STapp and homekit

------------------- 2018. 09.18 --------------------------

added Stop Button

I fixed the Routine to work when selected the window shade.

[Xiaomi Curtain DTH GitHub Repository Integration - Owner : shin4299 / Name : XiaomiSJ ]

Code Link


How did you discover the zigbee.writeAttribute parameters to send to cluster 000D / attribute ID 0055 to adjust the partial curtain open / close level???

Just tried this out. It seems to work great so far.

As @veeceeoh said, I’m really curious as to what the data in cluster 000D, attribute 0055 actually means.

Also, how did you get it to work with HomeKit?

First, I do not speak English well. And I am a man.
I finished this work in November last year. So I do not remember well.

However, I had made a lot of effort. As you know, I could not find any related documents.
I had analyzed many attribute messages and tried to find commonality. And I came to know that
Float value 100 = hex value 0x42c80000.
After that, I had made a lot of attempts to find the command code. And finally I found it.

1 Like

The code below is pdlove’s ‘homebridge-smartthings’ code.
As you can see in the code below,
Both the Homekit and the Smartthings receive status only at the level value.
If the curtain can be adjusted to the level value in the ST, it can be adjusted in the homoket.

if (device.capabilities["Switch Level"] !== undefined) {
    if (device.commands.levelOpenClose) {
        //This is a Window Shade
        this.deviceGroup = "shades"
        thisCharacteristic = this.getaddService(Service.WindowCovering).getCharacteristic(Characteristic.TargetPosition)
        thisCharacteristic.on('get', function(callback) { callback(null, parseInt(that.device.attributes.level)); });
        thisCharacteristic.on('set', function(value, callback) { that.platform.api.runCommand(callback, that.deviceid, "setLevel", { value1: value }); });
		that.platform.addAttributeUsage("level", this.deviceid, thisCharacteristic);

        thisCharacteristic = this.getaddService(Service.WindowCovering).getCharacteristic(Characteristic.CurrentPosition)
        thisCharacteristic.on('get', function(callback) { callback(null, parseInt(that.device.attributes.level)); });
		that.platform.addAttributeUsage("level", this.deviceid, thisCharacteristic);		

Well, you did great! :smile: It is not easy to reverse engineer the messages and commands of Xiaomi’s Zigbee devices.


i have this error:
Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_0c8ec5e1_5aac_4a0b_86cc_01387e604aed: 20: expecting anything but ‘’\n’’; got it anyway @ line 20, column 34. capability “Window Shade" ^ 1 error

what i do wrong?

Sorry. I fixed it.
Please download again.

1 Like

If you manually pull to close, does it react and start the motor?

Yes, Xiaomi motors can be opened and closed manually. Just pull the curtains out lightly by hand.

Congratulations! You did a great job! It is almost perfect except when you try to creat routines. Example, when I create a routine using “open or close windows shades” it do not work. But if I turn on the curtain switch and had set dimmer lights in x%, I noticed that the curtain open partially. If it is possible to fix that will be perfect!! Or maybe I’m doing something wrong too!

Looks good, got a GitHub integration for the DTH so it makes it easier to update?

Setting it up as a routine doesn’t work for me either. I don’t miss it too much, but it would definitely be awesome to have the feature. TIA.

I just come across similar area of zigbee cluster when I work on my own module. I just want to help to clear up the 000D and 0055 value meant.

Cluster 0x000D is an Analog Output. Attribute 0x0055 is present value of that cluster. I think this is a good use of the cluster for the level of the curtain.

This attribute should be reportable. The refresh may not be needed if the reporting is configured and the device support it. The device should send out report of the level as they change based on the configureReporting parameter.

try adding a space to the window shade capability to get it to show up as a shade in a routine. Should be:
capability “Window Shade”

What tracks are you using for the motor? I have a motor just no idea what track to use.

GitHub Repository Integration - Owner : Shin4299 / Name : XiaomiSJ

You can use this.

ShinJjang, I did not find the code. Could you please send me the link? Tks!

I just attached a link on the post