[Improvement] Sonoff SNZB-09P: Group alarm configuration attributes into a single ZCL write to reduce latency

Aperta
#33,908 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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
49/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Find the Sonoff SNZB-09P converter and inspect how it handles the alarm configuration keys and sends their ZCL writes. Check whether the Zigbee library and device support writing those attributes together, then compare the write behavior for a payload containing several alarm settings. Done means the settings are sent in one multi-attribute write when supported and the siren uses the new configuration when triggered immediately afterward.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

problem
What happened?
Device information
  • Model: Sonoff SNZB-09P (Indoor Zigbee Siren)
  • Firmware version: 1.2.0 (4608 / SN-TLSR8656-09P-01-v1.2.0.ota)
  • Power supply mode: Tested on both Battery and USB-C DC power — identical latency observed.
Describe the issue / improvement

When sending a single MQTT JSON payload containing multiple alarm configuration attributes (e.g., sound enable, light enable, volume level, sound type, and duration) right before triggering the siren (siren_on), there is a ~1.5 to 2 seconds latency before the siren actually starts ringing.

Because Zigbee2MQTT sends each attribute sequentially in separate ZCL write frames (requiring 5 consecutive radio round-trips and internal flash writes), it creates a noticeable bottleneck—even when the device is powered via USB-C (DC). If siren_on: ON is sent without an artificial delay (~2000 ms), the siren triggers using the previous configuration before all new parameters have finished writing.

Request

Could the Zigbee converter for the SNZB-09P group these alarm configuration attributes into a single multi-attribute ZCL write command when multiple keys are present in the same MQTT /set payload ?

Steps to reproduce

Publish a single MQTT payload to zigbee2mqtt/Entrance Siren/set:

{
  "alarm_sound_enable": "ON",
  "alarm_light_enable": "OFF",
  "alarm_volume_level": "low",
  "alarm_sound_type": "chime_doorbell",
  "alarm_duration": 2
}

Followed immediately by:

{
  "siren_on": "ON"
}
Zigbee2MQTT Logs

As shown by the last_seen timestamps below, it takes 1.55 seconds just to acknowledge the sequential configuration writes before siren_on (alarm_type: manual) is processed at 13:17:38.912:

[03/12/2026 14:17:36] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Entrance Siren', payload '{"alarm_duration":2,"alarm_light_enable":"OFF","alarm_sound_enable":"ON","alarm_sound_type":"chime_doorbell","alarm_type":"none","alarm_volume_level":"low","battery":90,"last_seen":"2026-12-03T13:17:36.818Z","linkquality":140,"power_supply_mode":"battery","siren_on":"OFF","tamper":false,"update":{"installed_version":4608,"latest_version":4608,"state":"idle"}}'
[03/12/2026 14:17:37] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Entrance Siren', payload '{"alarm_duration":2,"alarm_light_enable":"OFF","alarm_sound_enable":"ON","alarm_sound_type":"chime_doorbell","alarm_type":"none","alarm_volume_level":"low","battery":90,"last_seen":"2026-12-03T13:17:37.546Z","linkquality":140,"power_supply_mode":"battery","siren_on":"OFF","tamper":false,"update":{"installed_version":4608,"latest_version":4608,"state":"idle"}}'
[03/12/2026 14:17:37] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Entrance Siren', payload '{"alarm_duration":2,"alarm_light_enable":"OFF","alarm_sound_enable":"ON","alarm_sound_type":"chime_doorbell","alarm_type":"none","alarm_volume_level":"low","battery":90,"last_seen":"2026-12-03T13:17:37.824Z","linkquality":140,"power_supply_mode":"battery","siren_on":"OFF","tamper":false,"update":{"installed_version":4608,"latest_version":4608,"state":"idle"}}'
[03/12/2026 14:17:38] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Entrance Siren', payload '{"alarm_duration":2,"alarm_light_enable":"OFF","alarm_sound_enable":"ON","alarm_sound_type":"chime_doorbell","alarm_type":"none","alarm_volume_level":"low","battery":90,"last_seen":"2026-12-03T13:17:38.367Z","linkquality":140,"power_supply_mode":"battery","siren_on":"OFF","tamper":false,"update":{"installed_version":4608,"latest_version":4608,"state":"idle"}}'
[03/12/2026 14:17:38] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Entrance Siren', payload '{"alarm_duration":2,"alarm_light_enable":"OFF","alarm_sound_enable":"ON","alarm_sound_type":"chime_doorbell","alarm_type":"none","alarm_volume_level":"low","battery":90,"last_seen":"2026-12-03T13:17:38.367Z","linkquality":140,"power_supply_mode":"battery","siren_on":"ON","tamper":false,"update":{"installed_version":4608,"latest_version":4608,"state":"idle"}}'
[03/12/2026 14:17:38] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Entrance Siren', payload '{"alarm_duration":2,"alarm_light_enable":"OFF","alarm_sound_enable":"ON","alarm_sound_type":"chime_doorbell","alarm_type":"manual","alarm_volume_level":"low","battery":90,"last_seen":"2026-12-03T13:17:38.912Z","linkquality":140,"power_supply_mode":"battery","siren_on":"ON","tamper":false,"update":{"installed_version":4608,"latest_version":4608,"state":"idle"}}'

Thank you for your help!

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

2.14.4-1

Adapter firmware version

7.4.4

Adapter

SkyConnect

Setup

Add-on on Home Assistant OS

Device database.db entry

No response

Debug log

No response

Notes

No response

Lingua principale
TypeScript
Stelle
15.9k
Fork
2.1k
Merge medio
12h 11m
PR unite (30g)
32

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Koenkk/zigbee2mqtt

Tutte le issue di Koenkk/zigbee2mqtt

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.