Add quirk for HOBEIAN ZG-102ZM vibration and door sensor#4872
Open
Add quirk for HOBEIAN ZG-102ZM vibration and door sensor#4872
Conversation
The ZG-102ZM reports as a standard IAS Zone device but uses Tuya datapoints for vibration, contact, battery, and sensitivity. Without this quirk, only a single binary sensor is created via IAS Zone, missing the vibration functionality entirely. This quirk uses TuyaQuirkBuilder to expose: - Vibration binary sensor (DP 1) - Contact/opening binary sensor (DP 101) - Battery sensor (DP 4, 1x CR2032) - Sensitivity number (DP 6, range 1-50) The default IAS Zone entity is disabled since the Tuya DPs provide complete and separated sensor data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4872 +/- ##
=======================================
Coverage 93.04% 93.05%
=======================================
Files 397 399 +2
Lines 13248 13256 +8
=======================================
+ Hits 12327 12335 +8
Misses 921 921 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The device requires the Tuya "spell" (attribute reads on Basic cluster) during configuration to start sending datapoints. Without it, the device joins but never reports vibration, contact, or battery data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Add a ZHA quirk for the HOBEIAN ZG-102ZM door and vibration sensor.
This device reports as a standard IAS Zone device (zone_type 0x0015, Vibration/Movement) but uses Tuya datapoints on cluster 0xEF00 for its actual sensor data. Without this quirk, ZHA only creates a single IAS Zone binary sensor for contact — vibration is completely missing.
The quirk uses
TuyaQuirkBuilderto expose:The default IAS Zone entity is disabled by default since the Tuya DPs provide complete and separated sensor data.
Reference: Z2M converter (uses same Tuya DPs), Community thread
Additional information
Device diagnostics
diagnostics.json
Checklist
pre-commitchecks pass / the code has been formatted using Black