Skip to content

Import new device diagnostics - #797

Open
TheJulianJES wants to merge 17 commits into
devfrom
zigpy-bot/diagnostics-new-20260624
Open

TheJulianJES wants to merge 17 commits into
devfrom
zigpy-bot/diagnostics-new-20260624

Conversation

@TheJulianJES

Copy link
Copy Markdown
Contributor

This adds some new device diagnostics provided in quirks PRs. See the corresponding PRs in the commit details.
More commits will be pushed to this branch. They'll only regenerate properly with the next zha-quirks release (2.1.0).

There's also another branch for regenerated diagnostics that needs to be pulled into the next bump for quirks here:
https://github.com/zigpy/zha/tree/zigpy-bot/diagnostics-regenerated-20260624

@zigpy-review-bot
zigpy-review-bot force-pushed the zigpy-bot/diagnostics-new-20260624 branch from 6a74739 to a7ae4c3 Compare July 9, 2026 21:12
@codecov

codecov Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (c048c4a) to head (f6abc1d).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #797   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files          61       61           
  Lines       10870    10870           
=======================================
  Hits        10597    10597           
  Misses        273      273           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zigpy-review-bot
zigpy-review-bot force-pushed the zigpy-bot/diagnostics-new-20260624 branch from a7ae4c3 to d6b1c51 Compare July 9, 2026 21:20
@zigpy-review-bot zigpy-review-bot added the code quality Improvement to code quality label Oct 10, 2026
New-device snapshot provided in zigpy/zha-device-handlers#5435, which fixes the current-temperature mapping for this quirk (unreleased; regenerates properly with the next zha-quirks release).
From zigpy/zha-device-handlers#5472 (diagnostics dump attached by the author, imported against that PR's quirk at 4344da00).
@zigpy-review-bot

zigpy-review-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Added tests/data/devices/sonoff-trv-zbt-0x00001100.json (d4f1322), imported from the diagnostics dump attached to zigpy/zha-device-handlers#5472 and run against that PR's quirk at 4344da00.

The dump was taken with the author's custom quirk (trvzbt:(SONOFF / TRV-ZBT)), which still mapped Adaptive mode to smart_temperature_control (0x6017). The PR's quirk now uses temperature_control_mode (0x6013) on the TRV-ZBT, since 0x6017 is unsupported on that model, so the snapshot's Adaptive mode state doesn't come from a read of the right attribute. A fresh dump taken with the final quirk would be cleaner, and replacing this file once one exists is easy (delete it, re-import).

TODO @TheJulianJES: grab that diagnostics dump on fresh HA with latest quirk above merged.

@TheJulianJES

Copy link
Copy Markdown
Contributor Author

Note: Bot added one commit/diagnostic to #922 (5e5ef62). That's fine, as long as we don't force push it out of existence. But I guess we'll pick up all/more diagnostics from quirks issues/PRs later anyway.

From zigpy/zha-device-handlers#5318 (diagnostics dumps attached by the author, imported against that PR's quirk at 42a3db4d).
@TheJulianJES

Copy link
Copy Markdown
Contributor Author

@zigpy-review-bot update this PR

…new-20260624

# Conflicts:
#	tests/data/devices/bituo-technik-spm01x-0x0000000e.json
#	tests/data/devices/ctm-lyng-ax-valve-controller-0x0000002a.json
#	tests/data/devices/heiman-hm-722esy-e-plus-0x00000010.json
#	tests/data/devices/heiman-hs1ca-e-plus-0x00000020.json
#	tests/data/devices/heiman-relaymodule-ef-3-0-0x00000015.json
#	tests/data/devices/heiman-smokesensor-ef2-3-0-0x00000015.json
#	tests/data/devices/sonoff-snzb-02ld-0x00001100.json
#	tests/data/devices/third-reality-inc-3rdp01072z-0x00000030.json
#	tests/data/devices/third-reality-inc-3rwp01073z-0x00000030.json
@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Merged dev into this branch (eda2834, plain merge commit, no force push, so the #922 commit stays).

Nine of the diagnostics files added here had conflicted with the versions #922 already added to dev (the SNZB-02LD, four Heiman ones, both Third Reality plugs, Bituo SPM01X and CTM Lyng valve controller). I took dev's copies for all of them. What this PR still adds on top of dev is 4 files: CTM Lyng AX water sensor, Heiman HM-636THV-AC-M, SONOFF TRV-ZBT and the TS0601 _TZE200_znzs7yaw.

Full suite on the merged head: 1781 passed, 4 failed. The 4 failures are test_devices_from_files for exactly those 4 new files (the snapshots expect quirk_applied: true, but the installed zha-quirks 2.3.0 doesn't apply them). That matches the PR description (they only regenerate properly with the next quirks release), so I didn't regenerate anything. Once the quirks release with those PRs is in, re-mention me to regenerate them.

@TheJulianJES

Copy link
Copy Markdown
Contributor Author

@zigpy-review-bot Update again, note quirks 2.4.0 bump was merged. Check CI/tests.

@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Merged dev into this branch again (1e90c0f, plain merge, no force push; it brings in the quirks 2.4.0 bump from #993) and pushed f2f542d on top, which regenerates the 3 diagnostics files whose quirks are now applied: Heiman HM-636THV-AC-M, SONOFF TRV-ZBT and the TS0601 _TZE200_znzs7yaw. The CTM Lyng AX water sensor snapshot already passed with 2.4.0, so it is unchanged. The regen touched only those 3 files, all now quirk_applied: true (and the new snapshot format version 3).

Full suite before the regen: 1782 passed, 3 failed (exactly those 3 snapshots). After it, tests/test_discover.py is 1165 passed; the rest of the suite was green in the earlier run. CI on f2f542d is green (pre-commit and tests on Python 3.12, 3.13 and 3.14).

The SONOFF TRV-ZBT dump itself still comes from the author's custom quirk (Adaptive mode via 0x6017, see my earlier comment), so a fresh dump with the merged quirk is still worth replacing it with.

@TheJulianJES

Copy link
Copy Markdown
Contributor Author

@zigpy-review-bot Add these:
zha-01KAH6BZ8GBKBJXCPX8V4BB4KP-SONOFF TRV-ZBT-1c3c6d109528c721c27fc1ed5335f949.json

@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Replaced tests/data/devices/sonoff-trv-zbt-0x00001100.json with the new dump (9af9637, plain commit on top, no force push). I deleted the old file and re-imported the attachment with tools/import_diagnostics.py, so the name stays the same.

The new snapshot is quirk_applied: true with zhaquirks.sonoff.trvzb:(SONOFF / TRV-ZBT), the merged quirk, and now reads temperature_control_mode (0x6013) instead of the custom quirk's 0x6017. That resolves the earlier concern about the Adaptive mode state.

Full suite on the new head: 1785 passed. CI is running on 9af9637.

@TheJulianJES

Copy link
Copy Markdown
Contributor Author

@zigpy-review-bot Also check recently merged quirks issues and PRs for other diagnostics and add them here (unless they're clearly modified/fake or generated with some old/custom quirk version). Possibly also check lots of other issues and PRs for diagnostics that could be added, but perhaps first start with what was recently merged (and those related issues/PRs).

Adds 12 device diagnostics found in recently merged zha-device-handlers PRs and their linked issues, all with the merged quirk applied:

- Aqara FP1 `lumi.motion.ac01` (zigpy/zha-device-handlers#5440)
- Aqara pet feeder `aqara.feeder.acn001` (zigpy/zha-device-handlers#5296)
- Candeo C-ZB-RD1Pv2 DPM and REM (zigpy/zha-device-handlers#5268)
- CentraLite 3300 without endpoint 2 (zigpy/zha-device-handlers#5507)
- ELECRAM Ramses_esp32c6 (zigpy/zha-device-handlers#4782)
- Tuya `_TYST11_qq9mpfhw` water leak sensor (zigpy/zha-device-handlers#5524)
- Tuya TS0043 `_TZ3000_famkxci2` (zigpy/zha-device-handlers#5475)
- Tuya TS1201 `_TZ3290_gnl5a6a5xvql7c2a` (zigpy/zha-device-handlers#5516)
- Tuya TS0601 `_TZE284_9m4kmbfu` (zigpy/zha-device-handlers#5469)
- Tuya TS0601 `_TZE284_aaeaifez` (zigpy/zha-device-handlers#5411)
- Tuya TS0601 `_TZE284_loejka0i` (zigpy/zha-device-handlers#5526)
@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Added 12 diagnostics in f6abc1d (plain commit on top, no force push). I went through the quirks PRs merged since 2026-09-15 and their linked issues, collected every attached diagnostics JSON, and ran them all through tools/import_diagnostics.py. All 12 are new on dev, and all have the merged quirk applied (quirk_applied: true):

Full suite on the new head: 1797 passed (1785 before plus the 12 new snapshots).

Things to look at:

  • The ELECRAM Ramses_esp32c6 is a DIY ESP32 device. Its quirk is merged and it isn't a copied model string, so I kept it, but drop it if you'd rather not carry DIY firmware.
  • The Aqara feeder reports an empty manufacturer, so its file is named none-aqara-feeder-acn001-….
  • I didn't check the dumps' own provenance beyond the importer's checks (original signature present, quirk re-applies after a rejoin), so a hand-edited dump that still passes those would get through.

Not done: the "lots of other issues and PRs" part. I only covered recently merged PRs and their linked issues, not older merged PRs, open PRs, or unrelated issues. Re-mention me to take that on, and say how far back or which labels or devices to look at.

@TheJulianJES
TheJulianJES marked this pull request as ready for review October 29, 2026 00:53
Copilot AI balanced review requested due to automatic review settings October 29, 2026 00:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The fixtures depend on zha-quirks 2.1.0, and quirk matching and diagnostics round-trip behavior could not be verified against that release.

No open issues 🎉

What changed in this PR

Adds 14 device diagnostic fixtures to ZHA’s test data, expanding coverage of devices supported by quirks. This PR changes test data only; regeneration is planned with zha-quirks 2.1.0.

Changes:

  • Imports device signatures, cluster attributes, and firmware metadata.
  • Records entity configurations and states for thermostats, sensors, remotes, a feeder, and other devices.
File Description
tests/​data/​devices/​tze284-loejka0i-ts0601-0x0000004a.json Adds electrical measurement and energy sensor diagnostics.
tests/​data/​devices/​tze284-aaeaifez-ts0601-0x0000004e.json Adds thermostat diagnostics with configuration controls.
tests/​data/​devices/​tze284-9m4kmbfu-ts0601-0x00000050.json Adds battery-powered thermostat and valve-position diagnostics.
tests/​data/​devices/​tze200-znzs7yaw-ts0601-0x00000048.json Adds Haozee thermostat diagnostics and temperature settings.
tests/​data/​devices/​tz3290-gnl5a6a5xvql7c2a-ts1201-0x00000043.json Adds Zosung infrared blaster diagnostics.
tests/​data/​devices/​tz3000-famkxci2-ts0043-0x00000048.json Adds three-button remote and battery diagnostics.
tests/​data/​devices/​tyst11-qq9mpfhw-q9mpfhw-0x00000049.json Adds moisture sensor and power-type diagnostics.
tests/​data/​devices/​none-aqara-feeder-acn001-0x00002621.json Adds Aqara feeder controls and dispensing statistics.
tests/​data/​devices/​heiman-hm-636thv-ac-m-0x01000000.json Adds smoke, carbon monoxide, and environmental diagnostics.
tests/​data/​devices/​elecram-ramses-esp32c6-0x00050100.json Adds ELECRAM device signature and firmware diagnostics.
tests/​data/​devices/​ctm-lyng-ax-water-sensor-0x00000019.json Adds water-leak sensor and battery diagnostics.
tests/​data/​devices/​centralite-3300-0x10015100.json Adds contact, temperature, and battery sensor diagnostics.
tests/​data/​devices/​candeo-c-zb-rd1pv2-rem-0x00000016.json Adds rotary dimmer remote and electrical metering diagnostics.
tests/​data/​devices/​aqara-lumi-motion-ac01-0x00000036.json Adds presence sensor diagnostics and detection settings.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Improvement to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants