Native scene recall fails to update overlapping Zigbee group states despite individual member states updating correctly
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Start with the lastOptimisticState handling in lib/extension/groups.ts, the area identified in the issue, and trace how native scene recalls and overlapping group updates publish state. Compare the cached optimistic state with the published state during the reproduction steps. Done means all affected overlapping group states match their individual members after both ON and OFF scene recalls; the issue reports no failing test or debug log, so first identify or add a focused reproduction.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
Following discussion in #33910, I was advised to raise a separate issue for this behaviour.
When recalling a native Zigbee scene on a group containing devices that also belong to other groups, the individual device states update correctly, but the overlapping groups intermittently retain their previous states.
My setup consists of a main Kitchen group containing 26 lights, with several smaller groups sharing those same devices.
For example, after recalling a native OFF scene, the following states were recorded:
| Group | Individual devices reporting OFF | Reported group state |
|---|---|---|
| Kitchen | 26/26 | OFF |
| Kitchen Spots | 11/11 | ON |
| Kitchen Island | 3/3 | ON |
| Apex Ceiling | 3/3 | ON |
| Apex Party | 5/5 | ON |
All 26 individual devices correctly reported OFF, but every overlapping subgroup incorrectly remained ON.
The issue also occurs in the opposite direction when recalling an ON scene from an OFF state.
The physical lights respond correctly. The issue concerns the reported state of overlapping groups.
Standard group ON/OFF commands correctly update the overlapping groups in my testing.
The behaviour has been reproduced using freshly created scenes and after upgrading coordinator firmware.
What did you expect to happen?
When a native scene is recalled, all groups containing affected devices should have their states updated consistently with their individual members and configured off_state behaviour.
If every member of a group reports OFF, the group should report OFF.
If every member of a group reports ON, the group should report ON.
The resulting group states should be consistent regardless of whether the devices were controlled through individual commands, standard group commands or native scene recall.
How to reproduce it (minimal and precise)
-
Create a Zigbee group (Group A) containing multiple lights.
-
Create two additional Zigbee groups (Group B and Group C), each containing different subsets of the devices also belonging to Group A.
-
Store two native scenes on Group A:
- Scene 0: All lights OFF
- Scene 16: All lights ON
-
Recall Scene 16 to establish an ON state.
-
Turn Group A OFF using a standard group command:
Topic: zigbee2mqtt/Kitchen/set
Payload: {"state":"OFF"} -
Turn Group B ON and then OFF directly, leaving Group C untouched.
-
Recall Scene 16 on Group A:
Topic: zigbee2mqtt/Kitchen/set
Payload: {"scene_recall":16} -
Compare the reported states of Group B and Group C against their individual members.
In my controlled testing:
- All individual devices reported ON.
- Group B, which had been directly toggled, correctly reported ON.
- Group C, which had remained untouched, incorrectly reported OFF.
Repeating this test with four overlapping subgroups resulted in only the directly toggled subgroup updating correctly.
As a control test, replacing the scene recall command with a standard group ON command resulted in all overlapping groups updating correctly.
The issue can also be reproduced in the opposite direction by recalling Scene 0 after establishing an ON state.
Repeated cycles may be required to reproduce the behaviour.
Zigbee2MQTT version
2.14.4
Adapter firmware version
Nerivec EmberZNet 9.1.2 [GA] – v2026.6.2-pre1
Adapter
SONOFF Dongle Max (Dongle-M) – EFR32MG24 – Ember – 460800 baud – Ethernet
Setup
Zigbee2MQTT running as a Home Assistant add-on.
Hardware: Dell Wyse 5070
CPU: Intel Pentium Silver J5005
RAM: 8 GB
Coordinator: SONOFF Dongle Max (Dongle-M)
Connection: Ethernet (TCP)
Adapter: ember
Firmware: Nerivec 9.1.2
Baudrate: 460800
The network contains multiple overlapping Zigbee groups.
The affected Kitchen group contains 26 lights, including IKEA lighting devices.
The smaller groups are separate native Zigbee2MQTT groups sharing member devices with the larger Kitchen group.
Scenes have been recalled both directly through the Zigbee2MQTT frontend and through MQTT commands from Home Assistant.
Device database.db entry
N/A – This issue concerns group state propagation across multiple devices and groups.
Debug log
No corresponding errors or warnings were observed in the Zigbee2MQTT notifications during the latest reproduction.
The following is a summary of timestamped Home Assistant state history from a controlled test on 3 December 2026.
22:46:59 – Standard group ON command
- All 26 devices ON
- All four overlapping subgroups ON
22:49:21 – Native Scene 0 recalled
- All 26 individual devices changed to OFF
- Main Kitchen group changed to OFF
- Kitchen Spots remained ON
- Kitchen Island remained ON
- Apex Ceiling remained ON
- Apex Party remained ON
22:50:29 – Native Scene 16 recalled
- All 26 individual devices changed to ON
- Main Kitchen group changed to ON
- All four overlapping subgroups remained ON throughout the entire sequence, with no recorded OFF transition.
Full Zigbee2MQTT debug logs can be provided if required.
Notes
Related issue: #33910
The original issue also included Ember multicast registration errors. These appear to have been resolved by upgrading to Nerivec firmware 9.1.2, as recommended by @andrei-lazarov.
However, the overlapping group state issue remains independently reproducible.
Troubleshooting already undertaken:
- Tested coordinator firmware 7.4.5, 8.2.2 and Nerivec 9.1.2.
- Deleted and recreated both native ON and OFF scenes.
- Created a new test group containing identical members to an existing group.
- Verified individual device states against group states using timestamped Home Assistant history.
- Compared native scene recall with ordinary group commands.
- Performed controlled testing where one overlapping subgroup was directly toggled before scene recall whilst the remaining subgroups were left untouched.
Possible area for investigation:
In lib/extension/groups.ts, the lastOptimisticState mechanism appears to suppress duplicate optimistic group state publications.
Directly controlling a group invalidates its cached optimistic state. However, when an overlapping group is updated indirectly through another group's command, it appears possible for its cached optimistic state to become inconsistent with its published state.
A subsequent native scene recall may therefore result in a legitimate group state update being suppressed because the incoming payload matches the previous cached optimistic state, despite the group's currently published state being different.
This is a hypothesis based on the observed behaviour and source code, rather than a confirmed root cause.
The groups.ts implementation was compared between release 2.14.4 and the dev branch and appeared identical at the time of investigation. I have not run the dev branch on my production network.
Happy to provide further debug logs or undertake additional controlled testing.
- Lingua principale
- TypeScript
- Stelle
- 15.9k
- Fork
- 2.1k
- Merge medio
- 12h 11m
- PR unite (30g)
- 32
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Koenkk/zigbee2mqtt
-
Group Exposes always displays unknown state (?) despite valid group state being published via MQTTApertaproblem
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Koenkk/zigbee2mqtt#33925 ·
I maintainer di solito rispondono entro 1 giorno
-
problem
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Koenkk/zigbee2mqtt#33894 ·
I maintainer di solito rispondono entro 1 giorno
-
problem
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Koenkk/zigbee2mqtt#33892 ·
I maintainer di solito rispondono entro 1 giorno
-
problem
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
Koenkk/zigbee2mqtt#33891 ·
I maintainer di solito rispondono entro 1 giorno
-
[SNZB-02DR2 / SONOFF] ???Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
Koenkk/zigbee2mqtt#33890 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Koenkk/zigbee2mqtt
Issue simili
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-js#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
agent/quality testing
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 1 giorno
-
GitHub registry install via `gh` credentials rewrites `\u0000`–`\u001f` escapes in source files to `^@`–`^_`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
juspay/agent-distro#203 ·
I maintainer di solito rispondono entro 1 giorno