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] New variant Tuya '_Tz3000_okaz9tjs' TS011F Smart Plug found #3268

Open
lktechnl opened this issue Jul 22, 2024 · 1 comment
Labels
Tuya Request/PR regarding a Tuya device

Comments

@lktechnl
Copy link

Problem description

Smartplug _TZ3000_okaz9tjs was not detected correctly and showed light bulb switch button instead of smart plug switch button.
Current was x1000 as large.

Solution description

I've added an additional class for proper detection

Screenshots/Video

Screenshots/Video

[Paste/upload your media here]

Device signature

Device signature
"ieee": "**REDACTED**",
"nwk": 37520,
"manufacturer": "_TZ3000_okaz9tjs",
"model": "TS011F",
"name": "_TZ3000_okaz9tjs TS011F",
"quirk_applied": false,
"quirk_class": "zigpy.device.Device",
"quirk_id": null,
"manufacturer_code": 4660,
"power_source": "Mains",
"lqi": 88,
"rssi": -78,
"last_seen": "2024-07-23T00:21:52",
"available": true,
"device_type": "Router",
"signature": {
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4660, maximum_buffer_size=108, maximum_incoming_transfer_size=0, server_mask=11264, maximum_outgoing_transfer_size=0, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x000a",
        "0x0702",
        "0x0b04",
        "0x1000",
        "0xe000",
        "0xe001"
      ],
      "output_clusters": []
    }
  },
  "manufacturer": "_TZ3000_okaz9tjs",
  "model": "TS011F"
},

Diagnostic information

Diagnostic information
[Paste the diagnostic information here]

Logs

Logs
[Paste the logs here]

Custom quirk

new class for ts011f_plug.py

class Plug_v4(EnchantedDevice):
"""Tuya TS011F plug. One plug is _Tz3000_okaz9tjs + DeviceType.ON_OFF_LIGHT"""

quirk_id = TUYA_PLUG_ONOFF

signature = {
    MODEL: "TS011F",
    ENDPOINTS: {
    # "profile_id": 260,
    # "device_type": "0x0100",
    # "input_clusters": ["0x0000","0x0003","0x0004","0x0005","0x0006","0x000a","0x0702","0x0b04","0x1000","0xe000","0xe001"],
    # "output_clusters": []
        1: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
            INPUT_CLUSTERS: [
                Basic.cluster_id,
                Identify.cluster_id,
                Groups.cluster_id,
                Scenes.cluster_id,
                OnOff.cluster_id,
                Time.cluster_id,
                Metering.cluster_id,
                ElectricalMeasurement.cluster_id,
                LightLink.cluster_id,
                TuyaZBE000Cluster.cluster_id,
                TuyaZBExternalSwitchTypeCluster.cluster_id,
            ],
            OUTPUT_CLUSTERS: [],
        },
    },
}

replacement = {
    ENDPOINTS: {
        1: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
            INPUT_CLUSTERS: [
                Basic.cluster_id,
                Identify.cluster_id,
                Groups.cluster_id,
                Scenes.cluster_id,
                TuyaZBOnOffAttributeCluster,
                Time.cluster_id,
                TuyaZBMeteringClusterWithUnit,
                TuyaZBElectricalMeasurement,
                LightLink.cluster_id,
                TuyaZBE000Cluster,
                TuyaZBExternalSwitchTypeCluster,
            ],
            OUTPUT_CLUSTERS: [],
        },
    },
}

Additional information

No response

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Aug 10, 2024
@LeMyst
Copy link

LeMyst commented Sep 5, 2024

Duplicate of #3001 ?

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
Projects
None yet
Development

No branches or pull requests

3 participants