-
Notifications
You must be signed in to change notification settings - Fork 796
Add Tuya motion sensor _TZE200_agumlajc
quirk
#4027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #4027 +/- ##
==========================================
+ Coverage 91.17% 91.20% +0.02%
==========================================
Files 334 335 +1
Lines 10858 10891 +33
==========================================
+ Hits 9900 9933 +33
Misses 958 958 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
_TZE200_agumlajc
quirk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should put this in the tuya_motion.py
file instead.
We've generally started using the tuya_
prefix for files containing Tuya v2 quirks.
Other similar motion quirks are already in that file as well.
And TS0601
is used by basically all Tuya devices unfortunately (from dimmers to thermostats, ...).
zhaquirks/tuya/ts0601_motion.py
Outdated
max_value=1000, | ||
step=1, | ||
translation_key="brightness_threshold", | ||
fallback_name="Brightness Threshold", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to HA naming conventions, please only capitalize the first word, i.e. this should be "Brightness threshold" for the fallback_name
(which will be the basis for US English translations when it's merged into HA).
Please also change the other names.
zhaquirks/tuya/ts0601_motion.py
Outdated
.tuya_binary_sensor( | ||
dp_id=104, | ||
attribute_name="motion", | ||
device_class=BinarySensorDeviceClass.MOTION, | ||
entity_type=EntityType.STANDARD, | ||
translation_key="motion", | ||
fallback_name="Motion", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not wrong, but instead of directly mapping a Tuya dp to a v2 quirk entity, we've generally mapped the dp to a (fake) ZCL attribute on the IasZone
cluster or the OccupancySensing
cluster using TuyaOccupancySensing
or TuyaMotionWithReset
in tuya_motion.py
, then mapping the dp with tuya_dp
. See the examples in that file.
We may want to follow that here as well (and/or even introduce a tuya_motion
method at some point instead).
321d8c5
to
f753c97
Compare
…move unused value_converter
Thanks @TheJulianJES! I’ve: Moved the quirk into tuya_motion.py alongside similar Tuya motion devices Replaced low-level .tuya_dp() with .tuya_binary_sensor() for motion DP (104) to align with other Tuya v2 quirks Standardized fallback names to use sentence-style capitalization |
Hi @TheJulianJES, do I need to do anything at my end or will you merge this into main branch later ? |
Proposed change
This PR adds a custom quirk for the Mercator Ikuü TS0601 Motion Sensor (_TZE200_agumlajc), which is a Tuya-based combination sensor.
The quirk enables full functionality for:
The quirk was developed using the TuyaQuirkBuilder framework, and tested successfully with ZHA in Home Assistant on firmware
0x00000042
.Additional information
This device previously paired but was non-functional under ZHA without a quirk. The implementation uses datapoint references confirmed via Zigbee2MQTT and verified manually through ZHA logs and testing.
This is a non-breaking addition and does not interfere with other Tuya TS0601-based devices.
Let me know if naming or structure adjustments are needed to align with ZHA device handler conventions.
Checklist
pre-commit
checks pass / the code has been formatted using Black