YinHangCode / homebridge-mi-aqara

a homebridge plugin for XiaoMi Aqara plugin.
1.08k stars 154 forks source link

aqara curtain stop #307

Closed rmzzzr closed 2 years ago

rmzzzr commented 2 years ago

I apologize in advance, I use a translator. I have the "aqara curtain" sign. I use your plugin with mqtt in order to manage them with esp8266. But there is one problem, I could not find such a function as "curtain stop" in any way. I want to make the logic work something like this: one click on the esp8266 button and the curtain opens, but if I press another button, the curtain will stop. At the moment I am sending a command using mqtt "data": { "curtainlevel": "..." this command indicates how much the curtain should open. And it works great for almost all interfaces (iphone, ipad, android), but it doesn't work well to implement control using esp8266. If you add a command in the "data" style: { "curtain command": "stop"

It would greatly simplify my life)) Such a command exists in the xiaomi application

If you can't help me. Then please, at least give me a hint how to do it, maybe I can do it myself.

rmzzzr commented 2 years ago

I accidentally found how to do it myself))

this plugin uses a communication protocol http://docs.opencloud.aqara.com/development/gateway-LAN-communication/#_11

It describes all the existing functions. I found the request I needed for MQTT in looks like this

{ "cmd": "write", "model": "curtain", "sid": "....", "data": { "curtain_status":"stop", "key": "${key}" } }