merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
383 stars 62 forks source link

Add support for Xiaomi Curtain Driver E1 #408

Closed Schoschito closed 1 year ago

Schoschito commented 1 year ago

Device model lumi.curtain.hmcn02

Device name Xiaomi BLE Curtain Driver E1

BLE Gateway lumi.gateway.mgl03

Does the device require a MiCloud connection? No

Anything special about the device? The Xiaomi E1 looks like the Aqara Zigbee curtain driver but is BLE only

merdok commented 1 year ago

Is this is a Zigbee or BLE device?

Schoschito commented 1 year ago

Its a BLE Mesh device (like most of the newer Xiaomi / Mija devices)

merdok commented 1 year ago

Did you try to already add it to the plugin? Did it work? (please note that BLE mesh devices require a Gateway/Hub so you need to specify the Gateway ip and the deviceid and model of your device.)

Schoschito commented 1 year ago

The curtain driver is connected with a Xiaomi Gateway (in Mija app it works flawless, but has no homekit integration).

I have connected the gateway with the plugin with ip, token and id - it recognizes the gateway perfectly and i can see in the homebridge logs that it sees a new unrecognized device (the curtain driver).

The plugin adds a button for the curtain in homebridge but it has no function. Already checked the motor controll checkbox with curtain specific settings, not working

merdok commented 1 year ago

The device should already be detected as a curtain device, so it seems for that you specifying something wrong. The ip and token needs to be the one from your Hub, the model and deviceid needs to be from your curtain device. Did you specify it like that?

Schoschito commented 1 year ago

Seems my device model code was wrong - the curtain device is sold in China only, so information rare. Here is the update.

Device Model: MJSGCLBL01LM (can‘t find information about the unique model code on the net) Device Name: Xiaomi Mija Curtain Companion

Gateway is a lumi.gateway.mgl03 > curtain device

The plugin connects the gateway, but doesn‘t recognize the curtain device

B8828932-32FF-4521-A19C-EB9925D09558

merdok commented 1 year ago

No this is wrong! lumi.gateway.mgl03 is your gateway model! You should specify your curtain model and deviceid. It should look as follows:

Then it should work. The curtain also needs to be paired with your gateway. As your curtain device is a BLE mesh device, direct connection is not possible, so it has to go over the gateway. You can also have a look here for some more info: https://github.com/merdok/homebridge-miot/discussions/348

Schoschito commented 1 year ago

Marcin, thanks for coming back, but i think we are talking cross purpose. The ble device is paired with the gateway in the Xiaomi/Mija app and fully working.

The gateway is fully loaded in miot plugin, but the curtain device is not recognized here.

merdok commented 1 year ago

Again, the data what you enter are wrong! The plugin tries to control your gateway because you entered wrong data. MJSGCLBL01LM is not the model, I guess lumi.curtain.agl001 is the model as you provided in the first post. And the deviceid you need to manually enter as the "Discover all devices via Micloud" will enter the gateway deviceid which is incorrect. To control your device you need to manually adjust the settings in the config.json for your device!

Schoschito commented 1 year ago

Thanks , found a solution with your Link: https://github.com/merdok/homebridge-miot/discussions/348

Mixing the gateway's ip with gateway's token and curtain device's id and curtains device's model was the solution to connect the BLE curtain driver.

i have updated the device and gateway ids in my first post since they were not correct.

merdok commented 1 year ago

Yeah, so this is what i was talking about from the beginning. So does the device already work?

Schoschito commented 1 year ago

lumi.curtain.hmcn02 works even it is recognized as unknown device - so lets close

merdok commented 1 year ago

thanks for the info, full support will be added in the next update.