Koenkk / zigbee2mqtt

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

Inconsistent group state. Cover group state "close" even if one device is "open" #24163

Open Trexano99 opened 6 days ago

Trexano99 commented 6 days ago

What happened?

I have create a group with multiple BTicino cover shutter (K4027C/L4027C/N4027C/NT4027C) on Z2M and it works well, but the state sometimes is inconsistent.
The group state is presented as "CLOSE" while one of the devices "Tapparella PF Cucina" in the group is in state "OPEN".
What should be the problem?
This is the group ("Tutte Tapparelle"): Immagine 2024-09-30 223449 and this is the log: Immagine 2024-09-30 223630 _P.S: The group off_state is "all_membersoff"

What did you expect to happen?

The group "Tutte Tapparelle" to be "OPEN"

How to reproduce it (minimal and precise)

It happen randomly.

Zigbee2MQTT version

1.40.1

Adapter firmware version

7.4.1 [GA]

Adapter

Zigbee 3.0 USB Dongle-E plus V2 (with ember driver)

Setup

Home Assistant OS, x86-64

Debug log

I have seen that in the log the state of "Tutte Tapparelle" continue switching from CLOSE to OPEN even if no action take place. log.log

Trexano99 commented 4 days ago

Watching at the code I suspect the problem is that even if using the option off_state: 'all_members_off', the state group changing is triggered iif the changed device is OFF and all other devices are in state OFF.

In case of groups of cover the change is OPEN or CLOSE, and this (not ON - OFF) bring the group to change state every time a device change it's state or only broadcast it (as my situation).

According to that I have proposed a fix on my fork managing also the state OPEN, CLOSE.

The only problem is that I cannot test this code because I am running Z2M on HomeAssistant using the specific Add-On, and so I don't know how to propagate the changes to make my own tests. I have seen there's the part of Testing changes locally in the documentation, but entering the docker container I can't find the src Z2M files (maybe because removed during the Docker build) but only the zigbee-herdsman-converters and few other parts.

Sry for the tag @Koenkk but if you can help my with understanding how to test my changes i would really appreciate that and for sure I will also help to trouble other issues. Thx

Koenkk commented 3 days ago

@Trexano99 you have to edit the equivalent .js files under the dist folder to test the changes locally.