Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.21k stars 1.68k forks source link

Xiaomi ZNCLDJ11LM state is always open #24221

Open ASNNetworks opened 1 month ago

ASNNetworks commented 1 month ago

What happened?

This curtain (motor) always shows the state as open. When closing the curtain, the position attribute works fine and is set at 0%, however the state of the curtain remains as open.

This was an old bug that now appeared again, same as here: https://github.com/Koenkk/zigbee2mqtt/issues/15926

I noticed that if you wait for a few minutes (like 2-5 min from my testing), the curtain changes itself to the correct state (off). It should be immediately however. I tried changing the report settings, but it had no effect.

The strange part is I updated to latest Z2M version a few days ago, but the issue only happened today after the curtain lost the Zigbee network for some reason. I tried removing (forced) and repairing the device and also reset its limits and setup again. State keeps on open, even when at 0%, which breaks automations and button-cards that rely on closed state.

What did you expect to happen?

I expected it to show the correct state when closed.

How to reproduce it (minimal and precise)

Close the curtain using Z2M dashboard or HA dashboard or automations.

Zigbee2MQTT version

1.40.2-1

Adapter firmware version

20221226

Adapter

Sonoff Dongle-P

Setup

Z2M as add-on installed on HA

Debug log

Below the log from opening once (from closed state), waiting and then closing again once. Also strange why this device even sends a temperature?

info 2024-10-05 14:34:19z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kantoor Gordijnen', payload '{"device_temperature":35,"last_seen":"2024-10-05T14:34:19+02:00","linkquality":160,"motor_state":null,"options":{"hand_open":true,"reverse_direction":false},"position":0,"power_outage_count":2,"running":null,"state":"OFF","update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
info 2024-10-05 14:34:24z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kantoor Gordijnen', payload '{"device_temperature":35,"last_seen":"2024-10-05T14:34:24+02:00","linkquality":160,"motor_state":null,"options":{"hand_open":true,"reverse_direction":false},"position":31,"power_outage_count":2,"running":null,"state":"OFF","update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
info 2024-10-05 14:34:25z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kantoor Gordijnen', payload '{"device_temperature":35,"last_seen":"2024-10-05T14:34:25+02:00","linkquality":160,"motor_state":null,"options":{"hand_open":true,"reverse_direction":false},"position":100,"power_outage_count":2,"running":null,"state":"OFF","update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
info 2024-10-05 14:34:29z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kantoor Gordijnen', payload '{"device_temperature":35,"last_seen":"2024-10-05T14:34:29+02:00","linkquality":160,"motor_state":null,"options":{"hand_open":true,"reverse_direction":false},"position":0,"power_outage_count":2,"running":null,"state":"OFF","update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
info 2024-10-05 14:34:34z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kantoor Gordijnen', payload '{"device_temperature":35,"last_seen":"2024-10-05T14:34:34+02:00","linkquality":156,"motor_state":null,"options":{"hand_open":true,"reverse_direction":false},"position":99,"power_outage_count":2,"running":null,"state":"OFF","update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
info 2024-10-05 14:34:37z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kantoor Gordijnen', payload '{"device_temperature":35,"last_seen":"2024-10-05T14:34:37+02:00","linkquality":160,"motor_state":null,"options":{"hand_open":true,"reverse_direction":false},"position":0,"power_outage_count":2,"running":null,"state":"OFF","update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Drafteed commented 1 month ago

Let's start over:

  1. What fw version is currently installed on the device?
  2. Are there any OTA updates for the device?
  3. Check in the Z2M devices map whether the device is connected directly to coordinator or through some other device-router?
ASNNetworks commented 1 month ago

Let's start over:

  1. What fw version is currently installed on the device?
  2. Are there any OTA updates for the device?
  3. Check in the Z2M devices map whether the device is connected directly to coordinator or through some other device-router?
  1. It has the same firmware since I purchased it years ago. It doesn't show a version in frontend, only a date: 04-13-2017. Also, Z2M says there is an update since a while ago (before that it never got an update), but that update never installs. I looked into it, and seems to be some kind of bug, where it actually has no firmware update. So I have never updated the firmware, since it's not available.
    1. see above.
    1. it's to both the coordinator and multiple others when I check the map: image When I only tick is parent, then I see only one line from the device to the coordinator. So it seems it is directly hooked up to that.
Drafteed commented 1 month ago
  1. It has the same firmware since I purchased it years ago. It doesn't show a version in frontend, only a date: 04-13-2017. Also, Z2M says there is an update since a while ago (before that it never got an update), but that update never installs. I looked into it, and seems to be some kind of bug, where it actually has no firmware update. So I have never updated the firmware, since it's not available.

Actual firmware build date for ZNCLDJ11LM: 01-25-2022. After purchasing, I also had build from ~2017-2019, which was then updated to 01-25-2022 via OTA.

ASNNetworks commented 1 month ago
  1. It has the same firmware since I purchased it years ago. It doesn't show a version in frontend, only a date: 04-13-2017. Also, Z2M says there is an update since a while ago (before that it never got an update), but that update never installs. I looked into it, and seems to be some kind of bug, where it actually has no firmware update. So I have never updated the firmware, since it's not available.

Actual firmware build date for ZNCLDJ11LM: 01-25-2022. After purchasing, I also had build from ~2017-2019, which was then updated to 01-25-2022 via OTA.

Yes, but as I mentioned, it never updates. When its finished, it's the same firmware and still available. Have tried it like 30x in the past year. Most likely there is a small difference in devices (perhaps mine is older, since I own it for like 5 years), but Z2M sees them as the same.

Drafteed commented 1 month ago

If you are having trouble with OTA, and if you have enthusiasm, you can flash the device via TTL and JN51xxProgrammer.exe. It's not very difficult there, but it requires some soldering skills: https://1-re--engr-ru.translate.goog/aqara_curtain/?_x_tr_enc=1&_x_tr_sl=ru&_x_tr_tl=en&_x_tr_hl=ru&_x_tr_pto=wapp Fresh FW (07-17-2020): https://github.com/re-engr/zigbee_firmware/blob/main/aqara/curtain/lumi_curtain_0034_07172020.bin

ASNNetworks commented 1 month ago
  1. It has the same firmware since I purchased it years ago. It doesn't show a version in frontend, only a date: 04-13-2017. Also, Z2M says there is an update since a while ago (before that it never got an update), but that update never installs. I looked into it, and seems to be some kind of bug, where it actually has no firmware update. So I have never updated the firmware, since it's not available.

Actual firmware build date for ZNCLDJ11LM: 01-25-2022. After purchasing, I also had build from ~2017-2019, which was then updated to 01-25-2022 via OTA.

thanks, but I don't want to mess with soldering, just to install an OTA, which might not even fix anything. Also this devices worked fine, and suddenly it has the same bug from 2 years ago, that was fixed with a dev build like in my previous ticket. So I am hoping there is an easy fix from Z2M side. Also since the device worked fine with the same FW.

Drafteed commented 1 month ago

I think it's a bug in your firmware, because it appeared again after repairing. I don't see any changes from Z2M regarding this device in the last few months.

Drafteed commented 1 month ago

thanks, but I don't want to mess with soldering, just to install an OTA, which might not even fix anything

You can also try connecting the device to the original Aqara/Xiaomi hub - maybe it will update it.

ASNNetworks commented 1 month ago

I think it's a bug in your firmware, because it appeared again after repairing. I don't see any changes from Z2M regarding this device in the last few months.

I have repaired this device a few times for the last 5 years, and this bug only has happened twice. The first time didn't happen after a re-pair btw. First time from the old ticket, which was fixed after a dev update from Z2M. Reverting Z2M build also fixed it back then (there were multiple tickets and people) and now also. Since I also updated Z2M a few days ago, it is possible something has changed.

I will try to revert to older Z2M build to test this. If it works with a previous build, then it has to do with Z2M. If it's still broken with an older Z2M build (where it wasn\t broken before) then it's the device.