zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
750 stars 686 forks source link

[Device Support Request] New variant Tuya '_Tz3000_okaz9tjs' TS011F Smart Plug found #3268

Open lktechnl opened 3 months ago

lktechnl commented 3 months ago

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=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4660, maximum_buffer_size=108, maximum_incoming_transfer_size=0, server_mask=11264, maximum_outgoing_transfer_size=0, descriptor_capability_field=, *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 ```json [Paste the diagnostic information here] ```

Logs

Logs ```python [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

LeMyst commented 1 month ago

Duplicate of https://github.com/zigpy/zha-device-handlers/issues/3001 ?