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
736 stars 674 forks source link

[Device Support Request] Fingerbot (_TZ3210_dse8ogfy, TS0001) #2493

Open brettjurgens opened 1 year ago

brettjurgens commented 1 year ago

Problem description

I purchased this Zigbee Fingerbot from aliexpress and it has limited support in home assistant.

I've attempted to write a custom quirk based on the code from zigbee-herdsman-converters. I can read most of the values, but writing does not work.

Solution description

I'd like to be able to write the mode, down_movement, and up_movement data points.

Screenshots/Video

Screenshots/Video ![Screenshot 2023-07-27 at 19 32 41](https://github.com/zigpy/zha-device-handlers/assets/1226910/3661de92-fa58-446a-9253-4c02632c45a0) ![Screenshot 2023-07-27 at 19 33 05](https://github.com/zigpy/zha-device-handlers/assets/1226910/a959dcce-99d3-4abb-b0ab-cf5007bc7a13) ![Screenshot 2023-07-27 at 19 33 42](https://github.com/zigpy/zha-device-handlers/assets/1226910/50aad00c-3876-4308-ad68-70c4cbd545da)

Device signature

Device signature ```json { "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=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": "0x0104", "device_type": "0x0103", "input_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006", "0xef00" ], "output_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZ3210_dse8ogfy", "model": "TS0001", "class": "ts0001_switch.TuyaFingerbot" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2023.7.3", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.11.4", "docker": true, "arch": "x86_64", "timezone": "America/Los_Angeles", "os_name": "Linux", "os_version": "5.10.0-14-amd64", "run_as_root": true }, "custom_components": { "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "tryfi": { "version": "0.0.20", "requirements": [ "pytryfi>=0.0.20" ] }, "opower": { "version": "0.0.14", "requirements": [ "opower==0.0.14" ] }, "smartcar": { "version": "0.1.0", "requirements": [ "smartcar>=6.5.1" ] }, "zha_toolkit": { "version": "v0.9.5", "requirements": [ "pytz" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "after_dependencies": [ "onboarding", "usb" ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "config_flow": true, "dependencies": [ "file_upload" ], "documentation": "https://www.home-assistant.io/integrations/zha", "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "requirements": [ "bellows==0.35.8", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.101", "zigpy-deconz==0.21.0", "zigpy==0.56.2", "zigpy-xbee==0.18.1", "zigpy-zigate==0.11.0", "zigpy-znp==0.11.3" ], "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" ] } ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 44734, "manufacturer": "_TZ3210_dse8ogfy", "model": "TS0001", "name": "_TZ3210_dse8ogfy TS0001", "quirk_applied": true, "quirk_class": "ts0001_switch.TuyaFingerbot", "manufacturer_code": 4417, "power_source": "Battery or Unknown", "lqi": 172, "rssi": -57, "last_seen": "2023-07-27T19:33:37", "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=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=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": "0x0104", "device_type": "0x0103", "input_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006", "0xef00" ], "output_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZ3210_dse8ogfy", "model": "TS0001" }, "active_coordinator": false, "entities": [ { "entity_id": "switch.tz3210_dse8ogfy_ts0001_switch", "name": "_TZ3210_dse8ogfy TS0001" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "ON_OFF_SWITCH" } ], "user_given_name": null, "device_reg_id": "7671f1e7c3d0add92f99345cd3d1385e", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "ON_OFF_SWITCH", "id": 259 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0001": { "attribute_name": "app_version", "value": 129 }, "0xfffd": { "attribute_name": "cluster_revision", "value": 2 }, "0x0006": { "attribute_name": "date_code", "value": "" }, "0x0003": { "attribute_name": "hw_version", "value": 1 }, "0x0004": { "attribute_name": "manufacturer", "value": "_TZ3210_dse8ogfy" }, "0x0005": { "attribute_name": "model", "value": "TS0001" }, "0x0007": { "attribute_name": "power_source", "value": 3 }, "0xfffe": { "attribute_name": "reporting_status", "value": 0 }, "0x0002": { "attribute_name": "stack_version", "value": 0 }, "0x0000": { "attribute_name": "zcl_version", "value": 3 } }, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0xfffd": { "attribute_name": "cluster_revision", "value": 2 }, "0x0000": { "attribute_name": "on_off", "value": 1 } }, "unsupported_attributes": { "0x4003": { "attribute_name": "start_up_on_off" } } }, "0xef00": { "endpoint_attribute": "tuya_manufacturer", "attributes": { "0x0066": { "attribute_name": "down_movement", "value": 85 }, "0x0065": { "attribute_name": "mode", "value": 0 }, "0x0068": { "attribute_name": "reverse", "value": 1 }, "0x0067": { "attribute_name": "sustain_time", "value": 0 }, "0x006a": { "attribute_name": "up_movement", "value": 0 } }, "unsupported_attributes": {} } }, "out_clusters": { "0x000a": { "endpoint_attribute": "time", "attributes": { "0xfffd": { "attribute_name": "cluster_revision", "value": 1 } }, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": { "0xfffd": { "attribute_name": "cluster_revision", "value": 3 }, "0x0002": { "attribute_name": "current_file_version", "value": 129 }, "0x0003": { "attribute_name": "current_zigbee_stack_version", "value": 2 }, "0x0004": { "attribute_name": "downloaded_file_version", "value": 4294967295 }, "0x0005": { "attribute_name": "downloaded_zigbee_stack_version", "value": 65535 }, "0x0001": { "attribute_name": "file_offset", "value": 4294967295 }, "0x0008": { "attribute_name": "image_type_id", "value": 65535 }, "0x0006": { "attribute_name": "image_upgrade_status", "value": 0 }, "0x0007": { "attribute_name": "manufacturer_id", "value": 4417 }, "0x0009": { "attribute_name": "minimum_block_req_delay", "value": 0 }, "0x0000": { "attribute_name": "upgrade_server_id", "value": [ 255, 255, 255, 255, 255, 255, 255, 255 ] } }, "unsupported_attributes": {} } } } } } } ```

Logs

Logs I tried to write the attributes using zha toolkit Input: ```yaml service: zha_toolkit.attr_write data: ieee: switch.tz3210_dse8ogfy_ts0001_switch cluster: 61184 attribute: 101 attr_val: 1 use_cache: false attr_type: 0x30 ``` Logs: ```python 2023-07-27 19:36:48.223 INFO (MainThread) [custom_components.zha_toolkit] Running ZHA Toolkit service: 2023-07-27 19:36:48.239 DEBUG (MainThread) [custom_components.zha_toolkit] module is 2023-07-27 19:36:48.242 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Parameters '{'ieee': 'switch.tz3210_dse8ogfy_ts0001_switch', 'cluster': 61184, 'attribute': 101, 'attr_val': 1, 'use_cache': False}' 2023-07-27 19:36:48.242 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Final manf 'None' 2023-07-27 19:36:48.242 DEBUG (MainThread) [custom_components.zha_toolkit.utils] registry_entity RegistryEntry(entity_id='switch.tz3210_dse8ogfy_ts0001_switch', unique_id='a4:c1:38:5c:8a:49:86:67-1-6', platform='zha', aliases=set(), area_id=None, capabilities=None, config_entry_id='e9b26214849b54dfe218e57d55a44d76', device_class=None, device_id='7671f1e7c3d0add92f99345cd3d1385e', disabled_by=None, entity_category=None, hidden_by=None, icon=None, id='0f0f34cb887715e6f448907b21056696', has_entity_name=True, name=None, options={'conversation': {'should_expose': True}}, original_device_class=None, original_icon=None, original_name='Switch', supported_features=0, translation_key=None, unit_of_measurement=None) 2023-07-27 19:36:48.243 DEBUG (MainThread) [custom_components.zha_toolkit.utils] registry_device DeviceEntry(area_id=None, config_entries={'e9b26214849b54dfe218e57d55a44d76'}, configuration_url=None, connections={('zigbee', 'a4:c1:38:5c:8a:49:86:67')}, disabled_by=None, entry_type=None, hw_version=None, id='7671f1e7c3d0add92f99345cd3d1385e', identifiers={('zha', 'a4:c1:38:5c:8a:49:86:67')}, manufacturer='_TZ3210_dse8ogfy', model='TS0001', name_by_user=None, name='_TZ3210_dse8ogfy TS0001', suggested_area=None, sw_version=None, via_device_id='ec37e937b34189ce182037c04b728863', is_new=False) 2023-07-27 19:36:48.243 DEBUG (MainThread) [custom_components.zha_toolkit] 'ieee' parameter: 'switch.tz3210_dse8ogfy_ts0001_switch' -> IEEE Addr: 'a4:c1:38:5c:8a:49:86:67' 2023-07-27 19:36:48.244 DEBUG (MainThread) [custom_components.zha_toolkit] Default handler for attr_write 2023-07-27 19:36:48.244 DEBUG (MainThread) [custom_components.zha_toolkit] Handler: 2023-07-27 19:36:48.244 DEBUG (MainThread) [custom_components.zha_toolkit] running default command: 2023-07-27 19:36:48.246 DEBUG (MainThread) [custom_components.zha_toolkit.default] Trying to import custom_components.zha_toolkit.zcl_attr to call attr_write 2023-07-27 19:36:48.248 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Endpoint 1 found for cluster '61184' 2023-07-27 19:36:48.248 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Request attr read [101] 2023-07-27 19:36:48.248 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] read_attributes --> attrs: [101] 2023-07-27 19:36:48.249 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Reading attr result (attrs, status): ({101: 0}, {}) 2023-07-27 19:36:48.249 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Type determined from read: 0xff 2023-07-27 19:36:48.249 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Request attr write [Attribute(attrid=0x0065, value=TypeValue(type=LVBytes, value=b'\x00'))] 2023-07-27 19:36:48.250 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=187, command_id=, *direction=) 2023-07-27 19:36:48.251 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] Sending request: Write_Attributes(attributes=[Attribute(attrid=0x0065, value=TypeValue(type=LVBytes, value=b'\x00'))]) 2023-07-27 19:36:48.251 DEBUG (MainThread) [zigpy.device] [0xaebe] Extending timeout for 0xbb request 2023-07-27 19:36:48.551 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xAEBE), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=112, profile_id=260, cluster_id=61184, data=Serialized[b'\x18\xbb\x04\x86e\x00\x86\x01\x00'], tx_options=, radius=0, non_member_radius=0, lqi=168, rssi=-58) 2023-07-27 19:36:48.552 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] Received ZCL frame: b'\x18\xbb\x04\x86e\x00\x86\x01\x00' 2023-07-27 19:36:48.553 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=187, command_id=4, *direction=) 2023-07-27 19:36:48.554 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] Decoded ZCL frame: TuyaFingerbotCluster:Write_Attributes_rsp(status_records=[WriteAttributesStatusRecord(status=, attrid=0x0065), WriteAttributesStatusRecord(status=, attrid=0x0001)]) 2023-07-27 19:36:48.555 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Write attr status: Write_Attributes_rsp(status_records=[WriteAttributesStatusRecord(status=, attrid=0x0065), WriteAttributesStatusRecord(status=, attrid=0x0001)]) 2023-07-27 19:36:48.556 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Write success: False 2023-07-27 19:36:48.556 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Request attr read [101] 2023-07-27 19:36:48.556 DEBUG (MainThread) [zigpy.zcl] [0xAEBE:1:0xef00] read_attributes --> attrs: [101] 2023-07-27 19:36:48.556 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Reading attr result (attrs, status): ({101: 0}, {}) 2023-07-27 19:36:48.560 DEBUG (MainThread) [custom_components.zha_toolkit] event_data {'zha_toolkit_version': 'v0.9.5', 'zigpy_version': '0.56.2', 'zigpy_rf_version': '0.35.8', 'ieee_org': 'switch.tz3210_dse8ogfy_ts0001_switch', 'ieee': 'a4:c1:38:5c:8a:49:86:67', 'command': 'attr_write', 'command_data': None, 'start_time': '2023-07-28T02:36:48.243778+00:00', 'errors': [], 'params': {'cluster_id': 61184, 'attr_id': 101, 'attr_val': 1, 'dir': 0, 'tries': 1, 'expect_reply': True, 'args': [], 'read_before_write': True, 'read_after_write': True}, 'compare_val': 1, 'attr_type': '0xFF', 'write_is_equal': False, 'read_before': ({101: 0}, {}), 'result_write': Write_Attributes_rsp(status_records=[WriteAttributesStatusRecord(status=, attrid=0x0065), WriteAttributesStatusRecord(status=, attrid=0x0001)]), 'result_read': ({101: 0}, {}), 'success': False} ```

Custom quirk

Custom quirk ```python from typing import Dict from zigpy.profiles import zha import zigpy.types as t from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) from zhaquirks.tuya.mcu import ( DPToAttributeMapping, EnchantedDevice, TuyaMCUCluster, TuyaOnOff, TuyaEnchantableCluster, ) class FingerBotMode(t.enum8): CLICK = 0x00 SWITCH = 0x01 PROGRAM = 0x02 class FingerBotReverse(t.enum8): UP_ON = 0x00 UP_OFF = 0x01 class TuyaFingerbotCluster(TuyaEnchantableCluster, TuyaMCUCluster): attributes = TuyaMCUCluster.attributes.copy() attributes.update({101: ("mode", FingerBotMode)}) attributes.update({102: ("down_movement", t.uint16_t)}) attributes.update({103: ("sustain_time", t.uint16_t)}) attributes.update({104: ("reverse", FingerBotReverse)}) attributes.update({106: ("up_movement", t.uint16_t)}) dp_to_attribute: Dict[int, DPToAttributeMapping] = { 1: DPToAttributeMapping(TuyaOnOff.ep_attribute, "on_off"), 101: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "mode", converter=lambda x: FingerBotMode(x), ), 102: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "down_movement", ), 103: DPToAttributeMapping(TuyaMCUCluster.ep_attribute, "sustain_time"), 104: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "reverse", converter=lambda x: FingerBotReverse(x), ), 106: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "up_movement", ), } data_point_handlers = { 1: "_dp_2_attr_update", 101: "_dp_2_attr_update", 102: "_dp_2_attr_update", 103: "_dp_2_attr_update", 104: "_dp_2_attr_update", 106: "_dp_2_attr_update", } class TuyaFingerbot(EnchantedDevice): signature = { MODELS_INFO: [("_TZ3210_dse8ogfy", "TS0001")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH, INPUT_CLUSTERS: [ Basic.cluster_id, TuyaOnOff.cluster_id, TuyaFingerbotCluster.cluster_id, ], OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, ], } }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH, INPUT_CLUSTERS: [ Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaOnOff.cluster_id, TuyaFingerbotCluster, ], OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, ], } } } ```

Additional information

No response

brettjurgens commented 1 year ago

I was able to get this to work by overriding the command method and having it use TUYA_SEND_DATA instead of the default TUYA_SET_DATA

Battery doesn't seem to work, but mode/up_movement/down_movement do

Updated Quirk ```py from typing import Any, Dict, Optional, Union from zigpy.profiles import zha import zigpy.types as t from zigpy.zcl import foundation from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) from zhaquirks.tuya import TUYA_SEND_DATA from zhaquirks.tuya.mcu import ( DPToAttributeMapping, EnchantedDevice, TuyaMCUCluster, TuyaOnOff, TuyaEnchantableCluster, ) class FingerBotMode(t.enum8): CLICK = 0x00 SWITCH = 0x01 PROGRAM = 0x02 class FingerBotReverse(t.enum8): UP_ON = 0x00 UP_OFF = 0x01 class TuyaFingerbotCluster(TuyaEnchantableCluster, TuyaMCUCluster): attributes = TuyaMCUCluster.attributes.copy() attributes.update({101: ("mode", FingerBotMode)}) attributes.update({102: ("down_movement", t.uint16_t)}) attributes.update({103: ("sustain_time", t.uint16_t)}) attributes.update({104: ("reverse", FingerBotReverse)}) attributes.update({105: ("battery", t.uint16_t)}) attributes.update({106: ("up_movement", t.uint16_t)}) attributes.update({107: ("touch_control", t.Bool)}) async def command( self, command_id: Union[foundation.GeneralCommand, int, t.uint8_t], *args, manufacturer: Optional[Union[int, t.uint16_t]] = None, expect_reply: bool = True, tsn: Optional[Union[int, t.uint8_t]] = None, **kwargs: Any, ): """Override the default Cluster command.""" return await super().command( TUYA_SEND_DATA, *args, manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID, expect_reply=expect_reply, tsn=tsn, **kwargs, ) dp_to_attribute: Dict[int, DPToAttributeMapping] = { 1: DPToAttributeMapping(TuyaOnOff.ep_attribute, "on_off"), # Mode 101: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "mode", converter=lambda x: FingerBotMode(x), ), # Down Movement 102: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "down_movement", ), # Sustain Time 103: DPToAttributeMapping(TuyaMCUCluster.ep_attribute, "sustain_time"), # Reverse 104: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "reverse", converter=lambda x: FingerBotReverse(x), ), # Battery 105: DPToAttributeMapping(TuyaMCUCluster.ep_attribute, "battery"), # Up Movement 106: DPToAttributeMapping( TuyaMCUCluster.ep_attribute, "up_movement", ), 107: DPToAttributeMapping(TuyaMCUCluster.ep_attribute, "touch_control"), } data_point_handlers = { 1: "_dp_2_attr_update", 101: "_dp_2_attr_update", 102: "_dp_2_attr_update", 103: "_dp_2_attr_update", 104: "_dp_2_attr_update", 105: "_dp_2_attr_update", 106: "_dp_2_attr_update", 107: "_dp_2_attr_update", } class TuyaFingerbot(EnchantedDevice): signature = { MODELS_INFO: [("_TZ3210_dse8ogfy", "TS0001")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH, INPUT_CLUSTERS: [ Basic.cluster_id, TuyaOnOff.cluster_id, TuyaFingerbotCluster.cluster_id, ], OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, ], } }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH, INPUT_CLUSTERS: [ Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, TuyaOnOff.cluster_id, TuyaFingerbotCluster, ], OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, ], } } } ```
xLama commented 1 year ago

It seems down_movement does not work for me. up_movement does

https://github.com/zigpy/zha-device-handlers/assets/8139881/368d91db-0c40-4178-94ec-80bbbdace3b5

abmantis commented 1 year ago

It seems down_movement does not work for me. up_movement does WhatsApp.Video.2023-08-08.at.12.33.52.mp4

I had the same issue initially, but after setting values for both down and up, down started working. Try setting up to 20 and down to 80 and test again (it only works after two tries in my case).

vineetk32 commented 1 year ago

I have had this device for a couple of months, and it has suddenly stopped working. On/off control has suddenly stopped working, and I cannot figure out why.

It doesn’t look like a hardware issue - I had a spare unopened device that I paired to ZHA, and that doesn’t work either. Doesn't seem like connection issue since I can read/write the up/down movement attributes (or the touch_control attribute) just fine.

Any pointers to troubleshoot?

pickonedev commented 9 months ago

I don't know if this is the right place to ask, but I will do it, maybe someone knows...

I have the same product and I use it by doing a ZbSend command like this zbsend {"Device":"0xD3E6","Endpoint":1,"Send":{"Power":1}} and the device will do the job, but I really want to know a command to use in order to make the device only press 50% of the way down, anyone knows how can I find all the commands or how to do this?

Thanks

pickonedev commented 9 months ago

Nobody? :-(

xxLeoxx93 commented 9 months ago

@pickonedev Have you tried setting these parameters: https://github.com/zigpy/zha-device-handlers/issues/2493#issuecomment-1705745634

btw: how are you sending the command? for me the device becomes unresponsive after pairing. When I sart paring and the blue light flashes it gets connected but once it stops flashing (it flashes for a minute or so even after paring) it doesn't respond anymore

xxLeoxx93 commented 9 months ago

I have had this device for a couple of months, and it has suddenly stopped working. On/off control has suddenly stopped working, and I cannot figure out why.

It doesn’t look like a hardware issue - I had a spare unopened device that I paired to ZHA, and that doesn’t work either. Doesn't seem like connection issue since I can read/write the up/down movement attributes (or the touch_control attribute) just fine.

Any pointers to troubleshoot?

Since I have an issue in the same direction: Maybe it's the new firmware. Not sure if you updated it but mine is new ordered and this could be a reason for it.

micium commented 7 months ago

https://github.com/TheJulianJES/zha-device-handlers/blob/be90f06ff57eac8a62f41a0cdbd753c441fd4d9d/zhaquirks/tuya/ts0001_fingerbot.py