HomeACcessoryKid / AQARA-ZNCLDJ11LM

Aqara curtain motor ZNCLDJ11LM
Apache License 2.0
21 stars 6 forks source link

Could you help me trying to get the motor working with tasmota? #3

Open balu- opened 3 years ago

balu- commented 3 years ago

Hi there,

I've got the Aqara curtain motor and I'm quite happy with it. The only down side of it seems to be that it sometimes messes with my zigbee mash. Sometimes it gets unresponsible and makes zigbee devices around it also unresponsible. Luckyly i stumbled upon your repository and got the idee that i could replace the zigbee module with an esp.

My existing devices are controlled via zigbee respectively mqtt (tasmota) so unfortunately no homekit. Therefor I was wondering if I clould get the curtain working with mqtt/tasmota. Tasmota enables a Serial Bridge mode with 9600 Baud & 8N1 (https://tasmota.github.io/docs/Commands/#serial-bridge) which should build the precondition to get things working. Or do you think otherwise / see preconditions that aren't met?

My thinking is not to have the controlling logic in the esp itself rather then to use the esp only as bridge and have the logic in some remote script that sends the via mqtt the bytes that the esp transmits.

The main thing that I'm missing to do that is an understanding of which bytes need to be send via serial to create which action respectivly which bytes are sent over serial to report which state. I tried to read and understand the main.c file, unfortunatelly my C skills are a bit rusty. So could you maybe help me with that?

Am I right in the assumptions that sending: 0x03,0x01,0xb9,0x24 (_open) lets the curtain (complety?) open, 0x03,0x02,0xf9,0x25 (_close) lets the curtain (complety?) close, 0x03,0x03,0x38,0xe5 (_pause) lets the curtain stop (pause) in its current position 0x55,0xfe,0xfe,0x03,0x04,0x00(setpos) moves to position (where the last byte is the position (0-255) [I don't get the whole crc calculation part in the method target_set because i don't see where _setpos is used]

Is that correct so far?

HomeACcessoryKid commented 3 years ago

I know it is going to be cryptic enough, but look at the wiki article

Be aware that parsing the responses is just as important in making this work, and they made the encoding that is not parsable with 100% closed logic... hence the character by character approach