Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save therealcmj/4eca0e3a50562d935b23d56c9cf94bbf to your computer and use it in GitHub Desktop.

Select an option

Save therealcmj/4eca0e3a50562d935b23d56c9cf94bbf to your computer and use it in GitHub Desktop.

Revisions

  1. therealcmj created this gist May 19, 2025.
    71 changes: 71 additions & 0 deletions custom_zha_quirks ts0601_cover_cmj.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    """Tuya based cover and blinds."""
    from zigpy.profiles import zha
    from zigpy.zcl.clusters.general import Basic, Groups, Identify, OnOff, Ota, Scenes, Time

    from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    )
    from zhaquirks.tuya import (
    TuyaManufacturerWindowCover,
    TuyaManufCluster,
    TuyaWindowCover,
    TuyaWindowCoverControl,
    )

    class TuyaZemismartSmartCover0601_3cmj(TuyaWindowCover):
    """Tuya Zemismart blind cover motor."""

    signature = {
    # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
    # maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
    # maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
    # input_clusters=[0x0000, 0x0004, 0x0005, 0x000a, 0xef00]
    # output_clusters=[0x0019]
    # <SimpleDescriptor endpoint=1 profile=260 device_type=51 input_clusters=[0, 4, 5, 61184] output_clusters=[25]>
    MODELS_INFO: [
    ("_TZE200_yia0p3tr", "TS0601"),
    ],
    ENDPOINTS: {
    1: {
    PROFILE_ID: zha.PROFILE_ID,
    DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
    INPUT_CLUSTERS: [
    Basic.cluster_id,
    Groups.cluster_id,
    Scenes.cluster_id,
    TuyaManufCluster.cluster_id,
    ],
    OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
    },
    242: {
    'profile_id': 41440,
    'device_type': 97,
    'input_clusters': [],
    'output_clusters': [
    33
    ]
    }

    },
    }
    replacement = {
    ENDPOINTS: {
    1: {
    DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE,
    INPUT_CLUSTERS: [
    Basic.cluster_id,
    Groups.cluster_id,
    Scenes.cluster_id,
    TuyaManufacturerWindowCover,
    TuyaWindowCoverControl,
    ],
    OUTPUT_CLUSTERS: [Ota.cluster_id],
    },
    },
    }