Feature request: Event when a ZHA device communicates

オープン
#894 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
embedded-iot, python
領域
embedded-iot

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
Python
スター
96
フォーク
84
平均マージ
3日 1時間
マージ済み PR(30日)
13

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zigpy/zha のほかの issue

zigpy/zha の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。