[Feature request]: OTA for generated definitions of devices with an OTA client cluster

Aperta Adatta ai principianti
#33,684 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@jabla ci sta già lavorando.

Dal 13/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend, devtools

Direzione di ricerca

Leggi src/lib/generateDefinition.ts intorno alle righe 310–317 e test/generateDefinition.test.ts. Verifica come le definizioni generate gestiscono i cluster di output e in che modo gli export di OUTPUT_EXTENDERS estendono il comportamento. Aggiungi una verifica per un endpoint con genOta come cluster di output, poi conferma che la definizione generata abilita OTA ed esegui il test mirato.

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

Descrizione

Is your feature request related to a problem? Please describe

A device without a definition gets an automatically generated one, which never sets ota. So Z2M offers it no update from the index, not even from zigbee_ota_override_index_location, although the device has the OTA client cluster.

I ran into this with an ESP32-C6 running ESPHome's native Zigbee (router, genOta as output cluster on endpoint 1). On Z2M 2.14.3 the device shows supports_ota: false. Both bridge/request/device/ota_update/check and bridge/request/device/ota_update/update answer:

Device '<device>' does not support OTA updates
Describe the solution you'd like

Let generateDefinition enable OTA when an endpoint has genOta as output cluster. Either set ota: true on the generated definition or add an m.ota() extend with a genOta entry in OUTPUT_EXTENDERS, so the exported external definition keeps it too. I'm happy to open a PR with a test in test/generateDefinition.test.ts for whichever you prefer.

Describe alternatives you've considered
  • A url or hex in each update request works, but only by hand and without an update notice.
  • An external converter with ota: true works too, but needs a file per model although the generated definition is fine otherwise.
Additional context

Zigbee OTA for ESPHome is being worked on (https://github.com/esphome/feature-requests/discussions/3573), so more of these devices will show up.

Offering OTA should be safe: an image is only offered when manufacturer code, image type and version match. The public index has no entries with manufacturer code 0 or 0x131B (Espressif), the codes these devices use. Automatic checks are limited by update_check_interval and can be turned off.

Relevant code: generateDefinition.ts, otaUpdate.ts (automatic check), otaUpdate.ts (manual check)

Lingua principale
TypeScript
Stelle
15.8k
Fork
2.1k
Merge medio
1g 6h
PR unite (30g)
38

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.