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
743 stars 679 forks source link

[Device Support Request] TS011F _TZ3000_cfnprab5 (XENON 4AC+2USB power strip) #1632

Closed tim-geier closed 2 years ago

tim-geier commented 2 years ago

Is your feature request related to a problem? Please describe. I have bought this power strip from amazon, it should be working with zha (according to https://zigbee.blakadder.com/Xenon_SM-SO306.html but the sockets cannot be controlled. The device can be added to Home Assistant and the setup wizard shows that everything went fine and that the device can be used. The five switches get recognized but the device does not respond at all. The "Last seen" timestamp in Home Assistant also never changes from the time I pair the device. The only difference I could spot is my model has an additional "-EZ". The supported device is model SM-SO306, I received the model SM-SO306-EZ, but I dont know whats the difference (if there is one) and how to get it working. I think it needs to use something like the quirk for "ts011f.Plug_4AC_2USB", since thats basically the device I have, but something does not match. My device looks exactly like the one pictured in #1106.

Describe the solution you'd like Would be nice if my power strip could be controlled like intended or somebody could tell me what I'm doing wrong.

Device signature ```yaml { "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=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": 260, "device_type": "0x010a", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0xe000", "0xe001" ], "out_clusters": [ "0x000a", "0x0019" ] }, "2": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "3": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "4": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "5": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } }, "manufacturer": "_TZ3000_cfnprab5", "model": "TS011F", "class": "zigpy.device.Device" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.6.7", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.9.12", "docker": true, "arch": "x86_64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "5.15.45", "supervisor": "2022.05.3", "host_os": "Home Assistant OS 8.2", "docker_version": "20.10.14", "chassis": "vm", "run_as_root": true }, "custom_components": { "alexa_media": { "version": "4.0.2", "requirements": [ "alexapy==1.26.0", "packaging>=20.3", "wrapt>=1.12.1" ] }, "hacs": { "version": "1.25.5", "requirements": [ "aiogithubapi>=22.2.4" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.30.0", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.75", "zigpy-deconz==0.16.0", "zigpy==0.45.1", "zigpy-xbee==0.14.0", "zigpy-zigate==0.7.4", "zigpy-znp==0.7.0" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "10C4", "pid": "EA60", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus" ] }, { "vid": "10C4", "pid": "EA60", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*zigstar*", "known_devices": [ "ZigStar Coordinators" ] }, { "vid": "1CF1", "pid": "0030", "description": "*conbee*", "known_devices": [ "Conbee II" ] }, { "vid": "10C4", "pid": "8A2A", "description": "*zigbee*", "known_devices": [ "Nortek HUSBZB-1" ] }, { "vid": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" } ], "after_dependencies": [ "usb", "zeroconf" ], "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 17530, "manufacturer": "_TZ3000_cfnprab5", "model": "TS011F", "name": "_TZ3000_cfnprab5 TS011F", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4417, "power_source": "Mains", "lqi": 248, "rssi": -87, "last_seen": "2022-06-24T19:53:44", "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=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": 260, "device_type": "0x010a", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0xe000", "0xe001" ], "out_clusters": [ "0x000a", "0x0019" ] }, "2": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "3": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "4": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "5": { "profile_id": 260, "device_type": "0x010a", "in_clusters": [ "0x0004", "0x0005", "0x0006", "0xe001" ], "out_clusters": [] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } } }, "entities": [ { "entity_id": "switch.tz3000_cfnprab5_ts011f_d7414436_on_off", "name": "_TZ3000_cfnprab5 TS011F" }, { "entity_id": "switch.tz3000_cfnprab5_ts011f_d7414436_on_off_2", "name": "_TZ3000_cfnprab5 TS011F" }, { "entity_id": "switch.tz3000_cfnprab5_ts011f_d7414436_on_off_3", "name": "_TZ3000_cfnprab5 TS011F" }, { "entity_id": "switch.tz3000_cfnprab5_ts011f_d7414436_on_off_4", "name": "_TZ3000_cfnprab5 TS011F" }, { "entity_id": "switch.tz3000_cfnprab5_ts011f_d7414436_on_off_5", "name": "_TZ3000_cfnprab5 TS011F" }, { "entity_id": "button.tz3000_cfnprab5_ts011f_d7414436_identify", "name": "_TZ3000_cfnprab5 TS011F" } ], "neighbors": [], "endpoint_names": [ { "name": "ON_OFF_PLUG_IN_UNIT" }, { "name": "ON_OFF_PLUG_IN_UNIT" }, { "name": "ON_OFF_PLUG_IN_UNIT" }, { "name": "ON_OFF_PLUG_IN_UNIT" }, { "name": "ON_OFF_PLUG_IN_UNIT" }, { "name": "unknown 97 device_type of 0xa1e0 profile id" } ], "user_given_name": null, "device_reg_id": "a5810d76391e9ba0b41d40a56ed441cd", "area_id": null } } ```
Additional logs (pairing) See attached file, body was too long if pasted in here... [Pairing_log.txt](https://github.com/zigpy/zha-device-handlers/files/8979850/Pairing_log.txt)
botswanabub commented 1 year ago

what quirk is associated with it? I copied the original fix (which basically removes identity.cluster_id and TuyaZBE000Cluster.cluster_id from endpoints 2,3,4,5) in a class called Plug_4AC_2USB_cfnprab5. Now, even though this quirk has been reinstalled by a monthly update it's still work (I assume it's cached and would break if I tried to pair again).

hi, can u show your config in the ts*** file ... I tried it too without success.

botswanabub commented 1 year ago

finally worked, not sure why, I think because of deleting pycache in the tuya folder. have to checkup and come back.

TS011F_TZ3000_cfnprab5_homeassistant

MaxMSchneider commented 1 year ago

Hey all,

I recently purchased this power strip to replace my other one running on localtuya. Problem is, I can't get it to pair even.

While pairing in ZHA it is discovered, but can not finish the interview as it seems. Tried pairing via only the coordinator as well as the closest router(s). The strange behavior is that it seems to leave the network, constantly swapping to another one.

I did pull the quirk out of the directory and placed it accordingly. Anything I need to do with it before it works? It's my first time using quirks and zha. Recently swapped over from Z2M when I got the skyconnect.

Anyone had this issue, too?

javicalle commented 1 year ago

Please open a new issue with all the required info. Attach also the logs from the pairing process.

ingoratsdorf commented 1 year ago

While this is closed, it's the best place for another version of TS011F by _TZ3000_cfnprab5

My version has 4AC plug points and 4 USB ports and no power restore etc. Really only 5 switches and nothing else. The quirk for that one works for me:

"""TS011F multiboard with 4 outlet + 4 USB without any metering or restore"""

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
    Basic,
    Groups,
    Identify,
    OnOff,
    Scenes,
)
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODEL,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import (
    TuyaZBExternalSwitchTypeCluster,
    TuyaZBOnOffAttributeCluster,
)

class Plug_4AC_2USB_TZ3000_cfnprab5(CustomDevice):
    """Tuya 4 outlet + 4 USB without any metering or restore"""

    signature = {
        MODEL: "TS011F",
        ENDPOINTS: {
            1: {
                # <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
                # input_clusters=[0, 3, 4, 5, 6, 0xe001]
                # output_clusters=[]>
                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,
                    TuyaZBExternalSwitchTypeCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
            2: {
                # <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
                # input_clusters=[0, 3, 4, 5, 6, 0xe001]
                # output_clusters=[]>
                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,
                    TuyaZBExternalSwitchTypeCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
            3: {
                # <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
                # input_clusters=[0, 3, 4, 5, 6, 0xe001]
                # output_clusters=[]>
                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,
                    TuyaZBExternalSwitchTypeCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
            4: {
                # <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
                # input_clusters=[0, 3, 4, 5, 6, 0xe001]
                # output_clusters=[]>
                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,
                    TuyaZBExternalSwitchTypeCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
            5: {
                # <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
                # input_clusters=[0, 3, 4, 5, 6, 0xe001]
                # output_clusters=[]>
                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,
                    TuyaZBExternalSwitchTypeCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
        },
    }
    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaZBOnOffAttributeCluster,
                    TuyaZBExternalSwitchTypeCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            2: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaZBOnOffAttributeCluster,
                    TuyaZBExternalSwitchTypeCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            3: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaZBOnOffAttributeCluster,
                    TuyaZBExternalSwitchTypeCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            4: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaZBOnOffAttributeCluster,
                    TuyaZBExternalSwitchTypeCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            5: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaZBOnOffAttributeCluster,
                    TuyaZBExternalSwitchTypeCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
        },
    }
gitolicious commented 11 months ago

...aaaaaand here comes another one. 4 AC channels, Dual-USB and power state restore. Bought in 11/2023 from amazon.de with "SM-SO306-EZ" model number.

Plug_4AC_2USB_Var06 ```python class Plug_4AC_2USB_Var06(EnchantedDevice): """Tuya 4 outlet + 2 USB surge protector with restore power state support (variation 06).""" signature = { MODEL: "TS011F", ENDPOINTS: { # 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, TuyaZBE000Cluster.cluster_id, ], OUTPUT_CLUSTERS: [Time.cluster_id], }, 2: { # input_clusters=["0x0000","0x0003","0x0004","0x0005","0x0006","0xe000"] # output_clusters=[] 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, TuyaZBE000Cluster.cluster_id, ], OUTPUT_CLUSTERS: [], }, 3: { # input_clusters=["0x0000","0x0003","0x0004","0x0005","0x0006","0xe000"] # output_clusters=[] 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, TuyaZBE000Cluster.cluster_id, ], OUTPUT_CLUSTERS: [], }, 4: { # input_clusters=["0x0000","0x0003","0x0004","0x0005","0x0006","0xe000"] # output_clusters=[] 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, TuyaZBE000Cluster.cluster_id, ], OUTPUT_CLUSTERS: [], }, 5: { # input_clusters=["0x0000","0x0003","0x0004","0x0005","0x0006","0xe000"] # output_clusters=[] 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, TuyaZBE000Cluster.cluster_id, ], OUTPUT_CLUSTERS: [], }, }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaZBOnOffAttributeCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id], }, 2: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaZBOnOffAttributeCluster, ], OUTPUT_CLUSTERS: [], }, 3: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaZBOnOffAttributeCluster, ], OUTPUT_CLUSTERS: [], }, 4: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaZBOnOffAttributeCluster, ], OUTPUT_CLUSTERS: [], }, 5: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaZBOnOffAttributeCluster, ], OUTPUT_CLUSTERS: [], }, }, } ```

Child Lock and Backlight Mode are missing and it is not clear to me, how to add it back. They are visible and functional in HA at the "Manage Zigbee device" menu > "Clusters" > "TuyaZBOnOffAttributeCluster (Endpoint id: 1, Id: 0x0006, Type: in)" > Attributes > "backlight_mode (id: 0x8001)".