[Feature request]: Average group members' states instead of last modification winning
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
The request concerns how Zigbee group light states are calculated; it names no source files or tests. Start by tracing the code that derives group state from member updates and compare it with the light group behavior described in the issue. Done means deciding the averaging rules and opt-in/default behavior, then reporting the requested values for devices that are on.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe
Since #31663, Home Assistant can auto-discover group members and display it like it's own helper groups, which is amazing. This mostly removes the need for defining helpers on the HA side. However, this also means that the group states are more important than before, as HA displays the values it gets from zigbee2mqtt instead of calculating them itself.
Instead of averaging those values (brightness, hue, color temp), Z2M takes the "last modification wins" approach (other than off state, which is more sophisticated, and is the precedent for what I'm after here), and assigns the last changed members' state as the group state. This is not what the frontends (HA, Ikea, Apple Home, etc.) usually do, and is rather unexpected.
Describe the solution you'd like
It would be neat if z2m used the same-ish rules that home assistant uses when calculating the various values for its group helpers for lights. This means:
- mean of brightness
- mean color temperature (it would have to be decided whether to average mireds directly or convert to kelvin first, then average, then convert back, but that's minor IMO)
- mean for xy color
- circular mean for hue
taken over the devices that are on. (There are probably some edge cases here, happy to think them through and discuss then before jumping into the implementation if we decide to go ahead with this feature.)
Describe alternatives you've considered
Not changing anything in Z2M leaves two options in HA, both of which I consider workarounds:
- Don't use zigbee groups but use HA group helpers. This is not great as it leads to popcorning, increases network traffic, etc.
- Create template lights for each Z2M group that calculate the "correct" averages but forward group commands to the underlying zigbee group directly. It's not too bad with #31663 in hand, but still one extra helper per zigbee group, and they have to be kept sync over the two services.
Additional context
Here's a depiction of what the group reports when I set bulb 1 first and bulb 2 next. I'd expect the group slider to be in the middle.
I'd be more than happy to take a stab at implementing this feature after discussing some of the bigger open questions (e.g., is it opt-in or the new default/only behavior) if you agree that it would be nice to have.
Current Z2M version: 2.14.3. Behavior on dev should be the same based on looking at the code.
- Lingua principale
- TypeScript
- Stelle
- 15.8k
- Fork
- 2.1k
- Merge medio
- 1g 6h
- PR unite (30g)
- 38
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
-
[Feature request]: OTA for generated definitions of devices with an OTA client clusterForse già presa @jabla l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
Koenkk/zigbee2mqtt#33684 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
new device support
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Koenkk/zigbee2mqtt#33674 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature request]: Support espzb adapter (ESP Zigbee SDK v2, ESP32-S31)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Koenkk/zigbee2mqtt#33668 ·
I maintainer di solito rispondono entro 1 giorno
-
problem
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
Koenkk/zigbee2mqtt#33645 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Koenkk/zigbee2mqtt#33613 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Koenkk/zigbee2mqtt
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
devswha/herdr-web-ui#3875 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
area: runtime chore cli consistency dependencies developer-experience difficulty: easy discovery documentation enhancement good first issue help wanted hygiene json-output packaging priority: P3 tests version
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
discovery:other factory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
vercel/ai#25068 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
create-strapi-app doesn't await writing license.txt, so a failed write skips its error handlingApertaflag: invalid template issue: bug severity: low source: cli status: pending reproduction version: 5
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
strapi/strapi#28637 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni