Feature request: Event when a ZHA device communicates

Aperta
#894 5 commenti 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
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
embedded-iot, python
Ambito
embedded-iot

Direzione di ricerca

No files or tests are named, so start by finding out whether zigpy already emits a signal for incoming device messages that ZHA could forward, and check the thread for a decision on the event's shape. The payload asks whether such a signal exists rather than specifying a change. Done means an agreed event name and payload, plus a way to emit it from received Zigbee packets.

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

Descrizione

Would it be possible for ZHA to expose an event whenever communication is received from a Zigbee device?

The use case is maintaining a reliable per-device last_seen timestamp and detecting devices that have stopped checking in.

Home Assistant entity timestamps are not ideal for this because a device may report the same value repeatedly without producing a meaningful entity state change. What would be useful is an event tied to actual Zigbee communication from the physical device.

For example, something conceptually like:

event_type: zha_device_activity
data:
  device_ieee: "00:11:22:33:44:55:66:77"
  device_id: "..."

The exact event name/data is not important. The main requirement would be that it fires whenever ZHA receives a valid packet/report/command from that device.

That would make it possible to build automations such as:

  • Maintain a true last_seen timestamp per ZHA device
  • Detect sleepy end devices that have stopped reporting
  • Mark devices as degraded/offline using user-defined timeouts
  • Build diagnostic dashboards without periodically polling all ZHA devices

Ideally this would represent device communication rather than only entity state changes or button-style zha_event actions.

Is there already an internal ZHA/zigpy signal that represents this which could reasonably be exposed to Home Assistant automations?

Lingua principale
Python
Stelle
96
Fork
84
Merge medio
3g 1h
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 zigpy/zha

Tutte le issue di zigpy/zha

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.