Skip to content
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

Add tuya smoke detector (TZE204_vawy74yh) #3447

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

pulsar895
Copy link

Proposed change

Get the smoke status of the MOES ZSS-HM-SSD01 smoke detector.

Additional information

I don't know if other elements, such as battery status, could be recovered. This device seems fully compatible with z2M.

Tests

The change permits to get smoke status into Home assistant :

  • Home assistant: 2024.10.3
  • Zigbee dongle: SkyConnect v1.0

Capture d’écran du 2024-10-20 16-09-24
Capture d’écran du 2024-10-20 16-08-20

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.44%. Comparing base (728ee42) to head (804024a).
Report is 16 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3447   +/-   ##
=======================================
  Coverage   89.44%   89.44%           
=======================================
  Files         311      311           
  Lines       10033    10033           
=======================================
  Hits         8974     8974           
  Misses       1059     1059           

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


🚨 Try these New Features:

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Oct 21, 2024
@Keffu3636
Copy link

Any news?

@TheJulianJES TheJulianJES added the v2 quirk candidate This PR is a good fit to be converted to a v2 quirk. label Nov 24, 2024
@prairiesnpr
Copy link
Contributor

I don't have one of these, but quickly looking at the existing quirk, something like this might be a good starting point.

from zhaquirks.tuya import TuyaLocalCluster
from zigpy.zcl.clusters.security import IasZone


class TuyaIAS(IasZone, TuyaLocalCluster):
    """Tuya local IAS cluster."""

    _CONSTANT_ATTRIBUTES = {
        IasZone.AttributeDefs.zone_type.id: IasZone.ZoneType.Fire_Sensor
    }


(
    TuyaQuirkBuilder("_TZE200_aycxwiau", "TS0601")
    .applies_to("_TZE200_dq1mfjug", "TS0601")
    .applies_to("_TZE200_m9skfctm", "TS0601")
    .applies_to("_TZE200_ntcy3xu1", "TS0601")
    .applies_to("_TZE200_rccxox8p", "TS0601")
    .applies_to("_TZE200_vzekyi4c", "TS0601")
    .applies_to("_TZE204_ntcy3xu1", "TS0601")
    .applies_to("_TZE204_vawy74yh", "TS0601")
    .tuya_dp(
        dp_id=1,
        ep_attribute=TuyaIAS.ep_attribute,
        attribute_name=IasZone.AttributeDefs.zone_state.name,
        converter=lambda x: IasZone.ZoneStatus.Alarm_1 if x == 0 else 0,
    )
    .adds(TuyaIAS)
    .skip_configuration()
    .add_to_registry()
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tuya Request/PR regarding a Tuya device v2 quirk candidate This PR is a good fit to be converted to a v2 quirk.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants