Mains routers can stay available while all directed APS requests fail
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, observability
Research direction
Start by reading the ZHA device availability and directed request handling paths, then determine whether outbound health belongs in ZHA or zigpy, as the issue leaves that design open. Compare tracking delivery failures and successful requests with the existing inbound last_seen signal; done means users can distinguish inbound-only traffic from confirmed bidirectional communication without changing availability after a single failure. No specific files or tests are named.
Written by the indexing model from the issue text.
Description
Summary
Mains-powered Zigbee routers can remain available in ZHA while every directed request to them fails at APS delivery. Periodic unsolicited reports keep last_seen fresh, so the current availability state does not reveal that the coordinator-to-device path is broken.
Shelly Gen4 firmware 2.0.x/2.1.x makes this reproducible, but the issue here is the generic ZHA health blind spot rather than a request to work around Shelly firmware.
Environment
- Home Assistant Core 2026.11.0
- ZHA 2.4.2, zigpy 2.4.1, bellows 1.2.1, zha-quirks 2.4.1
- SONOFF ZBDongle-E, EmberZNet 6.10.3.0, channel 25, direct USB connection
- 34 nodes: 24 routers and 9 end devices, all online during the capture
- Six Shelly Mini 1PM Gen4 routers (
Shelly/Mini1PM, modelS4SW-001P8EU) on firmware 2.1.1
The same Shelly firmware failure is independently reproduced with Zigbee2MQTT, TI and Ember coordinators in Koenkk/zigbee2mqtt#32704. Shelly support has reportedly acknowledged it as a Gen4 firmware routing/mesh stability issue.
Observed behavior
- The affected devices continue sending electrical measurement and metering reports.
- ZHA therefore shows them as
available: true, with a freshlast_seenand LQI values between 108 and 168. - A directed On/Off command or cluster read can fail with:
zigpy.exceptions.DeliveryError: Failed to deliver message:
<sl_Status.ZIGBEE_DELIVERY_FAILED: 3074>
- During a short debug capture, five delivery failures targeted two of the six Shelly routers while their incoming reports continued.
- The devices remain reachable through their local Wi-Fi API and the coordinator shows no reset, serial, queue or buffer failure.
- Power cycling or rejoining a device can restore bidirectional Zigbee temporarily, after which it may degrade again without changing its NWK address.
This is particularly confusing operationally: Home Assistant presents a live state and an available device, but user commands fail.
Expected behavior
ZHA should make it possible to distinguish:
- no communication with a device;
- recent inbound traffic only;
- confirmed bidirectional communication.
One possible direction would be tracking the last successful directed request and/or consecutive APS delivery failures independently from inbound last_seen. This could be exposed as diagnostics or a degraded-health event rather than marking a device unavailable after a single failure. A periodic active probe for mains routers may be another option, although it would need conservative scheduling to avoid unnecessary mesh traffic.
Questions
- Is a separate outbound-health signal appropriate in
zha, or should this state be tracked in zigpy? - Would maintainers accept a PR that records consecutive directed delivery failures and clears the degraded state after the next successful request?
- Which public API or event should expose it without changing existing availability semantics?
I can test a proposed implementation against six affected devices and provide a sanitized debug capture if useful.
- Dominant language
- Python
- Stars
- 96
- Forks
- 84
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 30
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zigpy/zha
-
Device override creates the generic entity instead of the vendor-specific one (Light instead of HueLight, ForceOnLight, MinTransitionLight)Possibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Each time a device becomes available again, ZHA adds another firmware update listener that is never releasedPossibly taken @zigpy-review-bot claimed this 1 day ago. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Devices that left the network are re-initialized on every availability check, reading attributes from a device that is gonePossibly taken @zigpy-review-bot claimed this 1 day ago. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
device specific quirks
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pimutils/vdirsyncer#1242 ·
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/lean-cli#792 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-webui/open-webui#35360 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100