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

[Device Support Request] - Please add support for TS0601_TZE284_ymldrmzx TRV #3797

Closed
tomblu88 opened this issue Jan 28, 2025 · 7 comments · Fixed by #3819
Closed

[Device Support Request] - Please add support for TS0601_TZE284_ymldrmzx TRV #3797

tomblu88 opened this issue Jan 28, 2025 · 7 comments · Fixed by #3819
Labels
device support request This requests support for a new device

Comments

@tomblu88
Copy link

Problem description

Here is the signature for it:

{
"node_descriptor": {
"logical_type": 2,
"complex_descriptor_available": 0,
"user_descriptor_available": 0,
"reserved": 0,
"aps_flags": 0,
"frequency_band": 8,
"mac_capability_flags": 128,
"manufacturer_code": 4417,
"maximum_buffer_size": 66,
"maximum_incoming_transfer_size": 66,
"server_mask": 10752,
"maximum_outgoing_transfer_size": 66,
"descriptor_capability_field": 0
},
"endpoints": {
"1": {
"profile_id": "0x0104",
"device_type": "0x0051",
"input_clusters": [
"0x0000",
"0x0004",
"0x0005",
"0xed00",
"0xef00"
],
"output_clusters": [
"0x000a",
"0x0019"
]
}
},
"manufacturer": "_TZE284_ymldrmzx",
"model": "TS0601",
"class": "zigpy.device.Device"
}

Please let me know if there's other information required.
I'm happy to test this.

https://www.aliexpress.com/item/1005008070589035.html?spm=a2g0o.order_list.order_list_main.4.77e018029l2O7l

Solution description

Please add support for this device either natively or in a quirck.
Thanks!

Screenshots/Video

Screenshots/Video

[Paste/upload your media here]

Device signature

Device signature
[Paste the device signature here]

Diagnostic information

Diagnostic information
[Paste the diagnostic information here]

Logs

Logs
[Paste the logs here]

Custom quirk

Custom quirk
[Paste your custom quirk here]

Additional information

No response

@tomblu88 tomblu88 added the device support request This requests support for a new device label Jan 28, 2025
@tomblu88
Copy link
Author

Thank you @prairiesnpr!
Is there a guide for how to add this to my Home Assistant instance?
Is this done or is there more dev required?

Thanks!

@prairiesnpr
Copy link
Collaborator

Sorry, in a hurry and wanted to capture the datapoints. That's for z2m, we can use it as a guide to build the ZHA support. If you want to get started, look at the Tuya docs and wiki in this repo and the existing trv quirks in tuya_trv.py. That would give you a baseline on how to build a quirk.

@tomblu88
Copy link
Author

Honestly, I don't know where to begin. Any help would be appriciated!
I'm happy to test the quirk on my instance and share with the community.
Thanks again!

@tomblu88
Copy link
Author

tomblu88 commented Jan 29, 2025

This is about as far as I got with the help of Copilot and ChatGPT, but it doesn't work and I don't know why.

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PowerConfiguration
from zigpy.zcl.clusters.hvac import Thermostat

from zhaquirks import PowerConfigurationCluster
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import (
    TuyaManufCluster,
    TuyaThermostatCluster,
    TuyaPowerConfigurationCluster2AAA,
)

class TuyaTRV(CustomDevice):
    """Tuya TRV Quirk for _TZE284_ymldrmzx TS0601."""

    signature = {
        MODELS_INFO: [("_TZE284_ymldrmzx", "TS0601")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: 0x0104,
                DEVICE_TYPE: 0x0051,  # Thermostat Device Type
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    PowerConfiguration.cluster_id,  # Battery reporting
                    Thermostat.cluster_id,
                    0xEF00,  # Tuya Manufacturer-Specific Cluster
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                ],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: 0x0104,
                DEVICE_TYPE: 0x0051,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    TuyaPowerConfigurationCluster2AAA,  # Improved battery handling
                    TuyaThermostatCluster,  # Handles heating modes & temperature
                    TuyaManufCluster,  # Handles Tuya datapoints (DPS)
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                ],
            },
        },
    }

@prairiesnpr
Copy link
Collaborator

That's taking you in a bad direction. You want to do this with TuyaQuirkBuilder. Start with an example from tuya_trv.py and slowly add Datapoints.

@prairiesnpr
Copy link
Collaborator

@tomblu88 See if #3819 works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device support request This requests support for a new device
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants