Skip to content

Conversation

@fradaloisio
Copy link

Proposed change

Add support for Wenzhi MTD085-ZB mmWave presence sensor

Additional information

  • Device operates in basic IAS Zone mode since no Tuya MCU cluster is available, illuminance/distance/config are not supported
  • Implements magic packet to initialize proper occupancy reporting
  • Supports motion detection and occupancy state tracking
  • Organized under zhaquirks/wenzhi/ (manufacturer-specific folder)

Device diagnostics

zha-01JTN6TKHETE3X3V7072D2MTHG-_TZ321C_fkzihax8 TS0225-77baa6535adcf8c971d7cb5e66cb8829_git.json

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black (ruff-format maybe?)
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

- Device operates in basic IAS Zone mode
- Implements magic packet to initialize proper occupancy reporting
- Supports motion detection and occupancy state tracking
- Organized under zhaquirks/wenzhi/ (manufacturer-specific folder)
- Includes comprehensive test suite for both manufacturer variants
- Note: No Tuya MCU cluster available, illuminance/distance/config not supported
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.24%. Comparing base (6ab11ea) to head (3124c6d).
⚠️ Report is 24 commits behind head on dev.

Files with missing lines Patch % Lines
zhaquirks/wenzhi/mtd085_motion.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4424      +/-   ##
==========================================
+ Coverage   92.12%   92.24%   +0.11%     
==========================================
  Files         358      370      +12     
  Lines       11917    12103     +186     
==========================================
+ Hits        10979    11164     +185     
- Misses        938      939       +1     

☔ View full report in Codecov by Sentry.
📢 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.

Comment on lines 42 to 46
basic_cluster = self.endpoints[1].in_clusters[Basic.cluster_id]
await basic_cluster.read_attributes(
[0, 1, 4, 5, 7, 0xFFFE],
allow_cache=False,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have tuya_enchantment doing this for v2 quirks using TuyaQuirkBuilder (and EnchantedDevice for v1 quirks).
Please look at existing mm-wave sensors using TuyaQuirkBuilder or existing quirks for using tuya_enchantment: https://github.com/search?q=repo%3Azigpy%2Fzha-device-handlers%20tuya_enchantment&type=code

@TheJulianJES TheJulianJES added the needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). label Oct 28, 2025
@fradaloisio
Copy link
Author

fradaloisio commented Nov 3, 2025

Hello @TheJulianJES, thanks for the review.
I did the implementation by using the EnchantedDevice and tested it.
Is working as expected.

But do you think that having cross dependency between quirks is ok? (still new to quirks :) )

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

Labels

needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants