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
733 stars 673 forks source link

[Device Support Request] TS0013 - Optional Neutral wire Installed (allowing to act as router rather than current endpoint) #1879

Closed yftj closed 1 year ago

yftj commented 1 year ago

Is your feature request related to a problem? Please describe. I have connected the neutral wires to these switches to hopefully allow for them to act as a router, however the current quirk they are running are the "zhaquirks.tuya.ts001x.TuyaTripleNoNeutralSwitch" variant.

Describe the solution you'd like Change the noNeutralSwitch quirk to a Neutralswitch to allow it to act as a router rather than an end device, I have 6 of these types of switches and would love if they can act as routers to improve the Zigbee connection around the house.

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=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006" ], "out_clusters": [ "0x0019" ] }, "2": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0004", "0x0005", "0x0006" ], "out_clusters": [] }, "3": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0004", "0x0005", "0x0006" ], "out_clusters": [] } }, "manufacturer": "_TYZB01_4lwqwyqn", "model": "TS0013", "class": "zhaquirks.tuya.ts001x.TuyaTripleNoNeutralSwitch" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.10.5", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.5", "docker": true, "arch": "x86_64", "timezone": "Australia/Sydney", "os_name": "Linux", "os_version": "5.15.74", "supervisor": "2022.10.0", "host_os": "Home Assistant OS 9.3", "docker_version": "20.10.18", "chassis": "vm", "run_as_root": true }, "custom_components": { "meross_lan": { "version": "2.6.2", "requirements": [] }, "hacs": { "version": "1.28.3", "requirements": [ "aiogithubapi>=22.2.4" ] }, "localtuya": { "version": "3.2.1", "requirements": [] }, "samsungtv_smart": { "version": "0.8.0", "requirements": [ "websocket-client!=1.4.0,>=0.58.0", "wakeonlan>=2.0.0", "aiofiles>=0.8.0" ] }, "xiaomi_miot_raw": { "version": "v1.3.1", "requirements": [ "construct", "python-miio>=0.5.3" ] }, "reolink_dev": { "version": "0.57", "requirements": [ "reolink==0.0.62" ] }, "webrtc": { "version": "v2.3.0", "requirements": [] }, "neosmartblinds": { "version": "2.2", "requirements": [ "requests==2.28.1" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.2", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.83", "zigpy-deconz==0.19.0", "zigpy==0.51.3", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.2", "zigpy-znp==0.9.1" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "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", "@puddly" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" } ], "dependencies": [ "file_upload" ], "after_dependencies": [ "onboarding", "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": 40826, "manufacturer": "_TYZB01_4lwqwyqn", "model": "TS0013", "name": "_TYZB01_4lwqwyqn TS0013", "quirk_applied": true, "quirk_class": "zhaquirks.tuya.ts001x.TuyaTripleNoNeutralSwitch", "manufacturer_code": 4098, "power_source": "Battery or Unknown", "lqi": 168, "rssi": -58, "last_seen": "2022-11-01T12:49:19", "available": true, "device_type": "EndDevice", "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=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006" ], "out_clusters": [ "0x0019" ] }, "2": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0004", "0x0005", "0x0006" ], "out_clusters": [] }, "3": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0004", "0x0005", "0x0006" ], "out_clusters": [] } } }, "active_coordinator": false, "entities": [ { "entity_id": "switch.living_room_switches_switch", "name": "_TYZB01_4lwqwyqn TS0013" }, { "entity_id": "switch.living_room_switches_switch_2", "name": "_TYZB01_4lwqwyqn TS0013" }, { "entity_id": "switch.living_room_switches_switch_3", "name": "_TYZB01_4lwqwyqn TS0013" } ], "neighbors": [], "endpoint_names": [ { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" } ], "user_given_name": "living room switches", "device_reg_id": "d07881c85ba97bd77be46c5dd3088d20", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0004": { "attribute_name": "manufacturer", "value": "_TYZB01_4lwqwyqn" }, "0x0005": { "attribute_name": "model", "value": "TS0013" } }, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 0 }, "0x4001": { "attribute_name": "on_time", "value": 0 }, "0x4002": { "attribute_name": "off_wait_time", "value": 0 } }, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } }, "2": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 0 }, "0x4001": { "attribute_name": "on_time", "value": 0 }, "0x4002": { "attribute_name": "off_wait_time", "value": 0 } }, "unsupported_attributes": {} } }, "out_clusters": {} }, "3": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 0 }, "0x4001": { "attribute_name": "on_time", "value": 0 }, "0x4002": { "attribute_name": "off_wait_time", "value": 0 } }, "unsupported_attributes": {} } }, "out_clusters": {} } } } } ```

Additional context There are many types of these switches in which I have all variations bought from here: https://www.ozsmartthings.com.au/collections/zigbee/products/zigbee-quad-light-switch-all-white https://www.ozsmartthings.com.au/collections/zigbee/products/zigbee-triple-light-switch-all-white https://www.ozsmartthings.com.au/collections/zigbee/products/zigbee-double-light-switch-all-white https://www.ozsmartthings.com.au/collections/zigbee/products/zigbee-single-light-switch-all-white

MattWestb commented 1 year ago

@yftj The device type as router or end device is locked in the firmware (most devices is using different Zigbee stacks for the types) and cant being changed from the host system side. Only way is "finding" one working router firmware that for the hardware and flashing the device with debug adapter. But i think you cant find any that is working OK then also the light switch hardware must being the same or you is braking the device. Ask the seller if the factory can making one but i think its not getting any positive response from them.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.