[Device Support Request] Linkind ZB-MotionSensor-D0003

Is your feature request related to a problem? Please describe.
The sensor is recognized in Home Assistant as a motion sensor and reports motion in the logs as Alarm_1; the sensor also has a bright/dark sensor it reports as Alarm_2 on dark. The problem is that if either Alarm is active Home Assistant marks motion as "on" --- if it is dark the sensor does not time out after motion stops until it is bright again and the motion status updates making it useless for detecting repeated motion in dark or near-dark rooms. Note that it only updates the status of bright/dark when it reports on motion start or motion timeout.
Describe the solution you'd like
The motion entity reports motion status (Alarm_1) regardless of the light/dark status (Alarm_2). If possible, an entity that reports the light/dark update status. If possible, An additional entity for Tamper status.
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.
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4456, 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=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": "0x0402",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0020",
        "0x0500",
        "0x0b05",
        "0xfc81"
      ],
      "out_clusters": [
        "0x0019"
      ]
    }
  },
  "manufacturer": "lk",
  "model": "ZB-MotionSensor-D0003",
  "class": "zigpy.device.Device"
}

Additional context
https://zigbee.blakadder.com/Linkind_ZS110040078.html
https://www.linkind.com/product/pir-motion-sensor-zigbee/
Output from activity log showing various states; bright and dark were achieved by placing sensor in front of computer monitor and changing between white and black background:
NoTamper, Bright, NoMotion 0-0-0 0 48
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=37 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports: 48>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.0
NoTamper, Bright, Motion 0-0-1 1 49
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=38 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Alarm_1: 49>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_1
NoTamper, Dark, NoMotion 0-2-0 2 50
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=32 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Alarm_2: 50>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2
NoTamper, Dark, Motion 0-2-1 3 51
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=31 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Alarm_2|Alarm_1: 51>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2|Alarm_1
Tamper, Bright, NoMotion 4-0-0 4 52
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=24 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Tamper: 52>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.0
Tamper, Bright, Motion 4-0-1 5 53
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=23 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Tamper|Alarm_1: 53>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_1
Tamper, Dark, NoMotion 4-2-0 6 54
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=29 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Tamper|Alarm_2: 54>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2
Tamper, Dark, Motion 4-2-1 7 55
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=20 command_id=0>
[0x3ab3:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Tamper|Alarm_2|Alarm_1: 55>, <bitmap8.0: 0>, 0, 0]
[0x3ab3:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2|Alarm_1
Other
[0x3ab3:1:0x0500] ZCL deserialize: <ZCLHeader frame_control= manufacturer=4456 tsn=25 command_id=Command.Report_Attributes>
[0x3ab3:1:0x0500] ZCL request 0x000a: [[Attribute(attrid=65531, value=)]]
[0x3ab3:1:0x0500] Attribute report received: 65531=1
Output from join log:

Logs
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Received childJoinHandler frame with [1, <Bool.true: 1>, 0x8009, 04:cd:15:ff:fe:63:7d:48, <EmberNodeType.SLEEPY_END_DEVICE: 4>]
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Received trustCenterJoinHandler frame with [0x8009, 04:cd:15:ff:fe:63:7d:48, <EmberDeviceUpdate.STANDARD_SECURITY_UNSECURED_JOIN: 1>, <EmberJoinDecision.USE_PRECONFIGURED_KEY: 0>, 0x0000]
2022-01-16 12:41:56 INFO (MainThread) [zigpy.application] Device 0x8009 (04:cd:15:ff:fe:63:7d:48) joined the network
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.application] Device 04:cd:15:ff:fe:63:7d:48 changed id (0x8009 => 0x8009)
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Scheduling initialization
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Canceling old initialize call
2022-01-16 12:41:56 INFO (MainThread) [zigpy.device] [0x8009] Requesting 'Node Descriptor'
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0x95 request
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_BROADCAST: 4>, EmberApsFrame(profileId=0, clusterId=19, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_SOURCE_EUI64|APS_OPTION_UNKNOWN: 1032>, groupId=0, sequence=13), 255, -82, 0x8009, 255, 255, b'\x81\t\x80H}c\xfe\xff\x15\xcd\x04\x80']
2022-01-16 12:41:56 INFO (MainThread) [bellows.zigbee.application] ZDO Device announce: 0x8009, 04:cd:15:ff:fe:63:7d:48
2022-01-16 12:41:56 INFO (MainThread) [zigpy.application] Device 0x8009 (04:cd:15:ff:fe:63:7d:48) joined the network
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Scheduling initialization
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Canceling old initialize call
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device <Device model=None manuf=None nwk=0x8009 ieee=04:cd:15:ff:fe:63:7d:48 is_initialized=False> from ep 0 to ep 0, cluster 19: b'\x81\t\x80H}c\xfe\xff\x15\xcd\x04\x80'
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.zdo] [0x8009:zdo] ZDO request ZDOCmd.Device_annce: [0x8009, 04:cd:15:ff:fe:63:7d:48, 128]
2022-01-16 12:41:56 INFO (MainThread) [zigpy.device] [0x8009] Requesting 'Node Descriptor'
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0x97 request
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=2, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=151), 152, b'\x97\t\x80')
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32770, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=14), 255, -82, 0x8009, 255, 255, b'\x97\x00\t\x80\x02@\x80h\x11RR\x00\x00,R\x00\x00']
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device <Device model=None manuf=None nwk=0x8009 ieee=04:cd:15:ff:fe:63:7d:48 is_initialized=False> from ep 0 to ep 0, cluster 32770: b'\x97\x00\t\x80\x02@\x80h\x11RR\x00\x00,R\x00\x00'
2022-01-16 12:41:56 INFO (MainThread) [zigpy.device] [0x8009] Got Node Descriptor: NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4456, 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=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)
2022-01-16 12:41:56 INFO (MainThread) [zigpy.device] [0x8009] Discovering endpoints
2022-01-16 12:41:56 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0x99 request
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:56 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=5, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=153), 154, b'\x99\t\x80')
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32773, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=15), 255, -82, 0x8009, 255, 255, b'\x99\x00\t\x80\x01\x01']
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device <Device model=None manuf=None nwk=0x8009 ieee=04:cd:15:ff:fe:63:7d:48 is_initialized=False> from ep 0 to ep 0, cluster 32773: b'\x99\x00\t\x80\x01\x01'
2022-01-16 12:41:57 INFO (MainThread) [zigpy.device] [0x8009] Discovered endpoints: [1]
2022-01-16 12:41:57 INFO (MainThread) [zigpy.device] [0x8009] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>]
2022-01-16 12:41:57 INFO (MainThread) [zigpy.endpoint] [0x8009:1] Discovering endpoint information
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0x9b request
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=4, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=155), 156, b'\x9b\t\x80\x01')
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32772, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=16), 255, -82, 0x8009, 255, 255, b'\x9b\x00\t\x80\x18\x01\x04\x01\x02\x04\x01\x07\x00\x00\x01\x00\x03\x00 \x00\x00\x05\x05\x0b\x81\xfc\x01\x19\x00']
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device <Device model=None manuf=None nwk=0x8009 ieee=04:cd:15:ff:fe:63:7d:48 is_initialized=False> from ep 0 to ep 0, cluster 32772: b'\x9b\x00\t\x80\x18\x01\x04\x01\x02\x04\x01\x07\x00\x00\x01\x00\x03\x00 \x00\x00\x05\x05\x0b\x81\xfc\x01\x19\x00'
2022-01-16 12:41:57 INFO (MainThread) [zigpy.endpoint] [0x8009:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=1026, device_version=1, input_clusters=[0, 1, 3, 32, 1280, 2821, 64641], output_clusters=[25])
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0x9d request
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=0, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=157), 158, b'\x00\x9d\x00\x04\x00\x05\x00')
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=0, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=17), 255, -82, 0x8009, 255, 255, b'\x08\x9d\x01\x04\x00\x00B\x02lk\x05\x00\x00B\x15ZB-MotionSensor-D0003']
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=157 command_id=Command.Read_Attributes_rsp>
2022-01-16 12:41:57 INFO (MainThread) [zigpy.device] [0x8009] Read model 'ZB-MotionSensor-D0003' and manufacturer 'lk' from <Endpoint id=1 in=[basic:0x0000, power:0x0001, identify:0x0003, poll_control:0x0020, ias_zone:0x0500, diagnostic:0x0B05, manufacturer_specific:0xFC81] out=[ota:0x0019] status=<Status.ZDO_INIT: 1>>
2022-01-16 12:41:57 INFO (MainThread) [zigpy.device] [0x8009] Discovered basic device information for <Device model='ZB-MotionSensor-D0003' manuf='lk' nwk=0x8009 ieee=04:cd:15:ff:fe:63:7d:48 is_initialized=True>
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='ZB-MotionSensor-D0003' manuf='lk' nwk=0x8009 ieee=04:cd:15:ff:fe:63:7d:48 is_initialized=True>
2022-01-16 12:41:57 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x8009:04:cd:15:ff:fe:63:7d:48 entering async_device_initialized - is_new_join: True
2022-01-16 12:41:57 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x8009:04:cd:15:ff:fe:63:7d:48 has joined the ZHA zigbee network
2022-01-16 12:41:57 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x8009](ZB-MotionSensor-D0003): started configuration
2022-01-16 12:41:57 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:ZDO](ZB-MotionSensor-D0003): 'async_configure' stage succeeded
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0x9f request
2022-01-16 12:41:57 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xa1 request
2022-01-16 12:41:57 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0000]: finished channel configuration
2022-01-16 12:41:57 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xa3 request
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=159), 160, b'\x00\x9f\x00\x01\x00')
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=33, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=161), 162, b'\xa1H}c\xfe\xff\x15\xcd\x04\x01\x01\x00\x03\xc2\xda\x0e\x15\x00o\r\x00\x01')
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=33, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=163), 164, b'\xa3H}c\xfe\xff\x15\xcd\x04\x01 \x00\x03\xc2\xda\x0e\x15\x00o\r\x00\x01')
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=18), 240, -82, 0x8009, 255, 255, b'\x08\x9f\x01\x01\x00\x001\r\x00']
2022-01-16 12:41:58 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=159 command_id=Command.Read_Attributes_rsp>
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32801, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=19), 255, -82, 0x8009, 255, 255, b'\xa1\x00']
2022-01-16 12:41:58 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: started IASZoneChannel configuration
2022-01-16 12:41:58 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xa5 request
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:58 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: bound 'power' cluster: Status.SUCCESS
2022-01-16 12:41:58 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xa7 request
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32801, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=20), 255, -82, 0x8009, 255, 255, b'\xa3\x00']
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=33, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=165), 166, b'\xa5H}c\xfe\xff\x15\xcd\x04\x01\x00\x05\x03\xc2\xda\x0e\x15\x00o\r\x00\x01')
2022-01-16 12:41:58 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: bound 'poll_control' cluster: Status.SUCCESS
2022-01-16 12:41:58 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xa9 request
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=167), 168, b'\x00\xa7\x06\x00 \x00 \x10\x0e0*\x01\x00!\x00 \x10\x0e0*\x01')
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:41:58 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=32, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=169), 170, b'\x00\xa9\x02\x00\x00#\x903\x00\x00')
2022-01-16 12:41:59 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=22), 255, -82, 0x8009, 255, 255, b'\x08\xa7\x07\x00']
2022-01-16 12:41:59 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0001] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=167 command_id=Command.Configure_Reporting_rsp>
2022-01-16 12:41:59 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=32, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=23), 246, -82, 0x8009, 255, 255, b'\x08\xa9\x04\x00']
2022-01-16 12:41:59 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0020] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=169 command_id=Command.Write_Attributes_rsp>
2022-01-16 12:41:59 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: Successfully configured reporting for '{'battery_voltage': (3600, 10800, 1), 'battery_percentage_remaining': (3600, 10800, 1)}' on 'power' cluster: [ConfigureReportingResponseRecord(status=0)]
2022-01-16 12:41:59 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: finished channel configuration
2022-01-16 12:41:59 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: 3300.0s check-in interval set: [[WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)]]
2022-01-16 12:41:59 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: finished channel configuration
2022-01-16 12:41:59 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0019]: finished channel configuration
2022-01-16 12:42:02 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_BROADCAST: 4>, EmberApsFrame(profileId=0, clusterId=54, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_UNKNOWN: 8>, groupId=0, sequence=25), 255, -81, 0x8009, 255, 255, b'\x02\xb4\x01']
2022-01-16 12:42:02 DEBUG (MainThread) [zigpy.zdo] [0x8009:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [180, <Bool.true: 1>]
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32801, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=26), 255, -82, 0x8009, 255, 255, b'\xa5\x00']
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: bound 'ias_zone' cluster: Status.SUCCESS
2022-01-16 12:42:08 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xad request
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=173), 174, b'\x00\xad\x02\x10\x00\xf0\xc2\xda\x0e\x15\x00o\r\x00')
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=32801, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=21), 255, -79, 0x8009, 255, 255, b'\xa5\x00']
2022-01-16 12:42:08 DEBUG (MainThread) [zigpy.zdo] [0x8009:zdo] ZDO request ZDOCmd.Bind_rsp: [<Status.SUCCESS: 0>]
2022-01-16 12:42:08 DEBUG (MainThread) [zigpy.zdo] [0x8009:zdo] No handler for ZDO request:ZDOCmd.Bind_rsp([<Status.SUCCESS: 0>])
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=27), 255, -79, 0x8009, 255, 255, b'\x08\xad\x04\x00']
2022-01-16 12:42:08 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=173 command_id=Command.Write_Attributes_rsp>
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: wrote cie_addr: 00:0d:6f:00:15:0e:da:c2 to 'ias_zone' cluster: [WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)]
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: Sending pro-active IAS enroll response
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: finished IASZoneChannel configuration
2022-01-16 12:42:08 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xaf request
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: 'async_configure' stage succeeded
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: 'async_configure' stage succeeded
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0000]: 'async_configure' stage succeeded
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: 'async_configure' stage succeeded
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0019]: 'async_configure' stage succeeded
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x8009](ZB-MotionSensor-D0003): completed configuration
2022-01-16 12:42:08 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x8009](ZB-MotionSensor-D0003): stored in registry: ZhaDeviceEntry(name='unk_manufacturer unk_model', ieee='04:cd:15:ff:fe:63:7d:48', last_seen=1642372928.5891716)
2022-01-16 12:42:08 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xb1 request
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=175), 176, b'\x01\xaf\x00\x00\x00')
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:08 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=3, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=177), 178, b'\x01\xb1@\x02\x00')
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=3, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=28), 255, -79, 0x8009, 255, 255, b'\x08\xb1\x0b@\x81']
2022-01-16 12:42:09 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0003] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=177 command_id=Command.Default_Response>
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0003]: executed 'trigger_effect' command with args: '(2, 0)' kwargs: '{}' result: [64, <Status.UNSUP_CLUSTER_COMMAND: 129>]
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x8009](ZB-MotionSensor-D0003): started initialization
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:ZDO](ZB-MotionSensor-D0003): 'async_initialize' stage succeeded
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: initializing channel: from_cache: False
2022-01-16 12:42:09 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xb3 request
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: initializing channel: from_cache: False
2022-01-16 12:42:09 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xb5 request
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0000]: initializing channel: from_cache: False
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0000]: finished channel initialization
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: initializing channel: from_cache: False
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: finished channel initialization
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0019]: initializing channel: from_cache: False
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0019]: finished channel initialization
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=179), 180, b'\x00\xb3\x00\x00\x00')
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=181), 182, b'\x00\xb5\x00 \x00!\x00')
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=29), 255, -80, 0x8009, 255, 255, b'\x08\xb3\x01\x00\x00\x000\x01']
2022-01-16 12:42:09 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=179 command_id=Command.Read_Attributes_rsp>
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=32), 255, -80, 0x8009, 255, 255, b'\x08\xb5\x01 \x00\x00 \x1b!\x00\x00 \x86']
2022-01-16 12:42:09 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0001] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=181 command_id=Command.Read_Attributes_rsp>
2022-01-16 12:42:09 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: finished channel initialization
2022-01-16 12:42:09 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xb7 request
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:09 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=183), 184, b'\x00\xb7\x001\x003\x00')
2022-01-16 12:42:11 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=33), 255, -80, 0x8009, 255, 255, b'\x08\xb7\x011\x00\x000\x023\x00\x00 \x01']
2022-01-16 12:42:11 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0001] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=183 command_id=Command.Read_Attributes_rsp>
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: finished channel initialization
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: 'async_initialize' stage succeeded
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0001]: 'async_initialize' stage succeeded
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0000]: 'async_initialize' stage succeeded
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0020]: 'async_initialize' stage succeeded
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0019]: 'async_initialize' stage succeeded
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x8009](ZB-MotionSensor-D0003): power source: Battery or Unknown
2022-01-16 12:42:11 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x8009](ZB-MotionSensor-D0003): completed initialization
2022-01-16 12:42:14 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_BROADCAST: 4>, EmberApsFrame(profileId=0, clusterId=6, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_UNKNOWN: 264>, groupId=0, sequence=34), 255, -82, 0x8009, 255, 255, b'\x03\xfd\xff\x04\x01\x01\x19\x00\x00']
2022-01-16 12:42:14 DEBUG (MainThread) [zigpy.zdo] [0x8009:zdo] ZDO request ZDOCmd.Match_Desc_req: [0xFFFD, 260, [25], []]
2022-01-16 12:42:14 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=32774, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=3), 185, b'\x03\x00\x00\x00\x01\x01')
2022-01-16 12:42:16 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=25, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_RETRY: 64>, groupId=0, sequence=35), 255, -82, 0x8009, 255, 255, b'\x01\x02\x01\x00h\x11\xfb\x80\x02\x00#Q']
2022-01-16 12:42:16 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=2 command_id=1>
2022-01-16 12:42:16 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] ZCL request 0x0001: [0, 4456, 33019,<PHONE_NUMBER>, None]
2022-01-16 12:42:16 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] OTA query_next_image handler for 'lk ZB-MotionSensor-D0003': field_control=0, manufacture_id=4456, image_type=33019, current_file_version=1361248258, hardware_version=None
2022-01-16 12:42:16 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] No OTA image is available
2022-01-16 12:42:16 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=25, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=2), 186, b'\x19\x02\x02\x98')
2022-01-16 12:42:18 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=30), 255, -82, 0x8009, 255, 255, b'\t\x01\x01\r\x00h\x11']
2022-01-16 12:42:18 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=1 command_id=1>
2022-01-16 12:42:18 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL request 0x0001: [<ZoneType.Motion_Sensor: 13>, 4456]
2022-01-16 12:42:18 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: Enroll requested
2022-01-16 12:42:18 DEBUG (MainThread) [zigpy.device] [0x8009] Extending timeout for 0xbb request
2022-01-16 12:42:18 DEBUG (MainThread) [bellows.zigbee.application] Extending timeout for 04:cd:15:ff:fe:63:7d:48/0x8009
2022-01-16 12:42:18 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=187), 188, b'\x01\xbb\x00\x00\x00')
2022-01-16 12:42:19 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=36), 255, -82, 0x8009, 255, 255, b'\x1ch\x11\x03\n\xfb\xff \x00']
2022-01-16 12:42:19 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=True> manufacturer=4456 tsn=3 command_id=Command.Report_Attributes>
2022-01-16 12:42:19 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL request 0x000a: [[Attribute(attrid=65531, value=<TypeValue type=uint8_t, value=0>)]]
2022-01-16 12:42:19 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] Attribute report received: 65531=0
2022-01-16 12:42:24 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_BROADCAST: 4>, EmberApsFrame(profileId=0, clusterId=6, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_UNKNOWN: 264>, groupId=0, sequence=37), 255, -83, 0x8009, 255, 255, b'\x04\xfd\xff\x04\x01\x01\x19\x00\x00']
2022-01-16 12:42:24 DEBUG (MainThread) [zigpy.zdo] [0x8009:zdo] ZDO request ZDOCmd.Match_Desc_req: [0xFFFD, 260, [25], []]
2022-01-16 12:42:24 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=0, clusterId=32774, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=4), 189, b'\x04\x00\x00\x00\x01\x01')
2022-01-16 12:42:26 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=25, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_RETRY: 64>, groupId=0, sequence=38), 244, -82, 0x8009, 255, 255, b'\x01\x04\x01\x00h\x11\xfb\x80\x02\x00#Q']
2022-01-16 12:42:26 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=4 command_id=1>
2022-01-16 12:42:26 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] ZCL request 0x0001: [0, 4456, 33019,<PHONE_NUMBER>, None]
2022-01-16 12:42:26 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] OTA query_next_image handler for 'lk ZB-MotionSensor-D0003': field_control=0, manufacture_id=4456, image_type=33019, current_file_version=1361248258, hardware_version=None
2022-01-16 12:42:26 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0019] No OTA image is available
2022-01-16 12:42:26 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x8009, EmberApsFrame(profileId=260, clusterId=25, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=4), 190, b'\x19\x04\x02\x98')
2022-01-16 12:42:59 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=39), 255, -80, 0x8009, 255, 255, b'\x18\x05\n!\x00 \xa8']
2022-01-16 12:42:59 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0001] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=5 command_id=Command.Report_Attributes>
2022-01-16 12:42:59 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0001] ZCL request 0x000a: [[Attribute(attrid=33, value=<TypeValue type=uint8_t, value=168>)]]
2022-01-16 12:42:59 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0001] Attribute report received: battery_percentage_remaining=168
2022-01-16 12:45:06 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=40), 255, -74, 0x8009, 255, 255, b'\x1ch\x11\x06\n\xfb\xff \x01']
2022-01-16 12:45:06 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=True> manufacturer=4456 tsn=6 command_id=Command.Report_Attributes>
2022-01-16 12:45:06 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL request 0x000a: [[Attribute(attrid=65531, value=<TypeValue type=uint8_t, value=1>)]]
2022-01-16 12:45:06 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] Attribute report received: 65531=1
2022-01-16 12:45:06 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=41), 255, -74, 0x8009, 255, 255, b'\x19\x07\x007\x00\x00\x00\x00\x00']
2022-01-16 12:45:06 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=7 command_id=0>
2022-01-16 12:45:06 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Tamper|Alarm_2|Alarm_1: 55>, <bitmap8.0: 0>, 0, 0]
2022-01-16 12:45:06 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2|Alarm_1
2022-01-16 12:45:30 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=42), 253, -90, 0x8009, 255, 255, b'\x19\x08\x003\x00\x00\x00\x00\x00']
2022-01-16 12:45:30 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=8 command_id=0>
2022-01-16 12:45:30 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Alarm_2|Alarm_1: 51>, <bitmap8.0: 0>, 0, 0]
2022-01-16 12:45:30 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2|Alarm_1
2022-01-16 12:46:30 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=1280, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=43), 240, -78, 0x8009, 255, 255, b'\x19\t\x002\x00\x00\x00\x00\x00']
2022-01-16 12:46:30 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=9 command_id=0>
2022-01-16 12:46:30 DEBUG (MainThread) [zigpy.zcl] [0x8009:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Restore_reports|Supervision_reports|Alarm_2: 50>, <bitmap8.0: 0>, 0, 0]
2022-01-16 12:46:30 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x8009:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_2

Great job digging into this.  I'm also interested in getting this sensor working.  Mine seems to get stuck and doesn't want to do anything.

I bought one of these motion sensors recently, and it has similarly been getting stuck on motion detected and refuses to clear until I remove and re-pair with ZHA.

Yeah… wonder if there is some way to solve this or if it’s just their firmware.  I do see there was solutions over on Hubitat forums but not sure what they ended up doing to make it work.
From: krazos @.>
Reply-To: zigpy/zha-device-handlers @.>
Date: Wednesday, February 2, 2022 at 10:16 AM
To: zigpy/zha-device-handlers @.>
Cc: jfrux @.>, Comment @.***>
Subject: Re: [zigpy/zha-device-handlers] [Device Support Request] Linkind ZB-MotionSensor-D0003 (Issue #1291)
I bought one of these motion sensors recently, and it has similarly been getting stuck on motion detected and refuses to clear until I remove and re-pair with ZHA.
—
Reply to this email directly, view it on GitHubhttps://github.com/zigpy/zha-device-handlers/issues/1291#issuecomment-1028044408, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABJYRJYBMCE3XCZ2U6XKV3UZFDD7ANCNFSM5MDKBDTQ.
You are receiving this because you commented.Message ID: @.***>

Is there any resolution to this issue as yet? I just paired 3 of these motion sensors with ZHA yesterday after a long time running Zigbee2MQTT. Immediately they detected motion they stuck on detected and did not clear without a full delete and repair - only to do it again immediately. They work fine in Zigbee2MQTT. Currently running HA 2022.7.7, which I assume has a reasonably up to date ZHA

I would also be genuinely interested in a solution.
I am currently trying to learn how to write quirks properly, but this one was maybe a little hard for the beginning 👯
What I have done so far (for 8 Hours until now):
→ Created a quirk that matches the device and gets applied.
"""Linkind ZB-MotionSensor-D0003."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
    Basic,
    Identify,
    Ota,
    PollControl,
    PowerConfiguration,
)
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.security import IasZone

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    SKIP_CONFIGURATION,
)
from zhaquirks.linkind import LinkindBasicCluster

LINKIND_CLUSTER_ID = 0xFC81

class LinkindD0003(CustomDevice):
    """Linkind ZB-MotionSensor-D0003."""

    signature = {
        MODELS_INFO: [("lk", "ZB-MotionSensor-D0003")],
        # <SimpleDescriptor endpoint=1 profile=260 device_type=1026
        # device_version=1
        # input_clusters=[0, 1, 3, 32, 1280, 2821, 64641]
        # output_clusters=[25]>
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    PollControl.cluster_id,
                    IasZone.cluster_id,
                    Diagnostic.cluster_id,
                    LINKIND_CLUSTER_ID,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    LinkindBasicCluster,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    PollControl.cluster_id,
                    IasZone.cluster_id,
                    Diagnostic.cluster_id,
                    LINKIND_CLUSTER_ID,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id],
            }
        },
    }

One thing in this quirk might be messed up, I guess:

The Manufacturer-Specific cluster was written by me, like I saw it on some Aqara devices (no idea if this is right). But as far as I know, there is no way around defining this cluster because otherwise ZHA wouldn't apply this quirk (Cluster-Missmatch)
But anyway, it is applied when joining the device:

What I don't know how to do: How to get the Occupancy Sensor working?
For my understanding, the IasZone Cluster should handle the "Strings" inside the ZoneStatus. But as it seems, this is not happening properly. (I have the same issue, the Occupancy is and will stay as "detected")
So now I am a little confused.

Shouldn't this be handled by the IasZone or is it normal that this doesn't work out of the box? (For the strings inside the ZoneStatus, see the initial issue)
Is it because this device uses inside ZoneStatus Alarm_2 as "Dark-Sensor" and Alarm_1 as "Motion-Sensor"? (Might be quite unusual)
Do we somehow need to modify (if possible) the way IasZone interprets these "strings"?
Will we need a custom attribute mapping with a kind of lambda handler, like for some Tuya devices? (And if yes, how to establish a DPToAttributeMapping without the TuyaDPType?)

Could someone point me in the right direction or link up an example-quirks? I wouldn't normally do this, but maybe
@javicalle has some advice or tips to give?
Additional Reference (Z2M Converter): https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices/linkind.js#L113
Perhaps one additional Question, regarding the Z2M Converter: If I get this correctly, the Method used to get the readings from the sensor (which works perfectly in Z2M) is this one. Is there a "method" like this in ZHA which could be used to read the sensor?
Maybe I am completely on the wrong trail with my questions and ideas here, everything is possible when learning something new 😁
Thanks to everyone who is trying to help 🙏 & please excuse the many questions 🤓

My Diagnostics for the device
{
"home_assistant": {
  "installation_type": "Home Assistant OS",
  "version": "2023.1.6",
  "dev": false,
  "hassio": true,
  "virtualenv": false,
  "python_version": "3.10.7",
  "docker": true,
  "arch": "aarch64",
  "timezone": "Europe/Berlin",
  "os_name": "Linux",
  "os_version": "5.15.76-v8",
  "supervisor": "2022.12.1",
  "host_os": "Home Assistant OS 9.4",
  "docker_version": "20.10.19",
  "chassis": "embedded",
  "run_as_root": true
},
"custom_components": {},
"integration_manifest": {
  "domain": "zha",
  "name": "Zigbee Home Automation",
  "config_flow": true,
  "documentation": "https://www.home-assistant.io/integrations/zha",
  "requirements": [
    "bellows==0.34.6",
    "pyserial==3.5",
    "pyserial-asyncio==0.6",
    "zha-quirks==0.0.90",
    "zigpy-deconz==0.19.2",
    "zigpy==0.53.0",
    "zigpy-xbee==0.16.2",
    "zigpy-zigate==0.10.3",
    "zigpy-znp==0.9.2"
  ],
  "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*"
    },
    {
      "type": "_slzb-06._tcp.local.",
      "name": "slzb-06*"
    }
  ],
  "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": 24133,
  "manufacturer": "lk",
  "model": "ZB-MotionSensor-D0003",
  "name": "lk ZB-MotionSensor-D0003",
  "quirk_applied": false,
  "quirk_class": "zigpy.device.Device",
  "manufacturer_code": 4456,
  "power_source": "Battery or Unknown",
  "lqi": 126,
  "rssi": null,
  "last_seen": "2023-01-24T16:06:48",
  "available": true,
  "device_type": "EndDevice",
  "signature": {
    "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4456, 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=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": "0x0402",
        "in_clusters": [
          "0x0000",
          "0x0001",
          "0x0003",
          "0x0020",
          "0x0500",
          "0x0b05",
          "0xfc81"
        ],
        "out_clusters": [
          "0x0019"
        ]
      }
    }
  },
  "active_coordinator": false,
  "entities": [
    {
      "entity_id": "binary_sensor.lk_zb_motionsensor_d0003_iaszone",
      "name": "lk ZB-MotionSensor-D0003"
    },
    {
      "entity_id": "button.lk_zb_motionsensor_d0003_identify",
      "name": "lk ZB-MotionSensor-D0003"
    },
    {
      "entity_id": "sensor.lk_zb_motionsensor_d0003_battery",
      "name": "lk ZB-MotionSensor-D0003"
    }
  ],
  "neighbors": [],
  "routes": [],
  "endpoint_names": [
    {
      "name": "IAS_ZONE"
    }
  ],
  "user_given_name": null,
  "device_reg_id": "4920654c5d5f2a7058834d9c24cedd6d",
  "area_id": "schlafzimmer",
  "cluster_details": {
    "1": {
      "device_type": {
        "name": "IAS_ZONE",
        "id": 1026
      },
      "profile_id": 260,
      "in_clusters": {
        "0x0000": {
          "endpoint_attribute": "basic",
          "attributes": {
            "0x0004": {
              "attribute_name": "manufacturer",
              "value": "lk"
            },
            "0x0005": {
              "attribute_name": "model",
              "value": "ZB-MotionSensor-D0003"
            }
          },
          "unsupported_attributes": {}
        },
        "0x0001": {
          "endpoint_attribute": "power",
          "attributes": {
            "0x0020": {
              "attribute_name": "battery_voltage",
              "value": 29
            },
            "0x0021": {
              "attribute_name": "battery_percentage_remaining",
              "value": 196
            },
            "0x0031": {
              "attribute_name": "battery_size",
              "value": 2
            },
            "0x0033": {
              "attribute_name": "battery_quantity",
              "value": 1
            }
          },
          "unsupported_attributes": {}
        },
        "0x0003": {
          "endpoint_attribute": "identify",
          "attributes": {},
          "unsupported_attributes": {}
        },
        "0x0020": {
          "endpoint_attribute": "poll_control",
          "attributes": {
            "0x0000": {
              "attribute_name": "checkin_interval",
              "value": 13200
            }
          },
          "unsupported_attributes": {}
        },
        "0x0500": {
          "endpoint_attribute": "ias_zone",
          "attributes": {
            "0x0000": {
              "attribute_name": "zone_state",
              "value": 1
            },
            "0x0001": {
              "attribute_name": "zone_type",
              "value": 13
            },
            "0x0002": {
              "attribute_name": "zone_status",
              "value": 48
            },
            "0x0010": {
              "attribute_name": "cie_addr",
              "value": [
                132,
                69,
                183,
                38,
                0,
                75,
                18,
                0
              ]
            }
          },
          "unsupported_attributes": {}
        },
        "0x0b05": {
          "endpoint_attribute": "diagnostic",
          "attributes": {},
          "unsupported_attributes": {}
        },
        "0xfc81": {
          "endpoint_attribute": "manufacturer_specific",
          "attributes": {},
          "unsupported_attributes": {}
        }
      },
      "out_clusters": {
        "0x0019": {
          "endpoint_attribute": "ota",
          "attributes": {},
          "unsupported_attributes": {}
        }
      }
    }
  }
}
}

IMHO the IasZone needs a proper way to manage the 'extra' status:

https://github.com/home-assistant/core/issues/72828

What I would suggest to you here will be:

import the MotionWithReset class

from zhaquirks import MotionWithReset

use it in the replacement part:

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    LinkindBasicCluster,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    PollControl.cluster_id,
                    MotionWithReset,
                    Diagnostic.cluster_id,
                    LINKIND_CLUSTER_ID,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id],
            }
        },
    }

This class will reset the sensor status at 30 seconds (if no movement detected).
If not working you can implement a custom cluster to do the same.

I can't believe it, seems to work 💙

It would be great if someone else verified the current state for a pull request. Even though I might end up creating a custom cluster for this (see below)... But if considered working, I would see this maybe as a basic Version for getting support in ZHA.

Current quirk
"""Linkind ZB-MotionSensor-D0003."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
  Basic,
  Identify,
  Ota,
  PollControl,
  PowerConfiguration,
)
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.security import IasZone

from zhaquirks.const import (
  DEVICE_TYPE,
  ENDPOINTS,
  INPUT_CLUSTERS,
  MODELS_INFO,
  OUTPUT_CLUSTERS,
  PROFILE_ID,
)
from zhaquirks.linkind import LinkindBasicCluster
from zhaquirks import MotionWithReset

LINKIND_CLUSTER_ID = 0xFC81

class LinkindD0003(CustomDevice):
  """Linkind ZB-MotionSensor-D0003."""

  signature = {
      MODELS_INFO: [("lk", "ZB-MotionSensor-D0003")],
      # <SimpleDescriptor endpoint=1 profile=260 device_type=1026
      # device_version=1
      # input_clusters=[0, 1, 3, 32, 1280, 2821, 64641]
      # output_clusters=[25]>
      ENDPOINTS: {
          1: {
              PROFILE_ID: zha.PROFILE_ID,
              DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
              INPUT_CLUSTERS: [
                  Basic.cluster_id,
                  PowerConfiguration.cluster_id,
                  Identify.cluster_id,
                  PollControl.cluster_id,
                  IasZone.cluster_id,
                  Diagnostic.cluster_id,
                  LINKIND_CLUSTER_ID,
              ],
              OUTPUT_CLUSTERS: [Ota.cluster_id],
          }
      },
  }

  replacement = {
      ENDPOINTS: {
          1: {
              PROFILE_ID: zha.PROFILE_ID,
              DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
              INPUT_CLUSTERS: [
                  LinkindBasicCluster,
                  PowerConfiguration.cluster_id,
                  Identify.cluster_id,
                  PollControl.cluster_id,
                  MotionWithReset,
                  Diagnostic.cluster_id,
                  LINKIND_CLUSTER_ID,
              ],
              OUTPUT_CLUSTERS: [Ota.cluster_id],
          }
      },
  }

So, just to get my Head around this: The MotionWithReset is basically taking the IasZone.cluster_id and interpreting the Return values differently (I remember the Translation example from the GitHub-Page)?
Thank you so much @javicalle  🙏
And 2 additional questions (So we even might beat Z2M's attributes):

In Z2M there are also Tamper "Entities". Is there a way to "extract" them too? (I guess this would need a custom cluster, right?)

To set the timeout to 2 Minutes (if I remember this correct, this is the default Reporting-Interval for the linkind), something like this would be required?

class MotionCluster(MotionWithReset):
    """Motion cluster."""

    reset_s: int = 120
    send_occupancy_event: bool = True

(And afterward of course using MotionCluster instead of MotionWithReset in replacement part)

There is a Cluster which says, "current_zone_sensitivity_level". Would it be possible to set these values to? If I recall correctly, I saw some Tuya quirks defining an enum where values like 0=low 1=med... were defined. This would require a custom cluster, right?

I'm glad that you get it working.

The MotionWithReset is basically taking the IasZone.cluster_id and interpreting the Return values differently (I remember the Translation example from the GitHub-Page)?

No. What is doing is starting a counter every time that a status report is recieved:
https://github.com/zigpy/zha-device-handlers/blob/d0732016c78c12b4f28930ea6affd385140af44e/zhaquirks/__init__.py#L267-L270
The counter (at reset_s seconds) will 'clear' the IasZone status (and trigger an event):
https://github.com/zigpy/zha-device-handlers/blob/d0732016c78c12b4f28930ea6affd385140af44e/zhaquirks/__init__.py#L242-L246
About your questions:

In Z2M there is also a Tamper "Entity". Is there a way to "extract" this too?

IMHO that is a discussion for the ZHA integration and not for the quirk side.
Currently the ZoneStatus can report a bunch of events/status:
https://github.com/zigpy/zigpy/blob/297a2b0f364fe7a31de3b4966d70d1a67d432358/zigpy/zcl/clusters/security.py#L41-L54
In ZHA, only the Alarm_1 and Alarm_2 are considerated.
I see 2 approachs here:

that the IasZone sensor becomes a multi-state sensor and exposes all possible values
that new sensors be implemented for the rest of the status (IasTamper, IasBattery, ...)

The first approach is less friendly to manage and in automatizations.
The second one have the problem that there is no way to know which status will report any device. Then what to do? Create all the entities for all the status? Just a few? Create in disabled mode?
In Z2M has been addressed in their own way and ZHA must do theirs.

3. There is a Cluster which says, "current_zone_sensitivity_level". Would it be possible to set these values to? If I recall correctly, I saw some Tuya quirks defining an enum where values like 0=low 1=med... were defined. This would require a custom cluster, right?

IMHO the goal of any quirk is to fix any functionality of the device that does not work due to a bad implementation of the zigbee standard. Period.
That is a clear example: the device reports the IasZone status but device is not usefull because doesn't restore the 'clear' status. A quirk to the rescue.
Does the device reports/implements any 'sensitivity level'? If it does and isn't working, I would try to fix it. But if the device doesn't implements it, IMHO we should not try to implement it programmatically (or at least add it to the library).

Thank you so much @javicalle and the time you put in your answer 💙
That really helped me out understanding how to approach it the ZHA way and gave me the possibility to take a look at some Motion-Quirks which were already created (and understand them better).
Do you have a PayPal-Link where I cloud give you a little something for the time you took explaining this stuff to me? (And for some questions I might have in the future 😁)

I'm glad to have been helpful.
Can you create the PR with the working code?

Do you have a PayPal-Link where I cloud give you a little something for the time you took explaining this stuff to me?

I appreciate the offer but I don't have.
@dmulcahey, are there any tip/coffee/beer jar for this offerings or donations?


Cds2

What is this PR for?
We introduce a class representing CDS Dates in a tabular way.
What type of PR is it?
New functionality.
Todos
N/A
What is the related issue?
N/A
How should this be tested?
We provide a small console test. Results have been compared with a vendor library.
Are there breaking changes for older versions?
No

Just a little minor comment (sorry for this):

the .project and .classpath should not be part of the pull request.
the Test in src/test should be JUnitTest (then Travis and Jenkins will run it automatically).

With respect to the classes itself: I have to check if it is OK to include a "port" (w.r.t. the license). Why not just implement our own algorithm to perform "IMM"-daterolling?!

No worries. If you see an issue with this just decline the pull request.


support quickly adding a direction tag to traffic signs

Pressing v flips the direction of a node, but does nothing for direction-less nodes.
This PR makes the v key add a direction tag if you try to flip a stop sign/give-way sign without a direction tag.
This significantly speeds up the process of mapping stop signs and give-way signs.
Closes #9802

sorry, I lost track of this PR, I've updated it to use the presets to determine whether a node is flippable. So it works for any field that has a tag like direction or …:direction
I've also added tests and fixed the bug when you flip a way


Discussion around the project

Hello,
From what I understand of this library, it replaces others ORM like TypeORM (you have entities, stores, drivers, etc) in order to be able to fetch data from a JSON API and I was thinking: why not developing a JSON API driver for TypeORM for example?
Because in the end, you have developed a JsonApiEntityProvider but you will have to do one for SQL Database, isn't it?

Hello,
Thanks for the great question!
About replacement of TypeORM and others the answer is yes and no. :)
TypeORM is a great library and targets applications which use databases. EntityStore in the first round focused on backend API's. At first glance it may seem that they solve similar issues but if you read deaper TypeManager documentation which is the core of this package you may notice some differences.
You are right that it can provide a replacement for TypeORM after some efforts but this is currently not on the roadmap. For databases there are many issues to solve like migrations, column mapping and others to really compete on a good level and not just create another clone.
The basic idea about EntityStore is reusability when working with different datasources. Today I have to work with JSON:API, tomorrow with GraphQL, another day with ODATA and so on. I want to have one universal API which provides me first class model support with sorting, filtering, pagination and data transformation so I don't have to worry about underlying service and simply make configuration by switching providers. Besides I want ORM with API as close as possible to native JavaScript with proper code references and type checks.
There are also other reasons why I've started this project which include topics like reflection, circular reference handling, custom property types, DI, etc. so I don't have to create a frankenstein from set of libraries to make it work in one project. :D

Hello,
Thanks for the explanations!
If I understand well, you plan to use this library in client side applications only right? In order to be able to fetch remote data from APIs?
How are architectured your projects?
On my side I'm looking for a data library (packaged as an API library) that I can use on both client AND server side.
I will call this data library: ProjectAPILib.
To give you an example:

My project has 2 entities splitted into 2 separate services with their own code base, both have their own JSON APIs: Exchange -> /exchanges and Market -> /markets
Those 2 entities are linked by a one to many relationship: An Exchange -> has many -> Market
If I develop a frontend app to display this data, I'm going to import ProjectAPILib into it in order to fetch my data when I need it (client side use case).
In MyProjectAPILib, I will find 2 stores (one for Exchange and one for Market) and each one will handle the requests to be made to the JSON APIs endpoints /exchanges or /markets.
When the data fetching request hit one of my service, let's say Exchange, inside this service I will import MyProjectAPILib and replace the Exchange store JsonApiEntityProvider by a local data provider depending on where is stored my Exchange data, let's say an SQL database, so I will use a SQLEntityProvider.
Inside my Exchange service, I will then be able to fetch my data from a local DB through my ExchangeStore while fetching JSON API Market data using the MarketStore

Do you see where I want to go?

Hello,

If I understand well, you plan to use this library in client side applications only right? In order to be able to fetch remote data from APIs?

No, it is planned for both client and server. By answering yes/no I meant in the first round the plan was to focus on API's as there are not too much good alternatives in my opinion.

How are architectured your projects?

Are you asking about libraries or projects where they used?

Do you see where I want to go?

The same way as I do. :D

And that's why I asked if you planned to replace TypeORM or at least do an SQLEntityProvider.

The answer is yes there are plans to do that. I wanted to proceed with ODATA  or GraphQL when fix issues with JSON:API but based on your request maybe I have to reorder the plans. Will see... There are many things to consider when it comes to dealing with databases.
What slice of functionality are you looking for when talking about SQLEntityProvider? What kind of databases you are interested in? Btw do you think you can help with implementation of some parts related to SQLEntityProvider?

Do you have a tasks board where I can see what you plan to do then we can iterate from there?
On my side I'm interested to have at least one remote connector (JSON API) and one local connector (DB) full functional ASAP in order to be able to use this library both from client side and server side. It's not my priority to have ODATA or GraphQL handled as they are only for client side/remote data (it will not solve my local data need).

Do you have a tasks board where I can see what you plan to do, the time it needs to be done then we can iterate from there?

There are no any board as for now. I don't have to create a board for my self due to time management. I keep ideas as a simple list. The nearest tasks I plan to work on is to enable source maps for all projects and provide response validation for JsonApiEntityProvider to close an open issue.

Yeah we can proceed almost immediately. I have not started other providers yet so it is ok. We can create a repo + board. Identify the issues to solve. From what I see we need query, filtering, saving and pagination part. The same functionality which is present for JSON:API. Right? Or migrations should also be involved? Creating a connector rather simple task in comparison to initializing and updating the database.

Hello,

Identify the issues to solve. From what I see we need query, filtering, saving and pagination part. The same functionality which is present for JSON:API. Right?

Exactly, we have to do the same in SQL syntax terms: SELECT, INSERT, UPDATE, DELETE ; filtering: WHERE ; paginating: LIMIT/OFFSET.
No need for migration, I'm going to challenge you on this: What's the value added by @dipscope/type-manager compared to other model decorating libraries (let's say, TypeORM :D)?
I'm going to be a lot challenging on every parts of this project to be sure that you/we are not re-inventing the wheel.

Hello,

What's the value added by @dipscope/type-manager compared to other model decorating libraries (let's say, TypeORM :D)?

Well first of all it is not decorator library. I promote it mainly as serialization / deserialization library as it solves many issues of existing serialization libraries, e.g. TypedJSON, class-transformer which stay open for months. Decorators are simplification for several basic functions provided by library and that's it. You can decorate 3rd party classes pretty easy if you would like or use different decorator configurations for the same entities within one application.
The main purpose of @dipscope/type-manager is as it says in its name to manage types:

What is the type name?
What properties and constructor arguments type has?
What are the name, type, default value, ... of a certain property.
Which are descendant classes?
What are generic types for types like Map<TKey, TValue>?
What are polymorphic types for types like Array where TShape is polymorphic?
How to build a type and what services must be injected into it?
How it should handle references including circular one, e.g. type referencing them self?
How it should treat namings, e.g. snake_case vs PascalCase?
How it should treat data which is not match by type, e.g. type conversions?
...

And this is only a top of the list for which @dipscope/type-manager was developed for. Besides it provides methods to assign custom decorator data and later use it for types and properties. This function used in JsonApiEntityProvider to provide JSON:API related config. And the same function will be used in SqlEntityProvider to at least tell in which table type is stored.
Unfortunately ~ 60% of use cases provided by TypeManager stay undocumented still. I've described parts related to serialization and deserialization and it is already huge enough. I hope there will be a hand in the future to help me with documenting all the stuff in details.
So in general it is not anyhow related to EntityStore or TypeORM. It is completely self-sufficient library which solves it's own issues. But EntityStore is directly dependent from TypeManager. You can think about it as a plugin for TypeManager so on top of all provided features you are getting an ORM to fetch the data and perform all that crazy stuff which offers you a TypeManager. In the end what each plugin for EntityStore should do is to build a plain object tree based on the command provided by EntityStore and pass it through TypeManager deserialization process to get a type you want.
And here we come to EntityStore area. :)

The complexity of the project is not on connectors/drivers I think, it's on the merge of multiple drivers output to make a response, i.e: filtering a set by relationships. :)

To solve this issue EntityStore was developed. It provides you all this information of how to build each type and their related relationship metadata. What a plugin does is just traversing an expression tree of what it gets from EntityStore.

If I have Post + Tag + Author models and posts have tags (many to many relationship) + an author (one to one relationship). How is behaving the library when I say that I want to fetch all posts which have the tag "toto" and are made by author "admin"?

Many to many relationship filtering is currently not implemented. I'm still thinking about best way to handle it in the API. But based on your example if consider that many-to-many relationship filtering is implemented as I see it now here will be a request to fetch data. e.g. SELECT statement which SqlEntityProvider should handle.
const postCollection = await postSet
    .filter((p, f) => f.and(f.eq(p.postTags.tag.name, 'toto'), f.eq(p.author.name, 'admin')))
    .paginate(p => p.offsetLimit(10, 20))
    .findAll();

SELECT [serializedPostProperties]
   FROM posts p,
             posts_tags pt,
             tags t,
             authors a
 WHERE p.id = pt.post_id
     AND pt.tag_id = t.id
     AND p.author_id = a.id
     AND t.name = 'toto'
     AND a.name = 'admin'
OFFSET 10
   LIMIT 20

Or it may be an UPDATE statement.
await postSet
    .filter((p, f) => f.and(f.eq(p.postTags.tag.name, 'toto'), f.eq(p.author.name, 'admin')))
    .paginate(p => p.offsetLimit(10, 20))
    .update({
        name: 'New Post name'
    });

UPDATE posts
         SET name = 'New Post name'
   WHERE id IN (
        SELECT p.id
         FROM posts p,
                   posts_tags pt,
                   tags t,
                   authors a
       WHERE p.id = pt.post_id
           AND pt.tag_id = t.id
           AND p.author_id = a.id
           AND t.name = 'toto'
           AND a.name = 'admin'
      OFFSET 10
         LIMIT 20
   )

The first one results in BulkQueryCommand and the second one in BatchUpdateCommand. This commands should be handled by SqlEntityProvider.
To build a SELECT part you have to use TypeMetadata provided in the command and implement a visitor for IncludeExpression to load relationships if any requested. To build FROM and WHERE part you have to write a visitor which will go through FilterExpression provided by EntityStore. To build pagination part you have to write visitor for PaginateExpression. After you get the data for SQL command you have to create a raw object representation or a list of objects for the data you get and then deserialize it using TypeManager which will handle and resolve all dependencies, data transformation and references.

Which model/service is hosting the data related to the relationship between Post and Tag? Post service? Tag service? Both? Another service? :)

The relations between entities, e.g. one-to-one, one-to-many, many-to-many can be identified using TypeManager. The most simple solution is to check if entity has configured table decorator which can be provided by SqlEntityProvider. This are already implementation details. Just keep in mind that in most cases relationship and types are already there as they provided by TypeManager in related TypeMetadata attached to each command which you built using EntityStore.
If you mean by hosting data related to the relationship between Post and Tag some state which is tracked when you get entities from a store. This is planed for the next versions of EntityStore. In v.1.0.0 it is simple CRUD ORM library without any state control.

I'm going to be a lot challenging on every parts of this project to be sure that you/we are not re-inventing the wheel.

We are actually reinventing a wheel in some manner. :)
Each similar project is about reinventing a wheel. Lets say I have some vision of how such software should behave. Open source is always about finding the people which have the same vision on similar problems. For example TypeORM may be perfect for one and bad for others. The same is applied to EntityStore. It is good if there are a choice. ;)

Thanks for the detailed explanation.
About the many to many relationship example (Posts, Tags and Author), I think you didn't get what I was implying because you gave me a SELECT with a WHERE clause in it.
Posts, Tags and Author are not in the same database nor in the same service so you cannot do it in a single SQL request statement to handle that.
And that's why I asked where do you store the relationships data :)
In a micro-services app, by having every model splitted into isolated services, you lose the ability to do a JOIN (in SQL term) in order to link your data together and do the filtering.
The joining must be done by the library you are developing ;)

Thanks for details! Looks like I've finally got your idea. :)

About the many to many relationship example (Posts, Tags and Author), I think you didn't get what I was implying because you gave me a SELECT with a WHERE clause in it.

I gave a SELECT statement as an example which can be sent to a database by a plugin. You can build and send any requests including case with multiple databases and then filter, sort and paginate data in memory like it is done in InMemoryEntityProvider.

The "joining" must be done by the library you are developing ;) there is a post request processing to do

This are details of underlying EntityProvider. EntityStore is designed to provide you abstract expressions with metadata. How this expressions are handled with one database or several, merged or transformed is not responsibility of EntityStore so I am not going to change anything in the core as it contradicts with underlying concept in general.

In a micro-services app, by having every model splitted into isolated services, you lose the ability to do a JOIN (in SQL term) in order to link your data together and do the filtering.

I don't know your project architecture but looks like you over engineering. Of course you know better what you are doing but the concept of merging and filtering you described will result in poor performance because of network requests and in memory filtering. Besides if one service goes down then ORM become broken. This is not how microservices intended to work based on my experience.
Such cases like merging data from several microservices in realtime makes them depend. This is a critical point of failure. What you can do instead is setup messaging brokers and create readonly view in a special separate microservice which updated using events from underlying services when there are related changes. Such service will work for the end users even if all other services go down. You can use regular ORM like TypeORM for it to read data without any hacky things with merging. But a question if you really have to? :)
I've build event sourced systems and regular one. In both cases Post, Tag and Author should be a part of one microservice as they coupled together in one bounded context. Let call it BlogContext. There may be another microservice with entities like User, Company, Address which are part of IdentityContext. They may communicate via messaging brokers, API or GRPC. Each microservice must be self-sufficient and host critical data it depends from. Most probably info about Post, Tag and Author must be saved together and be a part of one single transaction within one microservice. Otherwise you are building a distributed monolith.
There are also complex scenarios like distributed transactions e.g. transactions which span multiple services. But note that this is a little bit different from what you described. It is about that you cannot change data until there will be some required state. For example in market aplication you cannot send product to customer (ShippingMicroservice) until you withdraw the money from local account (AccountingMicroservice) and you cannot withdraw the money until bank system (ExternalService) tells you that there is required amount. If there are no event sourcing concept involved people usually use saga pattern. Just connect their favourite ORM per bounded context (microservice) and call propper API's with proper entities which are defined per each context. In this case TypeORM as part of saga covers such use case completely.
However there are exist libraries at least for C# which allow you do thing which you are going to do. For example HotChocolate GraphQL stitching module. Maybe similar libraries exist for TypeScript which allows to create a schema from several different services / databases / rest API's but as I described this is not a best approach in case of microservices in my opinion.
Sorry for a long post. I tried to be as short as possible with my thoughts as I see that there is no need for us to invent something. At least this is not an area where I plan to go with a library. :)


Test bundle viz command deprecation

What was the end-user problem that led to this PR?
The problem was that we were not printing any deprecation messages for bundle viz.
What was your diagnosis of the problem?
My diagnosis was that we are removing bundle viz at the same time as deprecating it. Thus, the deprecations never actually show up.
What is your fix for the problem, implemented in this PR?
My fix is to first deprecate the command on bundler 2, then remove it in bundler 3.
Why did you choose this fix out of the possible options?
I chose this fix because it's the most sensible approach to this removal.

Thanks @colby-swandale!
@bundlerbot r=colby-swandale

Had to rebase this on top of #7029 and adapt it. It should be ready now!
@bundlerbot r=colby-swandale


Icon Refresh

Hey there. 👋🏻
Apologies that this is kind of a “drive-by” commit.
I opened an older Godot project today to remind myself what plugin I was using before to import Aseprite files.
Then, I went to check if Aseprite Wizard was still being updated.  My old project had version 2.0.0 installed, so I’m happy to learn that it’s still under active development! 😁
But… seeing the icon for it in Godot’s AssetLib tab… 🤔
Well, no offense, but it doesn’t look like the most up-to-date of the available options anymore. 😒
Let alone the fact that it’s the only option I can see that hasn’t been abandoned.
So, it seems like maybe Aseprite Wizard has outgrown its original icon.
I’m not the best pixel artist, but I figured it should be easy enough.
I probably spent roughly an hour on it, mostly tweaking it since I’m never completely happy with things.  And technically I cheated, because I started with an older Witch Hat of mine as reference (that hat was far too big though, and said “Witch” far more than it said “Wizard”).
But anyway, rambling aside, here’s a refreshed icon if you want it. 😅
I’ve also got a “No Wand” version if you’d rather that.  I had planned for the wand to be the alternate version, but idk, it's kinda growing on me.

No worries if you’re not interested.  Just thought I’d share.
(Also note, I’ve only updated icon.png, so you’ll probably need to import it into your Godot project to recreate the icon.png.import file.)
Hope you like it. 😁

Hello @mayamcdougall .Thank you. I love it. It is better indeed. In all honesty, I was a little bit lazy about the current logo. It was a last minute thing I might have done at 2am and never went back to it. My hat looks more like a traffic cone than really a wizard hat lol.
I like the colors you used and I'm also split between the wand and no-wand version. I'd usually go for the simplest one, but the wand does give it more personality.
The only thing I didn't like so much is the narrow section of the hat brim. I guess this is required to not "glue" the eye to the hat, but it bothers me a little bit. I opened your file quickly here and played around adding and removing pixels for a minute:

0 is your original version. 1 and 2 just move a pixel around but they are still a little bit jagged, and 4 and 5 cheat a little bit by either making the eyes smaller or moving the hat up. I think 3 is my favorite.  What do you think?

It was a last minute thing I might have done at 2am and never went back to it.

I figured that was probably the case.  Just one of those "back burner" things that you always mean to get around to, but they're never urgent enough to find the time.
That's what inspired me to do it: It might feel like a burden for you, but a fun project for me. 😉
Just the stray thought of "You know, if the icon bugs you, you could probably contribute a new one easily enough," and suddenly I'm drawing in Aseprite. 😂
Nanner 32 was the palette I used, just because I was already using it for a project and it's got some nice blues.

I'd usually go for the simplest one, but the wand does give it more personality.

I know, lol.  That was my plan, but then I ended up liking the wand version more. 👀

I guess this is required to not "glue" the eye to the hat

I have stared at that pixel SO much.  That's exactly the reason why it's a little off.  I tried most of those options, and I just didn't like how they looked.  I figured I was just worrying about it too much, and called it "good enough".
Guess it caught your eye too though. 😅

So, I got a little distracted when I started writing this reply the other day.  I decided to work on that pixel a little bit, when I realized that I wasn't really using those "nice blues" in the color palette that I'd mentioned very effectively.
Before I knew it, I'd done this (plus old version for comparison):

As far as the original options go: Shape-wise, it's closest to number 5, but moved to the right instead of up.  The brighter highlights also bring it more in-line with the original icon.  I thought the darker colors looked good when I was only using like, two shades, but with the more detailed shading, the highlights really make it pop.
I'm open to working on it more if you're not happy with this solution for "the pixel" though.  I'm not 100% happy with the way the hat is starting to "run away" from the Aseprite icon, lol, but I think the new shading, at least, is a decent improvement.
I think the reason why the eyes are being so much of an issue is that technically the perspective is wrong.  The Aseprite icon is either looking directly forward, or slightly up... meaning the hat should be tipped back and mostly hidden by its brim... which isn't an easy angle to draw. 😒

I like this new blue. :) Yeah, the perspective doesn't help, but it's fitting ok.

I'm not 100% happy with the way the hat is starting to "run away" from the Aseprite icon

Yeah, that also bothered me about option 5. When I look at the new position compared to the previous ones I don´t really like it all the much, but it's probably not a big of a deal. We are likely looking at it for too long and starting nitpicking haha.
Feel free to update the icon with the new colors and all. Thank you :)


No .exe or .Picker ANYWHERE! please help!

i can't find the program that RUNS it! please help!

me too

did you download just the source or the compiled version?

Really guys? How hard is it to extract the software?! Simply extract the software anywhere on your computer and run any of the two executables.

ElPumpo, есть скайп?Я не понял, что нужно сделать и у меня нет Exe. Я нажимаю извлечь на рабочий стол и не фига нету Exe /

@M23Nono why in russian!? What makes you think any of us understands the language???

download from here:
https://github.com/gibbed/SteamAchievementManager/releases/download/7.0.11/SteamAchievementManager-7.0.11.zip
Your welcome


Data structure

I was wondering how the data files are supposed to be organized? Do take the subject files like s007 from the moshpp, fbx, force, AMASS and put them in one s007 folder? And should this be contained in a "Data" folder.

I managed to get the file structure to work but now I'm having issues Predict.ipynb file.
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

I finally managed to get to the last step

of the visualizer but am running into a smplx error

I downloaded the third smplx link on the smplx website but I'm not sure why it's saying smplx does not exist.
I also made sure to change to smplx in the aitviewer files but the line 205 we are supposed to change isn o longer there in aitviewer so I changed it in the other lines that have mode_type for a smpl type.

I finally got all the files properly setup and managed to run visualize_target_pred_s7.py but ran into a error. Below is an image of the error:

(groundlink) C:\Users\Chris\GroundLink\Visualization>python visualize_target_pred_s7.py
Data keys available: ['trans', 'gender', 'mocap_framerate', 'betas', 'poses']
1781 poses of size  165.
1781 trans of size    3.
1 shape of size   16.
Gender female
FPS 250.0
Traceback (most recent call last):
File "C:\Users\Chris\GroundLink\Visualization\visualize_target_pred_s7.py", line 53, in
seq_amass = SMPLSequence.from_amass(
File "C:\Users\Chris\GroundLink\Visualization\aitviewer\aitviewer\renderables\smpl.py", line 241, in from_amass
return cls(
File "C:\Users\Chris\GroundLink\Visualization\aitviewer\aitviewer\renderables\smpl.py", line 161, in init
global_oris = local_to_global(
File "C:\Users\Chris\GroundLink\Visualization\aitviewer\aitviewer\utils\utils.py", line 342, in local_to_global
if parents[j] < 0:
IndexError: index 22 is out of bounds for axis 0 with size 22

Fixed more issues, the one above was an issue using the new version of aitviewer. I reverted to a previous version I believe 1.12.0 and now I'm having this issue.