Repository: zigpy/zha-device-handlers

Issue:
[Device Support Request] Pull Bead Curtain Motor M515EGZT -V2 (Tuya?)
The manual included with the device says the model is: M515EGZT -V2version-12v. When I bought it it said Tuya in the listing but The product is not branded. The device says TM616EGZT on the back.

**Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.**
```
[0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [60, <Bool.false: 0>]
[0x3a33:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=114 command_id=Command.Report_Attributes>
[0x3a33:1:0x0006] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=Bool, value=Bool.true>)]]
[0x3a33:1:0x0006] Attribute report received: on_off=1
[0x3a33:1:0x0008] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=115 command_id=Command.Report_Attributes>
[0x3a33:1:0x0008] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=uint8_t, value=131>)]]
[0x3a33:1:0x0008] Attribute report received: current_level=131
[0x3A33:1:0x0008]: received attribute: 0 update with value: 131
[0x2929:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=21 command_id=Command.Report_Attributes>
[0x2929:1:0x0006] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=Bool, value=Bool.true>)]]
[0x2929:1:0x0006] Attribute report received: on_off=1
[0x8417:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=True> manufacturer=4447 tsn=196 command_id=Command.Report_Attributes>
[0x8417:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=65281, value=<TypeValue type=LVBytes, value=b'\x01!\xbd\x0b\x03(\x1c\x04!\xa8\x13\x05!%\x04\x06$\x01\x00\x00\x00\x00\n!\x00\x00d\x10\x00'>)]]
[0x8417:1:0x0000] Attribute report received: 65281=b'\x01!\xbd\x0b\x03(\x1c\x04!\xa8\x13\x05!%\x04\x06$\x01\x00\x00\x00\x00\n!\x00\x00d\x10\x00'
[0x8417:1:0x0001] Voltage mV: [Min]:2820 < [RAW]:3005 < [Max]:3100, Battery Percent: 66.0
New device 0xcbea (b4:e3:f9:ff:fe:f4:f8:2e) joined the network
[0xcbea] Scheduling initialization
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 0 to ep 0, cluster 19: b'\x85\xea\xcb.\xf8\xf4\xfe\xff\xf9\xe3\xb4\x8e'
[0xcbea:zdo] ZDO request ZDOCmd.Device_annce: [0xCBEA, b4:e3:f9:ff:fe:f4:f8:2e, 142]
Tries remaining: 3
[0xcbea] Requesting 'Node Descriptor'
Tries remaining: 2
[0xcbea] Extending timeout for 0x27 request
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 10: b'\x00,\x00\x07\x00'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0x000a id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=44 command_id=Command.Read_Attributes>, payload: b'\x07\x00'
[0xcbea] Uninitialized device command 'Command.Read_Attributes' args: [[7]]
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 61184: b'\t-\x01\x00\x03\x01\x04\x00\x01\x01'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0xef00 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>, payload: b'\x00\x03\x01\x04\x00\x01\x01'
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 61184: b'\t-\x01\x00\x03\x01\x04\x00\x01\x01'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0xef00 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>, payload: b'\x00\x03\x01\x04\x00\x01\x01'
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 61184: b'\t-\x01\x00\x03\x01\x04\x00\x01\x01'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0xef00 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>, payload: b'\x00\x03\x01\x04\x00\x01\x01'
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 61184: b'\t-\x01\x00\x03\x01\x04\x00\x01\x01'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0xef00 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>, payload: b'\x00\x03\x01\x04\x00\x01\x01'
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 61184: b'\t-\x01\x00\x03\x01\x04\x00\x01\x01'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0xef00 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>, payload: b'\x00\x03\x01\x04\x00\x01\x01'
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 0 to ep 0, cluster 32770: b"'\x00\xea\xcb\x01@\x8e\x02\x10RR\x00\x00,R\x00\x00"
[0xcbea] Got 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.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, 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)
[0xcbea] Discovering endpoints
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 1 to ep 1, cluster 61184: b'\t-\x01\x00\x03\x01\x04\x00\x01\x01'
[0xcbea] Received ZCL while uninitialized on endpoint id 1, cluster 0xef00 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>, payload: b'\x00\x03\x01\x04\x00\x01\x01'
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 0 to ep 0, cluster 32773: b')\x00\xea\xcb\x01\x01'
[0xcbea] Discovered endpoints: [1]
[0xcbea] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>]
[0xcbea:1] Discovering endpoint information
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=False> from ep 0 to ep 0, cluster 32772: b'+\x00\xea\xcb\x14\x01\x04\x01Q\x00\x01\x04\x00\x00\x04\x00\x05\x00\x00\xef\x02\x19\x00\n\x00'
[0xcbea:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=81, device_version=1, input_clusters=[0, 4, 5, 61184], output_clusters=[25, 10])
Unknown cluster 61184
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] Unknown cluster-specific command 1
[0xcbea:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=45 command_id=Command.Read_Attributes_rsp>
[0xcbea:1:0x0000] ZCL request 0x0001: [[ReadAttributeRecord(attrid=4, status=<Status.SUCCESS: 0>, value=<TypeValue type=CharacterString, value=_TZE200_hsgrhjpf>), ReadAttributeRecord(attrid=5, status=<Status.SUCCESS: 0>, value=<TypeValue type=CharacterString, value=TS0601>)]]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] Unknown cluster-specific command 1
[0xcbea:1:0xef00] ZCL request 0x0001: b'\x00\x03\x01\x04\x00\x01\x01'
[0xcbea:1:0xef00] No handler for cluster command 1
[0xcbea:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=47 command_id=Command.Read_Attributes_rsp>
Error handling '_save_attribute' event with (b4:e3:f9:ff:fe:f4:f8:2e, 1, 0, 4, '_TZE200_hsgrhjpf') params: FOREIGN KEY constraint failed
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] Unknown cluster-specific command 1
[0xcbea:1:0xef00] ZCL request 0x0001: b'\x00\x03\x01\x04\x00\x01\x01'
[0xcbea:1:0xef00] No handler for cluster command 1
[0xcbea:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=49 command_id=Command.Read_Attributes_rsp>
[0xcbea] Read model 'TS0601' and manufacturer '_TZE200_hsgrhjpf' from <Endpoint id=1 in=[basic:0x0000, groups:0x0004, scenes:0x0005, None:0xEF00] out=[ota:0x0019, time:0x000A] status=<Status.ZDO_INIT: 1>>
[0xcbea] Discovered basic device information for <Device model='TS0601' manuf='_TZE200_hsgrhjpf' nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=True>
Device is initialized <Device model='TS0601' manuf='_TZE200_hsgrhjpf' nwk=0xCBEA ieee=b4:e3:f9:ff:fe:f4:f8:2e is_initialized=True>
Checking quirks for _TZE200_hsgrhjpf TS0601 (b4:e3:f9:ff:fe:f4:f8:2e)
Considering <class 'ts0601.TuyaMoesCover0601'>
Found custom device replacement for b4:e3:f9:ff:fe:f4:f8:2e: <class 'ts0601.TuyaMoesCover0601'>
device - 0xCBEA:b4:e3:f9:ff:fe:f4:f8:2e entering async_device_initialized - is_new_join: True
device - 0xCBEA:b4:e3:f9:ff:fe:f4:f8:2e has joined the ZHA zigbee network
[0xCBEA](TS0601): started configuration
[0xCBEA:ZDO](TS0601): 'async_configure' stage succeeded
Error handling '_save_attribute' event with (b4:e3:f9:ff:fe:f4:f8:2e, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed
[0xCBEA:1:0x0102]: bound 'window_covering' cluster: Status.SUCCESS
[0xCBEA:1:0x0102]: Successfully configured reporting for '{'current_position_lift_percentage': (0, 900, 1)}' on 'window_covering' cluster: [ConfigureReportingResponseRecord(status=0)]
[0xCBEA:1:0x0102]: finished channel configuration
[0xCBEA:1:0x0000]: finished channel configuration
[0xCBEA:1:0x0019]: finished channel configuration
[0xCBEA:1:0x0102]: 'async_configure' stage succeeded
[0xCBEA:1:0x0000]: 'async_configure' stage succeeded
[0xCBEA:1:0x0019]: 'async_configure' stage succeeded
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xCBEA](TS0601): completed configuration
[0xCBEA](TS0601): stored in registry: ZhaDeviceEntry(name='_TZE200_hsgrhjpf TS0601', ieee='b4:e3:f9:ff:fe:f4:f8:2e', last_seen=1637234015.6077633)
[0xCBEA](TS0601): started initialization
[0xCBEA:ZDO](TS0601): 'async_initialize' stage succeeded
[0xCBEA:1:0x0102]: initializing channel: from_cache: False
[0xCBEA:1:0x0102]: finished channel initialization
[0xCBEA:1:0x0000]: initializing channel: from_cache: False
[0xCBEA:1:0x0000]: finished channel initialization
[0xCBEA:1:0x0019]: initializing channel: from_cache: False
[0xCBEA:1:0x0019]: finished channel initialization
[0xCBEA:1:0x0102]: 'async_initialize' stage succeeded
[0xCBEA:1:0x0000]: 'async_initialize' stage succeeded
[0xCBEA:1:0x0019]: 'async_initialize' stage succeeded
[0xCBEA](TS0601): power source: Mains
[0xCBEA](TS0601): completed initialization
[0xCBEA:1:0x0102]: read current position: None
polling current state
read pos=None
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
Error handling '_unsupported_attribute_added' event with (b4:e3:f9:ff:fe:f4:f8:2e, 1, 258, 8) params: FOREIGN KEY constraint failed
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=3, command_id=1025, function=0, data=[1, 1])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=46 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=4, command_id=1031, function=0, data=[1, 0])]
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=47 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=5, command_id=514, function=0, data=[4, 0, 0, 0, 100])]
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[current_position_lift_percentage] = 0
setting position: 0
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=48 command_id=1>
[0xcbea:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=6, command_id=1029, function=0, data=[1, 0])]
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[motor_direction] = 0
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=49 command_id=36>
[0xcbea:1:0xef00] ZCL request 0x0024: [[0, 44]]
[0xcbea:1:0xef00] No handler for cluster command 36
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=50 command_id=17>
[0xcbea:1:0xef00] Unknown cluster-specific command 17
[0xcbea:1:0xef00] ZCL request 0x0011: b'\x00-@'
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[current_position_lift_percentage] = 100
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[motor_direction] = 0
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[cover_inverted] = 0
setting position: 100
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=50 command_id=17>
[0xcbea:1:0xef00] Unknown cluster-specific command 17
[0xcbea:1:0xef00] ZCL request 0x0011: b'\x00-@'
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[current_position_lift_percentage] = 100
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[motor_direction] = 0
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[cover_inverted] = 0
setting position: 100
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=50 command_id=17>
[0xcbea:1:0xef00] Unknown cluster-specific command 17
[0xcbea:1:0xef00] ZCL request 0x0011: b'\x00-@'
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[current_position_lift_percentage] = 100
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[motor_direction] = 0
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[cover_inverted] = 0
setting position: 100
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=50 command_id=17>
[0xcbea:1:0xef00] Unknown cluster-specific command 17
[0xcbea:1:0xef00] ZCL request 0x0011: b'\x00-@'
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[current_position_lift_percentage] = 100
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[motor_direction] = 0
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[cover_inverted] = 0
setting position: 100
[0xcbea:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=50 command_id=17>
[0xcbea:1:0xef00] Unknown cluster-specific command 17
[0xcbea:1:0xef00] ZCL request 0x0011: b'\x00-@'
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[current_position_lift_percentage] = 100
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[motor_direction] = 0
[0xCBEA:1:0x0102]: Attribute report 'Window Covering'[cover_inverted] = 0
setting position: 100

```

**Additional context**
It pairs OK. No buttons at first. Tried using a custom quirk using the same key settings as for TZE200_nueqqe6k:
`TUYA_COVER_COMMAND = {
    "_TZE200_hsgrhjpf": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
}`
... then I see buttons but they can't be used. 

When I chose a point on the slider the device blinks once but nothing happens. I haven't set limits for the device (don't know how), so I can't see how the slider could ever work. Pressing the stop, up or down buttons just gives an error message "Failed to call service..."


Discussion:
I see now that my custom quirk doesn't seem to be loading ok.
```
File "/usr/local/lib/python3.9/site-packages/zhaquirks/tuya/__init__.py", line 917, in command
    TUYA_COVER_COMMAND[manufacturer][command_id],
KeyError: '_TZE200_hsgrhjpf'
```
Seems to me like it's not using the init file I put in the local folder. Why is that? 
The INIT must being put in the HA docker container or your local quirk can getting data from it (local quirks is getting all from the container and cant getting from local quirks).

Instruction editing files in the HA container: https://github.com/zigpy/zha-device-handlers/discussions/693
I've now edited the init file directly in the container and now the buttons work.

in the file ts0601.py I used:
```
        MODELS_INFO: [
            ("_TZE200_zah67ekd", "TS0601"),
            ("_TZE200_xuzcvlku", "TS0601"),
            ("_TZE200_rddyvrci", "TS0601"),
            ("_TZE200_nueqqe6k", "TS0601"),
            ("_TZE200_gubdgai2", "TS0601"),
            ("_TZE200_yenbr4om", "TS0601"),
            ("_TZE200_5sbebbzs", "TS0601"),
            ("_TZE200_hsgrhjpf", "TS0601"),
        ], 
```
and in __init__.py:
```
TUYA_COVER_COMMAND = {
    "_TZE200_zah67ekd": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_fzo2pocs": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_xuzcvlku": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_rddyvrci": {0x0000: 0x0002, 0x0001: 0x0001, 0x0002: 0x0000},
    "_TZE200_3i3exuay": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_nueqqe6k": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_gubdgai2": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_zpzndjez": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_cowvfni3": {0x0000: 0x0002, 0x0001: 0x0000, 0x0002: 0x0001},
    "_TYST11_wmcdj3aq": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_yenbr4om": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_5sbebbzs": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
    "_TZE200_hsgrhjpf": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
}
```

I still don't know how or if it is possible to calibrate the end positions somehow. So the slider doesn't work. How is it I'm supposed to set the end positions, what clusters/commands should I use?
I dont knowing but i think it can being made with the buttons but you need reading in the forum how to do that.

If the Up, Down and Stop working OK (then 100% open the up is grayed out and the down is grayed out then 100% closed) ?

If it OK i can doing one PR for adding it do it being supported in next release of HA.
> I dont knowing but i think it can being made with the buttons but you need reading in the forum how to do that.
> 
> If the Up, Down and Stop working OK (then 100% open the up is grayed out and the down is grayed out then 100% closed) ?
> 
> If it OK i can doing one PR for adding it do it being supported in next release of HA.

If I manually set the slider to somewhere in the middle I can use both the UP and Down button, otherwise one button is greyed out. I think this part is working ok. The missing functionality stems form me not having limits set so I think adding it would be fine.

I may add that the manual only shows how to set the limits via the Queqi gateway. There are no instructions for using the set-buttons and the method for first version of M515EGZT doesn't seem to work, so I think I need to do this via zigbee. Maybe someone could sniff what the gateway is doing when it sets the limits.

Resolving patch:
diff --git a/zhaquirks/tuya/__init__.py b/zhaquirks/tuya/__init__.py
--- a/zhaquirks/tuya/__init__.py
+++ b/zhaquirks/tuya/__init__.py
@@ -105,6 +105,7 @@
     "_TZE200_yenbr4om": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
     "_TZE200_5sbebbzs": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
     "_TZE200_xaabybja": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
+    "_TZE200_hsgrhjpf": {0x0000: 0x0000, 0x0001: 0x0002, 0x0002: 0x0001},
 }
 # Taken from zigbee-herdsman-converters
 # Contains all covers which need their position inverted by default
diff --git a/zhaquirks/tuya/ts0601_cover.py b/zhaquirks/tuya/ts0601_cover.py
--- a/zhaquirks/tuya/ts0601_cover.py
+++ b/zhaquirks/tuya/ts0601_cover.py
@@ -182,6 +182,7 @@ class TuyaMoesCover0601(TuyaWindowCover):
             ("_TZE200_yenbr4om", "TS0601"),
             ("_TZE200_5sbebbzs", "TS0601"),
             ("_TZE200_xaabybja", "TS0601"),
+            ("_TZE200_hsgrhjpf", "TS0601"),
         ],
         ENDPOINTS: {
             1: {


Test patch: