merdok / homebridge-miot

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

Stuck on closing/opening in lumi.curtain.hmcn02 (Xiaomi BLE Curtain Driver E1) #451

Closed romacv closed 1 year ago

romacv commented 1 year ago

Describe the bug Curtains is almost always stucking in status "closing..." or "opening" state. Sometimes it will be update after tapping several times and passing the loops close/open.

Expected behavior Correctly status updates.

Your config.json { "name": "Entrance Left Curtain", "ip": "192.168.1.22", "token": "48715737553778326f566b6f42524d6c", "deviceId": "1049930262", "model": "lumi.curtain.hmcn02", "pollingInterval": 10, "deepDebugLog": false, "onlyMainService": true, "buzzerControl": true, "ledControl": true, "childLockControl": true, "modeControl": true, "motorControl": true }, { "name": "Entrance Right Curtain", "ip": "192.168.1.22", "token": "48715737553778326f566b6f42524d6c", "deviceId": "1000898268", "model": "lumi.curtain.hmcn02", "pollingInterval": 10, "deepDebugLog": false, "onlyMainService": true, "buzzerControl": true, "ledControl": true, "childLockControl": true, "modeControl": true, "motorControl": true }

Debug log [11/03/2023, 20:48:46] [homebridge-miot] [Entrance Left Curtain] Starting property polling. [11/03/2023, 20:52:03] [homebridge-miot] [Entrance Left Curtain] Got device configuration, initializing device with name: Entrance Left Curtain [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Model known: lumi.curtain.hmcn02! [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Initializing device! [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Initializing device services [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Device services: [ "curtain", "identify", "battery", "curtain-cfg" ] [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Initializing device properties [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Device properties: [ "curtain:motor-control", "curtain:target-position", "curtain:status", "curtain:fault", "curtain:motor-reverse", "curtain:current-position", "curtain:wake-up-mode", "battery:battery-level", "battery:charging-state", "curtain-cfg:set-limit-point", "curtain-cfg:limit-point-num", "curtain-cfg:curtain-manual", "curtain-cfg:curtain-range-flag", "curtain-cfg:run-time", "curtain-cfg:lock-unlock-cmd", "curtain-cfg:lock-unlock-status", "curtain-cfg:bright-status", "curtain-cfg:remote-power-off", "curtain-cfg:battery-temp-warning", "curtain-cfg:long-batt-life-mode", "curtain-cfg:aging-test", "curtain-cfg:set-rail-type", "curtain-cfg:sync-utc", "curtain-cfg:light-auto-timezone", "curtain-cfg:light-auto-param", "curtain-cfg:unlocked-ever", "curtain-cfg:pointset-block-time", "curtain-cfg:long-batt-time-zoom" ] [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Initializing device actions [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Device actions: [ "curtain:motor-calibrate", "identify:identify", "curtain-cfg:sync-all-rd-attr", "curtain-cfg:block-auto-pointset", "curtain-cfg:resume-auto-pointset" ] [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Successfully created a Curtain device! It is a Xiaomi BLE Curtain Driver E1. [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Initializing accessory! [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Accessory successfully initialized! [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Registering 1 accessories! [11/03/2023, 20:52:04] [homebridge-miot] [Entrance Left Curtain] Everything looks good! Initiating property polling! [11/03/2023, 20:52:06] [homebridge-miot] [Entrance Left Curtain] Device found! Setting up miot device from local connection! [11/03/2023, 20:52:06] [homebridge-miot] [Entrance Left Curtain] Connected to device: lumi.gateway.mcn001 [11/03/2023, 20:52:06] [homebridge-miot] [Entrance Left Curtain] Doing initial property fetch.

Screenshots IMG_7164 IMG_7165

merdok commented 1 year ago

I think this might be caused by a delay for the property updates? You would need to enable deepDebugLog and observe the log when you trigger the open or close to see if and how long it takes for the status properly to update.

romacv commented 1 year ago

I'm not sure if it's a delay, it's precisely the lack of a property update event. Because even a few hours after closing, the status "Opening..." may hang.

merdok commented 1 year ago

Like I mentioned, you need to check if the status property is properly updated from the device.