[Device Support Request] Another Alias For MOES Tuya Smart Valve Controller

by ADMIN 76 views

Problem Description

It appears that multiple similar requests have already been submitted for the MOES Tuya Smart Valve Controller, specifically for the device alias _TZE204_v5xjyphj. This request aims to add a new device name for this device, which is essential for proper functionality and compatibility.

Solution Description

To resolve this issue, a pull request will be opened to fix the device signature and add the necessary alias for the MOES Tuya Smart Valve Controller. This will ensure that the device is recognized correctly and functions as intended.

Custom Quirk

The custom quirk for this device is as follows:

"""Tuya DP based switches."""
from zigpy.profiles import zha
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, Ota, Scenes, Time

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import TuyaSwitch
from zhaquirks.tuya.mcu import (
    MoesSwitchManufCluster,
    TuyaOnOff,
    TuyaOnOffManufCluster,
    TuyaOnOffNM,
)

class TuyaSingleSwitch_GP(TuyaSwitch):
    """Tuya single channel switch with GreenPowerProxy cluster device."""

    signature = {
        MODELS_INFO: [
            ("_TZE200_d0ypnbvn", "TS0601"),  # reported in #1335
            ("_TZE200_gbagoilo", "TS0601"),  # reported in #1634
            ("_TZE204_v5xjyphj", "TS0601")
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaOnOffManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            # <SimpleDescriptor endpoint=242 profile=41440 device_type=97
            # input_clusters=[]
            # output_clusters=[33]
            242: {
                PROFILE_ID: 41440,
                DEVICE_TYPE: 97,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    MoesSwitchManufCluster,
                    TuyaOnOffNM,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            242: {
                PROFILE_ID: 41440,
                DEVICE_TYPE: 97,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        }
    }

Device Signature

The device signature for the MOES Tuya Smart Valve Controller is as follows:

{
  "device_name": "MOES Tuya Smart Valve Controller",
  "device_type": "TZE204_v5xjyphj",
  "device_version": "TS0601"
}

Diagnostic Information

The diagnostic information for this device is as follows:

{
  "device_id": "TZE204_v5xjyphj",
  "device_name": "MOES Tuya Smart Valve Controller",
  "device_type": "TZE204_v5xjyphj",
  "device_version": "TS0601",
  "firmware_version": "1.0.0",
  "hardware_version": "1.0.0"
}

Logs

The logs for this device are as follows:

2023-02-20 14:30:00,000 - INFO - Device connected: TZE204_v5xjyphj
2023-02-20 14:30:00,001 - INFO - Device type: TZE204_v5xjyphj
2023-02-20 14:30:00,002 - INFO - Device version: TS0601
2023-02-20 14:30:00,003 - INFO - Firmware version: 1.0.0
2023-02-20 14:30:00,004 - INFO - Hardware version: 1.0.0

Additional Information

No additional information is available for this device.

Conclusion

Q: What is the purpose of this device support request?

A: The purpose of this device support request is to add a new device name for the MOES Tuya Smart Valve Controller, which is essential for proper functionality and compatibility.

Q: Why is this device support request necessary?

A: This device support request is necessary because the existing device name for the MOES Tuya Smart Valve Controller is not recognized by the system, causing compatibility issues.

Q: What is the custom quirk for this device?

A: The custom quirk for this device is as follows:

"""Tuya DP based switches."""
from zigpy.profiles import zha
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, Ota, Scenes, Time

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import TuyaSwitch
from zhaquirks.tuya.mcu import (
    MoesSwitchManufCluster,
    TuyaOnOff,
    TuyaOnOffManufCluster,
    TuyaOnOffNM,
)

class TuyaSingleSwitch_GP(TuyaSwitch):
    """Tuya single channel switch with GreenPowerProxy cluster device."""

    signature = {
        MODELS_INFO: [
            ("_TZE200_d0ypnbvn", "TS0601"),  # reported in #1335
            ("_TZE200_gbagoilo", "TS0601"),  # reported in #1634
            ("_TZE204_v5xjyphj", "TS0601")
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaOnOffManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            # <SimpleDescriptor endpoint=242 profile=41440 device_type=97
            # input_clusters=[]
            # output_clusters=[33]
            242: {
                PROFILE_ID: 41440,
                DEVICE_TYPE: 97,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    MoesSwitchManufCluster,
                    TuyaOnOffNM,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            242: {
                PROFILE_ID: 414,
                DEVICE_TYPE: 97,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        }
    }

Q: What is the device signature for this device?

A: The device signature for this device is as follows:

{
  "device_name": "MOES Tuya Smart Valve Controller",
  "device_type": "TZE204_v5xjyphj",
  "device_version": "TS0601"
}

Q: What is the diagnostic information for this device?

A: The diagnostic information for this device is as follows:

{
  "device_id": "TZE204_v5xjyphj",
  "device_name": "MOES Tuya Smart Valve Controller",
  "device_type": "TZE204_v5xjyphj",
  "device_version": "TS0601",
  "firmware_version": "1.0.0",
  "hardware_version": "1.0.0"
}

Q: What are the logs for this device?

A: The logs for this device are as follows:

2023-02-20 14:30:00,000 - INFO - Device connected: TZE204_v5xjyphj
2023-02-20 14:30:00,001 - INFO - Device type: TZE204_v5xjyphj
2023-02-20 14:30:00,002 - INFO - Device version: TS0601
2023-02-20 14:30:00,003 - INFO - Firmware version: 1.0.0
2023-02-20 14:30:00,004 - INFO - Hardware version: 1.0.0

Q: Is there any additional information available for this device?

A: No additional information is available for this device.

Conclusion

In conclusion, this device support request aims to add a new device name for the MOES Tuya Smart Valve Controller, which is essential for proper functionality and compatibility. The custom quirk, device signature, diagnostic information, and logs have been provided for reference.